Jump to content


Debugging with interrupts in Eclipse


  • You cannot reply to this topic
No replies to this topic

#1 dschin

    Lead INS Developer

  • Moderators
  • 100 posts
  • Country: flag of United States United States


Posted 03 September 2010 - 01:06 PM

Finally, I can debug with interrupts in Eclipse!!!

Someone has probably already figured this out, but I couldn't find it. You command line developers who have had a solution to this for some can stop laughing at us neophytes who depend on GUIs :)

The solution seems simple now but it was a pain in the butt to figure out. Eclipse (at least in windows) will not let you add command line arguments to arm-none-eabi-gdb. It chokes on them. I tried everything including writing a batch file with the arguments added and calling it rather than rather than arm-none-eabi-gdb directly. You also can't add the "define" command directly in the "Run commands" box because it chokes after the "define" where it sits and waits for you to input more rather than reading the next line. You can however add the line "source <filename>" in the "Run Commands" box and put the define commands in a file.

So here was my solution. See the attached screen capture. In the "Run Commands" box under the “Startup” tab of the debug configurations enter “source InterruptsInEclipse”, leaving the commands in the “Initiliaze Commands” box the same as the Eclipse project on the SVN. The file InterruptsInEclipse, which I am placing in the \flight\projets\gdb directory of the SVN should be copied to the \flight directory. If someone is clever enough to get it to find in the file \flight\projets\gdb directory, then even better.

The InterruptsInEclipse file is the following define commands.
define hook-step
	monitor cortex_m3 maskisr on
end
define hookpost-step
	monitor cortex_m3 maskisr off
end

define hook-stepi
	monitor cortex_m3 maskisr on
end

define hookpost-stepi
	monitor cortex_m3 maskisr off
end

define hook-next
	monitor cortex_m3 maskisr on
end

define hookpost-next
	monitor cortex_m3 maskisr off
end

define hook-finish
	monitor cortex_m3 maskisr on
end

define hookpost-finish
	monitor cortex_m3 maskisr off
end

Attached Images

  • Attached Image: capture.png