Author Topic: GDB skipping cpp files  (Read 4420 times)

marfig

  • Guest
GDB skipping cpp files
« on: July 16, 2006, 01:04:20 pm »
At least that's how I perceive it. Not sure though...

I installed GDB 6.3.2 last night to go along with July, 14th nightly build. I'm building with g++ 3.4.2. Bellow is an example code to illustrate the problem:

Code
#include <cstdlib>
#include <iostream>
#include "strdouble.hpp"

int main() {
    strdouble test2("999.43345678342");  // breakpoint is set here
    double a = test2.value();

    return EXIT_SUCCESS;
}

Just a few minutes before with gdb 5.2.1, I was debugging this without any problems. Once that breakpoint was reached and I "stepped-in", it would send me to that class constructor. But now it sends me to the iostream header(!).

Only when I set the breakpoint on the next line (double a = test2.value();) does it behave normally and moves to the strdouble.cpp file where value() is being defined.

I must be doing something wrong...

marfig

  • Guest
Re: GDB skipping cpp files
« Reply #1 on: July 16, 2006, 01:58:29 pm »
I shouldn't have posted. I'm sorry.
A search on the forums informed me there is a bug and also of a workaround by sending the debugger an rbreak command.

However, I am curious...

Why are the Nightly Builds beeing developed to support a faulty debugger? Class constructors are certainly a big part of the debugging process. The workaround with rbreak pointing to the constructor name could be seen as a minor thing. However, any breakpoint thereafter inside the constructor needs to also be manually set. Once the debug session finishes these breakpoints are lost. And they need to be set all over again for the next debug session. This can quickly become too demanding.

I am curious as to why support a faulty debugger? Maybe I'm missing something. However my reaction had to be downgrade back to 5.2, and forget about the Nightly Builds (and apparently the upcoming RC3). 6.3 is 2 years old. There is nothing indicating this bug will soon be fixed...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: GDB skipping cpp files
« Reply #2 on: July 16, 2006, 03:06:56 pm »
additional questions are :

- is the bug only present in the MinGW port of GDB ?
- in case it in all gdb's (not just the MinGW port) is it already fixed in the latest GDB ?


I think there were other problems also with GBD 5.2, don't ask me which, but i think there were several.

Let's hope we get a new and better gdb in th future (hopefully rather soon then late)

marfig

  • Guest
Re: GDB skipping cpp files
« Reply #3 on: July 16, 2006, 05:31:35 pm »
Those are indeed good questions. Gives sense as to why 6.3 was chosen.

... Well, as you say. Lets hope they fix this soon.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: GDB skipping cpp files
« Reply #4 on: July 16, 2006, 11:42:35 pm »
I am curious as to why support a faulty debugger? Maybe I'm missing something. However my reaction had to be downgrade back to 5.2, and forget about the Nightly Builds (and apparently the upcoming RC3). 6.3 is 2 years old. There is nothing indicating this bug will soon be fixed...

Hello,

With GDB 5.2 there was the pending breakpoints problem (IIRC).

I have also tried to build a new version of GDB, but without success (there should be a post of mine somewhere in the forum :)).

Best wishes,
Michael