GNOME Bugzilla – Bug 631156
Add a start debugger button in the toolbar
Last modified: 2020-11-06 20:23:10 UTC
Moved from bug #483599: It would be nice if this plug-in will also include a new pair of buttons: "Run program with debugger" (the same action as pressing SHIFT-F12) and "Stop debugger". "I have removed the suspend button in the tool bar and replaced the continue button by a button that is doing continue or suspend depending on the debugger state." could it be envisaged that the same button, when FIRST pressed will start the program in the debug mode? (It should also become active after building the program, just like the "wheels" button on the toolbar. Anyway, the bottom line is that I am still pushing for the change of having "Start debugging" and "Stop debugging" on the toolbar. I found that immensely practicable in other IDEs
(In reply to comment #0) > could it be envisaged that the same button, when FIRST pressed will start the > program in the debug mode? (It should also become active after building the > program, just like the "wheels" button on the toolbar. I think it's not a so good idea because it's often useful to restart the program even when it is already running (so when this button has the continue function). > Anyway, the bottom line is that I am still pushing for the change of having > "Start debugging" and "Stop debugging" on the toolbar. I found that immensely > practicable in other IDEs Yes, I miss the "start debugging" button too. I have the idea to merge the Run Program without debugger and Run Program with debugger in the same button. By example always running the program with the debugger if compiled in Debug configuration. But as both functions are provided by a different plugin it's not obvious. I should probably just add a start debugger button. Then I think the "Stop debugging" button is not needed. You don't really care if the debugger is running or not, it's just useful to free some memory. By the way, the anjuta toolbar is configurable if you edit the configuration files with a text editor. By example, in /usr/share/anjuta/ui/anjuta-debug-manager.xml you can add: <toolitem name="RunDebug" action="ActionDebuggerRunTarget" /> after <toolbar name="ToolbarMain"> <placeholder name="PlaceholderDebugToolbar" > and you will get the start debugger button. The only issue is that there is no icon defined for this action.
Thank you, Sébastien. I added <toolitem name="RunDebug" action="ActionDebuggerRunTarget" /> <toolitem name="StopDebug" action="ActionDebuggerStop" /> at te indicated place, in order to have both "Run program with debugger" and "Stop debugging process". There is no icon defined to the "RunDebug" button. Concerning your remark: "Then I think the "Stop debugging" button is not needed. You don't really care if the debugger is running or not, it's just useful to free some memory.", the way I see this "Stop debugging" button is not exactly for stopping the debugger, but for terminating the debugging session. Imagine that you are debugging a program, you spot the error in the source code and you want to quickly edit the source code and to re-build the program. For that, you need to terminate the debugging session and this could be, indeed, achieved by letting the program to continue its run until it crashes. However, this could be long and undesired. I am not sure that the action "<toolitem name="StopDebug" action="ActionDebuggerStop" />" that I added above achieve this, although it indeed stops the debugger (but it generates a lot of messages). The Eclipse (Helios release) Debug Perspective provides 3 buttons: Resume (F8), Suspend and Terminate (Ctrl-F2) on the debugger toolbar. I almost never use the Suspend button (since I am not attaching the debugger to a running process, but I start the whole process under the control of the debugger, just like you would type "gdb program"), but I make heavy use of the other too, sometime even without going back to the editing window (it could happen to miss a thing during debugging and wanting to restart). On the other thread (631139) I will attach some screenshots. Please check-in.
(In reply to comment #2) > the way I see this "Stop debugging" button is not > exactly for stopping the debugger, but for terminating the debugging session. > Imagine that you are debugging a program, you spot the error in the source > code and you want to quickly edit the source code and to re-build the > program. For that, you need to terminate the debugging session and this > could be, indeed, achieved by letting the program to continue its run until > it crashes. However, this could be long and undesired. You don't need to terminate the debugging session, you can just change your program and recompile it while the debugger is running. Then, when your fixed program is ready you can just click on the Start Debugger button to run the new program with the debugger. If the debugger is still running, you will get an error message asking you if you want to stop the previous session. > I am not sure that the action "<toolitem name="StopDebug" > action="ActionDebuggerStop" />" that I added above achieve this, although it > indeed stops the debugger (but it generates a lot of messages). I think the warning messages are normal.
Quoting from: http://mail.gnome.org/archives/anjuta-devel-list/2011-February/msg00020.html " Bug 631156 - Add a start debugger button in the toolbar This bug is still open because I don't know exactly which additional button should I put in the interface. I have already added a button to run the debugger when the debugger is stop and stop the debugger when it is running. I think it would be nice if the execute button could execute the program with the debugger is the Debug configuration is used else without the debugger with a small arrow allowing to select if you want the debugger or not like the File New and File Open. It's probably possible by defining a new action used only here. But I'm not sure if it will be really better. The reporter hasn't replied to my latest proposal." Frankly, I think the best option would be to have two distinct toolbar buttons, each one corresponding to the two entries of the "Run" menu, namely: Execute (F3) -- for executing without Debugger Debug Program (Shift+F12) -- for executing with Debugger The Debug Program toolbar button could include the other options (Debug Process and Debug Remote Target) as alternatives (using the arrow drop-down trick). Thank you for considering my report.
I actually like the idea with the "combo" button which can be changed from debugging to normal run and back. On the other hand we should consider if we should make the debugger even more default in the sense that the user would have to explicitely choose to disable the debugger possibly which a CheckMenuButton. Many other IDEs default to the debugger as it doesn't slow down things to much and gives you so much more helpful information if somethings goes run. That would result in the following Run menu: Run -> Run -> Kill -> Pause (possibly don't know if it's really useful) ----- [x] Run in debugger (Checked by default) ----- -> Run options... We would just have the "Run" toolbar button with has an action according to the menu item. I would move the "Connect to process" and "Connect to external target" menu items to the debugger menu as they are used far less frequently and belong to the debugger a lot more than in the "Run" menu.
(In reply to comment #4) > I have already added a button to run the debugger when the debugger is stop > and stop the debugger when it is running. Ok, so you need to click two times on it to restart the debugger? > I think it would be nice if the execute button could execute the program with > the debugger is the Debug configuration is used else without the debugger with > a small arrow allowing to select if you want the debugger or not like the File > New and File Open. It's probably possible by defining a new action used only > here. Yes, I'm agree. But I don't know how to do it because the execute and execute with the debugger are provided by two different plugin. > Frankly, I think the best option would be to have two distinct toolbar > buttons, each one corresponding to the two entries of the "Run" menu, namely: > Execute (F3) -- for executing without Debugger > Debug Program (Shift+F12) -- for executing with Debugger > The Debug Program toolbar button could include the other options (Debug > Process and Debug Remote Target) as alternatives (using the arrow drop-down > trick). This is the easiest solution, for doing this you just need to move the Debug Process and Debug Remote Target under the Debug Program action, like it's done for new.
(In reply to comment #5) > I actually like the idea with the "combo" button which can be changed from > debugging to normal run and back. Yes, I think it's a best option too, but as the two functions are implemented in different plugin I don't know how to implement this. > On the other hand we should consider if we should make the debugger even more > default in the sense that the user would have to explicitely choose to disable > the debugger possibly which a CheckMenuButton. Many other IDEs default to the > debugger as it doesn't slow down things to much and gives you so much more > helpful information if somethings goes run. Yes. > That would result in the following Run menu: > Run > -> Run > -> Kill > -> Pause (possibly don't know if it's really useful) > ----- > [x] Run in debugger (Checked by default) > ----- > -> Run options... I think Pause is better in the debug menu because it make no sense if the debugger is not running. I would prefer to keep "Connect to process" and "Connect to external target" in the Run menu as it runs something. But putting them in a submenu will be fine as it's not use that often. Instead of having a check box, I would prefer to have a combo button like for the new action. Else this check box could be put in the Run options.
(In reply to comment #6) > (In reply to comment #4) > Ok, so you need to click two times on it to restart the debugger? Although this may seem cumbersome, yes, I think it is the cleanest option. You could also mix the start/stop buttons or start/pause/stop buttons, by changing the state of the same button function of the debugger is running or not. But the initial implementation could go with separate states.
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years. If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/anjuta/-/issues/ Thank you for reporting this issue and we are sorry it could not be fixed.