Author Topic: Debugger plug-in: Considering adding breakpoints while running  (Read 9021 times)

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
The debugger plug-in currently disallows adding breakpoints while the debugger is running.

I was considering (at least for my own build) allowing the addition of breakpoints on the fly where it would stop the debugger, and if successful at that, add the breakpoint and immediately resume.

Has this been tried before?

Are there tricky considerations that I maybe haven't thought of?

Would this perhaps be worth adding to the C::B trunk? 

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #1 on: March 14, 2008, 01:00:48 pm »
Hi !

It is partially true.
You can pause the debugger, put your breakpoint and resume it.

Dje

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #2 on: March 14, 2008, 03:04:15 pm »
It is partially true.
You can pause the debugger, put your breakpoint and resume it.

Hi, Dje.

Yes, I do that now.   :)

I was asking from an interface perspective.  Seeing how, as you describe, it's always possible to add a breakpoint..but sometimes it's one step and sometimes it's three steps.

I suspect it would be easy for me to change the plugin so it's always the same one step, nice and fluid and consistent.  Click, bam, done.  I figured before I dove in I would ask if there was any technical reason that it's not like that now.  Wisdom of the masses, ya know?   :)

Disclaimer: I'm a professional interface snob.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #3 on: March 14, 2008, 03:19:57 pm »
I think a one time 'add breakpoint' is what we need.
The other IDE's I use (Code Composer Studio, Developer Studio) do it like that too.

No matter how it looks on the inside [you need to pause GDB ?, then you can tell GDB there's a new breakpoint ? then have GDB continue/resume ?] this should be hidden from the user. The user wants to add a breakpoint [simple as that], he couldn't care less if this is a 1 step deal, or 3 step, or 100 steps for that matter. You just don't want the user to do all those steps.

This has been one of the things that have driven me crazy ;-)

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #4 on: March 14, 2008, 04:22:22 pm »
I think a one time 'add breakpoint' is what we need.

This has been one of the things that have driven me crazy ;-)

Done!

I'll post the patch once I've had time to give it more testing.   :D

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #5 on: March 14, 2008, 05:10:20 pm »
I don't know what you are all talking about... At least on Windows, adding/removing a breakpoint while already debugging works just fine. I do it every day...?! Might someone enlighten me? Is this a Linux issue?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #6 on: March 14, 2008, 05:21:25 pm »
I don't know what you are all talking about... At least on Windows, adding/removing a breakpoint while already debugging works just fine. I do it every day...?! Might someone enlighten me? Is this a Linux issue?!

Using the GDB debugger plug-in, if the debugger is running (not just in "debug mode", mind you, but the debug target is currently running) my attempts to add a breakpoint are ignored.

If I click on the left margin, nothing happens.

It does work however if I pause the debugger, add the breakpoint, then resume.

You can see why this is if you look in debuggergdb.cpp.  All of the breakpoint editing functions begin with this
Code
    if (!IsStopped())
return false;



Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #7 on: March 14, 2008, 07:21:20 pm »
Using the GDB debugger plug-in, if the debugger is running (not just in "debug mode", mind you, but the debug target is currently running) my attempts to add a breakpoint are ignored.
I am telling you: I *am* in debug mode and I *am* in the process of debugging an application (e.g. a BP has just hit). And while doing this I can just add/remove BP's on the fly. Just as I said. Shall I make a video or what?!

Probably it would be of help if you provide me with a project & step-by-step explanation to reproduce.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #8 on: March 14, 2008, 07:35:22 pm »
I am telling you: I *am* in debug mode and I *am* in the process of debugging an application (e.g. a BP has just hit). And while doing this I can just add/remove BP's on the fly. Just as I said. Shall I make a video or what?!

I believe you!  I believe you!   :lol:

Note that you said "a BP has just hit".  What the rest of us are talking about is if a breakpoint hadn't just hit.  What if there were no breakpoints...the program was just running...and you wanted to add one?

Put another way, when debugging you can only edit breakpoints while the debugger is paused.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger plug-in: Considering adding breakpoints while running
« Reply #9 on: March 14, 2008, 07:52:54 pm »
Note that you said "a BP has just hit".  What the rest of us are talking about is if a breakpoint hadn't just hit.  What if there were no breakpoints...the program was just running...and you wanted to add one?
Put another way, when debugging you can only edit breakpoints while the debugger is paused.
Ah - OK. Confirmed... Phew... that was a hard way to go. I was already under the assumption I am a complete idiot. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ