conditional breakpoints and inline functions

This is a discussion on conditional breakpoints and inline functions within the C++ Programming forums, part of the General Programming Boards category; Well, things are not going as expected. Compiler : mingw32-g++ (GCC) 3.4.5 (mingw special) Debugger : GNU gdb 6.3 (for ...

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,439

    conditional breakpoints and inline functions

    Well, things are not going as expected.

    Compiler: mingw32-g++ (GCC) 3.4.5 (mingw special)
    Debugger: GNU gdb 6.3 (for MinGW)

    I'm trying to create conditional breakpoints based on inline functions. These are the steps:

    Code:
    $ gdb middle
    $ break main.cpp: 14
    $ condition 1 test.weight() == 12;
    $ run
    Problem is GDB can't evaluate inlined functions and weight() is an inlined member function. I get an error message from GDB warning me of this.

    I define all my classes as this:

    Code:
    // START
    
    class myClass {
       public:
            ctor;
            dtor;
    
            interface assessors (gets and sets);
    
            interface (other);
    
        private:
            /* ... */
    };
    
    inlined definitions go here
    
    //END
    As such, I try to rebuild the whole thing with -fno-inline. However... it doesn't work. Inlining wasn't disabled. Please tell me I don't have to remove the inline qualifier from all of my code, only to have to put it back when I wish a release build.

    This is my current compile command line options:

    Code:
    -fno-inline -Wall -Wextra -pedantic -g3
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    $ condition 1 test.nonInlinedWeight() == 1

    where nonInlinedWeight just calls weight. Messy though.

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,439
    Yes. That's a possibility. Thanks Skorman.
    Another one I thought was to macro-disable the inline string. Probably the easiest approach. Although it could mess with literal strings (not that I can remember having any with that word)

    However I was hoping my understanding of the compile options was flawed and there would be more in order to force compiling with no inlining. Or maybe that I could fire GDB with some options that allowed it to evaluate inline functions.

    I'm also having an hard time tracking this out as bug in either gcc or gdb. So, I'm kinda lost.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21