SharpDevelop and DebugBreak (F12 key)

140 Views Asked by At

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?

1

There are 1 best solutions below

3
On

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.