Author Topic: Debugger auto-resumes session  (Read 3782 times)

mdello317

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Debugger auto-resumes session
« on: June 27, 2017, 08:13:49 PM »
I am debugging Cortex M0 ARM with a cross compiled GDB on windows, connecting to my target with Segger J-Link. I am able to attach debugger and automatically reset/halt/restore my image to the device RAM on debugger attach with a GDB init file.

My init file also set the PC to the start of my init code (function _start()), which uses constants defined in my linker script to zero out the BSS section in RAM, then it calls main().

If I step once the debugger comes up in this state, the debugger takes off instead of stepping into my code. I can then pause the execution and start stepping without issue, although at that point it's way beyond where I want to step through execution.

I can also set a breakpoint past the init code (in my GDB init file... at main()), then when the debugger comes up, click "play", it runs to the breakpoint and then I can step without issue.

I just can't step from that initial starting point (_start()) without the debugger "taking off".

I turned on debug logging and see where I try to step and the debugger takes off. I see:

GDB handle_event: *stopped,reason="end-stepping-range",....

then immediately I see:

GDB session: RESUME
  GDB resume: START, timeout=0
    GDB resume: sending -exec-continue
      GDB send: command-exec-continue

Anyone have any ideas why this is happening when all I want is to step?

If I call my GDB exe from the command line and step using the same GDB ini file (without the breakpoint at main()), I can step instruction (si) without issue and step through the entire init sequence. Using the SlickEdit debugger gives different behavior.

Thanks for any ideas or suggestions.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Debugger auto-resumes session
« Reply #1 on: June 30, 2017, 05:42:07 PM »
Are you doing a step-into or a step-instruction with SlickEdit?  (step-instruction is the toolbar icon with the little magnifying glass on the Debug toolbar).

mdello317

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: Debugger auto-resumes session
« Reply #2 on: July 01, 2017, 02:28:36 PM »
Are you doing a step-into or a step-instruction with SlickEdit?  (step-instruction is the toolbar icon with the little magnifying glass on the Debug toolbar).

I tried all stepping methods and they all appeared to behave the same.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Debugger auto-resumes session
« Reply #3 on: July 03, 2017, 04:50:16 PM »
I would need to see your full debug log for a session where you do step-instruction.

mdello317

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: Debugger auto-resumes session
« Reply #4 on: July 03, 2017, 05:12:56 PM »
I would need to see your full debug log for a session where you do step-instruction.

Thanks, Dennis ... I'm attaching my SlickEdit debug log (debug.log), and in case they are useful, my J-Link GDB Server console output and the gdb.ini file (executed using the --command argument in my SlickEdit GDB config)

mdello317

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: Debugger auto-resumes session
« Reply #5 on: July 03, 2017, 05:15:50 PM »
I should've mentioned if I didn't already or you can't tell from the debug.log that the debugger session begins with the PC at the beginning of _start(), then I click "step into" and it executes all the instructions until the breakpoint I've set at main() instead of stepping into _start()'s code.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: Debugger auto-resumes session
« Reply #6 on: July 10, 2017, 08:23:41 PM »
OK, I've confirmed that this is a bug.  I will put in a fix for the next release.  It can not be hot fixed.

mdello317

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: Debugger auto-resumes session
« Reply #7 on: July 28, 2017, 07:13:48 PM »
Thanks for the update, Dennis