Author Topic: [PATCH] GDB under Linux  (Read 12818 times)

Offline HillClimber

  • Single posting newcomer
  • *
  • Posts: 4
[PATCH] GDB under Linux
« 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]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5300
Re: [PATCH] GDB under Linux
« Reply #1 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).

Offline Phatency

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: [PATCH] GDB under Linux
« Reply #2 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).

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5300
Re: [PATCH] GDB under Linux
« Reply #3 on: January 09, 2007, 09:10:31 am »
patch submitted to berlios (so not yet applied !)
« Last Edit: January 09, 2007, 11:23:01 am by killerbot »

Offline mareq

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: [PATCH] GDB under Linux
« Reply #4 on: January 09, 2007, 10:46:41 am »
When will be this patch added to nightly build? I need it, too.

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: [PATCH] GDB under Linux
« Reply #5 on: January 09, 2007, 10:51:29 am »
tonight
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: [PATCH] GDB under Linux
« Reply #6 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...
Be patient!
This bug will be fixed soon...

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: [PATCH] GDB under Linux
« Reply #7 on: January 09, 2007, 12:12:56 pm »
Sorry, I thought it was already submitted to the svn :oops:
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mareq

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: [PATCH] GDB under Linux
« Reply #8 on: January 09, 2007, 12:26:01 pm »
So, what is the realistic estimate?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: [PATCH] GDB under Linux
« Reply #9 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 :)
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: [PATCH] GDB under Linux
« Reply #10 on: January 10, 2007, 01:59:58 pm »
Patch applied.
Be patient!
This bug will be fixed soon...

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: [PATCH] GDB under Linux
« Reply #11 on: January 10, 2007, 03:46:04 pm »
Hallelujah!  :D

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9616
Re: [PATCH] GDB under Linux
« Reply #12 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]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ