I use arm-gcc and gdb under Linux (ubuntu).
When I try to debug my code under gdb, when I stop in say "init_something ()" and then type "next", the next instruction is always some interrupt handling stuff. Is there a way to get this to work normally?
GDB debugging.
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: GDB debugging.
I don't usually use GDB directly but Eclipse uses it internally, it works under Linux for me.
It looks like you are hitting an exception and it jumps into the default handler.
Giovanni
It looks like you are hitting an exception and it jumps into the default handler.
Giovanni
Re: GDB debugging.
It is just a normal "timer" interrupt. Or maybe USB. I don't know. But I can never step through MY code because it keeps going into the interrupt handler when I single-step the target.....
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: GDB debugging.
Are you able to step up to chSysInit()? interrupts should be disabled up that point.
Giovanni
Giovanni
-
- Posts: 166
- Joined: Wed Jan 09, 2019 12:37 pm
- Has thanked: 19 times
- Been thanked: 31 times
Re: GDB debugging.
I struggle with single stepping as I have frequently firing interrupts at high priority. My usual debugging process is to set several breakpoints for the area of code of interest, and just examine the code when it hits these. Often I add another breakpoint for the next line of interest so 'continue' will let the interrupts run, but effectively step to the next line in the thread of interest.
Another option would be to disable the interrupts while debugging specific sections of code, which means having a diagnostic build.
You might also see if next, until or advance would work better for you.
Another option would be to disable the interrupts while debugging specific sections of code, which means having a diagnostic build.
You might also see if next, until or advance would work better for you.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Who is online
Users browsing this forum: No registered users and 8 guests