0

In Delphi I got used to pressing F12 whenever my program becomes irresponsive to see what the Main thread is doing, mainly for stack trace but sometimes also local vars.

Now I am playing around with SharpDevelop and can't see anything quite like that. Is it possible at all?

Anton Duzenko
  • 2,366
  • 1
  • 21
  • 26

1 Answers1

0

There is not pre-defined keyboard shortcut in SharpDevelop for debug break. It is available from the Debug menu by selecting Debug - Break. You can also press the pause button in the main toolbar.

If you want a keyboard shortcut then you would need to edit the ICSharpCode.SharpDevelop.addin file and add a shortcut to the Break menu. Below shows the Break menu item, without a keyboard shortcut, and the Continue menu item which has F5 as its shortcut.

        <Condition name="DebuggerSupports" debuggersupports = "ExecutionControl">
            <MenuItem id = "ExecutionControlSeparator" type = "Separator" />
            <Condition name="IsProcessRunning" isprocessrunning = "True" isdebugging = "True" action = "Disable">
                <MenuItem id       = "Break"
                          label    = "${res:XML.MainMenu.DebugMenu.Break}"
                          icon     = "Icons.16x16.Debug.Break"
                          class    = "ICSharpCode.SharpDevelop.Project.Commands.BreakDebuggingCommand"/>
            </Condition>
            <Condition name="IsProcessRunning" isprocessrunning = "False" isdebugging = "True" action = "Disable">
                <MenuItem id       = "Continue"
                          label    = "${res:XML.MainMenu.DebugMenu.Continue}"
                          icon     = "Icons.16x16.Debug.Continue"
                          shortcut = "F5"
                          class    = "ICSharpCode.SharpDevelop.Project.Commands.ContinueDebuggingCommand"/>
            </Condition>
        </Condition>

So you can add a new shortcut attribute for the Break menu item if you want to by editing the ICSharpCode.SharpDevelop.addin file.

Matt Ward
  • 47,057
  • 5
  • 93
  • 94
  • No, I mean the debug break from inside the app not in IDE – Anton Duzenko Aug 09 '16 at 13:10
  • You can do that if you are running the app under the debugger. Or you can attach to the process and then break into it. – Matt Ward Aug 09 '16 at 15:48
  • Does this ring any bell? When the F12 key is pressed and the application in focus is being debugged, Windows NT calls a function similar to DebugBreak(), which executes a hard coded breakpoint instruction. The integrated debugger then traps the exception generated by this instruction. – Anton Duzenko Aug 10 '16 at 10:02