Thread: GDB 6.3.2 problems

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446

    GDB 6.3.2 problems

    With gdb 6.3.2 (for MinGW) I can't seem to be able to debug as before.

    Here is a simple example using Dev-C++.

    Code:
    int main() {
        strdouble test2("999.43345678342"); // breakpoint is here
        std::cout << std::setprecision(14) << test2;
    }
    When the breakpoint is reached and I click Step Into, instead of being sent to the class constructor in strdouble.cpp, I am being sent to the iostream header. And after stepping, i'm sent to the end of main.

    I was debugging correctly before. This started happening as soon as I installed gdb 6.3.2. Is there any parameters I need to pass to gdb in order for it to work as expected?
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Since this thread was so popular and since I ended up finding what the problem is, here goes for anyone who is curious or may find this later through the search feature:

    GDB 6.3.2 (for MinGW only) has a bug in which it can't place breakpoints inside ctors due to the way g++ compiles the code. It creates numerous copies of each ctor.

    Details aside, the workaround is to send an rbreak command to the debugger. It has to be an rbreak. A break will not do.

    On my problem above I would send rbreak strdouble::strdouble as soon as the illustrated break was hit. This would create breakpoints on all ctors of strdouble. Once inside the constructor, if more breaks are needed, simple break line_number commands being sent to the debugger will do.

    Breaks being sent through the IDE (by clicking the gutter) will not work. Currently due to this bug in gdb it is not possible to do it.

    Also, Dev-C++ does not fully support gdb 6.3.2. So, best if you don't install it. Code::Blocks Nightly Builds don't support anything short of gdb 6.3.1. So, this is really only a problem for anyone using the Nightly Builds under windows with MingW.
    Last edited by Mario F.; 07-16-2006 at 06:50 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. buffered vs unbuffered question
    By Overworked_PhD in forum Linux Programming
    Replies: 6
    Last Post: 07-04-2008, 04:57 PM
  2. Memory allocation error
    By cunnus88 in forum C++ Programming
    Replies: 5
    Last Post: 01-25-2008, 04:24 PM
  3. Contiguous Array version of Linked List
    By ampersand11 in forum C Programming
    Replies: 19
    Last Post: 10-07-2007, 03:05 AM
  4. Too much output in GDB
    By MacNilly in forum Tech Board
    Replies: 0
    Last Post: 09-13-2006, 12:45 PM
  5. does gdb lie?
    By dinjas in forum C Programming
    Replies: 8
    Last Post: 03-10-2005, 05:17 PM