Skip to Content
Embedded Programming with Modern C++ Cookbook
book

Embedded Programming with Modern C++ Cookbook

by Igor Viarheichyk
April 2020
Intermediate to advanced
412 pages
9h 58m
English
Packt Publishing
Content preview from Embedded Programming with Modern C++ Cookbook

How to do it...

In this recipe, we will use the same environment and the same test application as in the first recipe. Refer to steps 1 to 9 of the Running your applications in the GDB recipe to build the application and copy it over to the target system:

  1. We want to debug our runner function. Let's take a look at its content. In the gdb shell, run the program as follows:
(gdb) list runner,delay_ms
  1. We want to see how the delta changes on each iteration. Let's set a breakpoint at the line:
14 if (delta > limit) {
  1. Use the break 14 command to set a breakpoint on line 14:
(gdb) break 14
  1. Now, run the program:
(gdb) run
  1. Check the value of delta:
(gdb) print delta $1 = {__r = 0}
  1. Continue execution of the program by typing continue, or ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ System Programming Cookbook

C++ System Programming Cookbook

Onorato Vaticone
C++ Cookbook

C++ Cookbook

D. Ryan Stephens, Christopher Diggins, Jonathan Turkanis, Jeff Cogswell

Publisher Resources

ISBN: 9781838821043Supplemental Content