Inability to view a header file source in a debugger

Discussion in 'C++' started by Generic Usenet Account, Mar 14, 2006.

  1. In our environment we have several C++ header files that have some
    inline member function definitions. For some reason, I am unable to
    step through the source code of those member functions in my debugger
    (Insight debugger, which is a GUI front-end to GDB version 5.3). In
    fact, when I try to view the header file, all I see is assembly
    language. There is another header file in the same directory, which
    does not have any inline member function definitions. I am able to
    view that header file just fine. Since the only difference between the
    two files is the fact that in one header file inline member functions
    are defined, while they are not in the other header file, I suspect
    that my inability to see the source code in the header file has
    something to do with inlining. BTW, the source code is compiled with
    the -g option, and we are not stripping the executable.

    Does anyone have any idea under what circumstances will source files
    not be viewable in a debugger?

    Thanks,
    Song
     
    Generic Usenet Account, Mar 14, 2006
    #1
    1. Advertising

  2. Generic Usenet Account

    Puppet_Sock Guest

    Generic Usenet Account wrote:
    [debugger question]

    You will get better help by posting this in a news group where
    they talk about your particular development platform. Here we
    only talk about language issues for standard C++. You want
    a news group that deals with your compiler/debugger. You
    could start with a search at groups.google.com.
    Socks
     
    Puppet_Sock, Mar 14, 2006
    #2
    1. Advertising

  3. Generic Usenet Account

    Phlip Guest

    Generic Usenet Account wrote:

    > (Insight debugger, which is a GUI front-end to GDB version 5.3)


    You need to use Google to find a forum responsible for that debugger.

    This newsgroup is only qualified to answer questions about the raw C++
    language itself. If I took a guess and were wrong (what are the odds??),
    others here would not be able to correct me.

    Posting to the most topical newsgroup or mailing list is in your best
    interest.

    --
    Phlip
    http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
     
    Phlip, Mar 14, 2006
    #3
  4. Generic Usenet Account wrote:
    > In our environment we have several C++ header files that have some
    > inline member function definitions. For some reason, I am unable to
    > step through the source code of those member functions in my debugger


    Pardon my ignorance, but if these functions are _inlined_,
    *what* do you expect to step through? Isn't it the case of
    "if you optimized it, forget debugging it"?

    - J.
     
    Jacek Dziedzic, Mar 15, 2006
    #4
  5. Generic Usenet Account

    Phlip Guest

    Jacek Dziedzic wrote:

    > Generic Usenet Account wrote:
    >> In our environment we have several C++ header files that have some
    >> inline member function definitions. For some reason, I am unable to
    >> step through the source code of those member functions in my debugger

    >
    > Pardon my ignorance, but if these functions are _inlined_,
    > *what* do you expect to step through? Isn't it the case of
    > "if you optimized it, forget debugging it"?


    Inline doesn't mean the opcodes are inlined. It means the function is
    excempt from aspects of the "one definition rule" that ordinarily says a
    function's body must appear in only one translation unit.

    A compiler has an easier time optimizing such a function, typically by
    inlining its opcodes. And compiling with the -g option probably enabled
    such optimization. So, turn off -g, or wait for a debugger that can track
    raw opcodes back to their inlinable function definitions.

    --
    Phlip
    http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
     
    Phlip, Mar 15, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2hhcmxlc0E=?=

    baffled by inability to debug asp.net page

    =?Utf-8?B?Q2hhcmxlc0E=?=, Mar 2, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    353
    BusEdge
    Mar 2, 2007
  2. Replies:
    18
    Views:
    546
  3. Replies:
    1
    Views:
    377
    Victor Bazarov
    Feb 17, 2006
  4. mlt
    Replies:
    2
    Views:
    907
    Jean-Marc Bourguet
    Jan 31, 2009
  5. Parthiv Joshi
    Replies:
    1
    Views:
    805
    Samuel L Matzen
    Jul 6, 2004
Loading...

Share This Page