Inability to view a header file source in a debugger

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Generic Usenet Account

    #1

    Inability to view a header file source in a debugger

    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

  • Puppet_Sock

    #2
    Re: Inability to view a header file source in a debugger

    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.c om.
    Socks

    Comment

    • Phlip

      #3
      Re: Inability to view a header file source in a debugger

      Generic Usenet Account wrote:
      [color=blue]
      > (Insight debugger, which is a GUI front-end to GDB version 5.3)[/color]

      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!!!

      Comment

      • Jacek Dziedzic

        #4
        Re: Inability to view a header file source in a debugger

        Generic Usenet Account wrote:[color=blue]
        > 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[/color]

        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.

        Comment

        • Phlip

          #5
          Re: Inability to view a header file source in a debugger

          Jacek Dziedzic wrote:
          [color=blue]
          > Generic Usenet Account wrote:[color=green]
          >> 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[/color]
          >
          > 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"?[/color]

          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!!!

          Comment

          Working...