Datasheet

(gdb) list
49 /* For now, idle task simply increments a counter to show it is running. */
50 while (1) {
51 ++g_os_idle_ctr;
52 OS_ENTER_CRITICAL(sr);
53 now = os_time_get();
54 sticks = os_sched_wakeup_ticks(now);
55 cticks = os_callout_wakeup_ticks(now);
56 iticks = min(sticks, cticks);
57 if (iticks < MIN_IDLE_TICKS) {
58 iticks = 0;
> Tip: You can adjust the number of lines displayed via set listsize [count]
Displaying code at a specific address
If you wish to display the code at a specific address you can prefix the address
with a * character as shown below:
(gdb) list *0x00009e54
0x9e54 is in crash_device (crash_test.c:46).
41 if (!strcmp(how, "div0")) {
42
43 val1 = 42;
44 val2 = 0;
45
46 val3 = val1 / val2;
47 console_printf("42/0 = %d\n", val3);
48 } else if (!strcmp(how, "jump0")) {
49 ((void (*)(void))0)();
50 } else if (!strcmp(how, "ref0")) {
Running an arbitrary function when halted at a breakpoint
When halted at a breakpoint, you can run a function via the call command. Tip via Håkon Alseth.
> Make sure to include the parenthesis after the function name when issuing the call command, which will cause the
device to go back to the halt state once the function has completed execution.
Connect to the target using $ newt debug target_name or via some variation of the following code:
arm-none-eabi-gdb _build/*.out
(gdb) target remote :2331
(gdb) load
Then run until you hit the BP, and at an appropriate moment execute the call command with your target function
name:
(gdb) mon reset
(gdb) c
<break somewhere="" in="" your="" code,="" optionally="" using="" ctrl+c="">
(gdb) call test_function()
© Adafruit Industries https://learn.adafruit.com/adafruit-nrf52-pro-feather Page 76 of 87