Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: HillClimber on January 09, 2007, 03:29:30 am

Title: [PATCH] GDB under Linux
Post by: HillClimber on January 09, 2007, 03:29:30 am
Hi,

Berlios has locked out my account, and won't re-set it, so I'd appreciate if someone would submit the attached patch for me.

With the stock nightly builds, I was not at all able to use GDB to debug a multi-project application on Linux (Ubuntu/Edgy).  I had to make several fixes to the debuggergdb source to get it to work for me.  I hope the patch is useful.

Here is a list of what I fixed From svn revision 3466:

- Fixed bug which prevented setting breakpoints in sub-projects, by deleting
  code to make file paths relative, as suggested by CB developer.
- Added various comments to document my understanding of what some variables should represent.
- Added ASSERT statement and HasDriver routine to help track down intermittent crash
  due to unsafe use of GetDriver() return value.
- Modified Continue() to use appropriate GDB command (cont, run, or start) depending on program state.
  This allows use of "do not run" configuration feature.
- Fix for (non-)use of m_BreakOnEntry.
- Fixed "Stop" command so it can break the running program

Thanks!

-HC

[attachment deleted by admin]
Title: Re: [PATCH] GDB under Linux
Post by: killerbot on January 09, 2007, 07:35:34 am
see also here : http://forums.codeblocks.org/index.php?topic=4841.msg37904#msg37904

It seems it was not just commenting out the else branch, it ?should? be replaced with 3 other lines of code.

I have no much knowledge on how GDB works, so I can't judge if it is correct or not. Feel free to have a look at the other changes/suggestions made in the other thread.
I feel that with both these changes we might improve the debugging quality of CB ..... NICE :-) :-)

Let's hope Don Corleone finds some time to process the patches.

I will try to register your patch in berlios (first attempt failed, berlios seems to be down again).
Title: Re: [PATCH] GDB under Linux
Post by: Phatency on January 09, 2007, 07:58:15 am
I feel that with both these changes we might improve the debugging quality of CB ..... NICE :-) :-)
I've been able to debug ~5% of the time, because usually I'm writing libraries in my multiproject. Those changes would turn it to 100%. Calling that an "might be improvement" sounds a bit belittling to me (you know, debugging is quite annoying feature when you can't actually use it in your environment).
Title: Re: [PATCH] GDB under Linux
Post by: killerbot on January 09, 2007, 09:10:31 am
patch submitted to berlios (so not yet applied !)
Title: Re: [PATCH] GDB under Linux
Post by: mareq on January 09, 2007, 10:46:41 am
When will be this patch added to nightly build? I need it, too.
Title: Re: [PATCH] GDB under Linux
Post by: David Perfors on January 09, 2007, 10:51:29 am
tonight
Title: Re: [PATCH] GDB under Linux
Post by: mandrav on January 09, 2007, 11:57:48 am
When will be this patch added to nightly build? I need it, too.
tonight

A patch is first reviewed, then applied locally, then tested, then tested again, then tested some more and, if all has gone well, is then committed.
So "tonight" is pretty optimistic considering that my free time is limited these days :(. Unless, of course, if some of the other devs have the time to perform some of the reviewing/testing...
Title: Re: [PATCH] GDB under Linux
Post by: David Perfors on January 09, 2007, 12:12:56 pm
Sorry, I thought it was already submitted to the svn :oops:
Title: Re: [PATCH] GDB under Linux
Post by: mareq on January 09, 2007, 12:26:01 pm
So, what is the realistic estimate?
Title: Re: [PATCH] GDB under Linux
Post by: mandrav on January 09, 2007, 12:48:29 pm
So, what is the realistic estimate?

Could be today, could be tomorrow, could be the day after tomorrow. I really can't tell. It depends on the workload. And of course assuming this patch works fine :)
Title: Re: [PATCH] GDB under Linux
Post by: mandrav on January 10, 2007, 01:59:58 pm
Patch applied.
Title: Re: [PATCH] GDB under Linux
Post by: rjmyst3 on January 10, 2007, 03:46:04 pm
Hallelujah!  :D
Title: Re: [PATCH] GDB under Linux
Post by: MortenMacFly on January 11, 2007, 08:33:58 am
As I was afraid of here:
http://forums.codeblocks.org/index.php?topic=4850.msg38322#msg38322
This patch is far from being perfect. I've attached a sample where it still doesn't work. Place a BP in the DLL function (where the comment is) and there will be no break (still because of absolute path I guess).
With regards, Morten.

[attachment deleted by admin]