473,394 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

Mar 14 '06 #1
4 1842
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

Mar 14 '06 #2
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!!!
Mar 14 '06 #3
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.
Mar 15 '06 #4
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!!!
Mar 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: soni29 | last post by:
hi, i have written the following code, still in the learning stage: #include<iostream.h> class CBox { public: // Constructor definition CBox(double lv, double bv = 1.0, double hv = 1.0) :...
7
by: Markus | last post by:
Hi, Well, I'm still a newbie to C++, so excuse my maybe (probably???) stupid question...btw, I use gcc 2.95.2. Here are my (test) funtions: mainfunc.cpp: #include <iostream> #include...
2
by: Dr Evil | last post by:
Greetings. Has anyone ever seen a tool that will read directories of header file source code and generate a dependency tree? I've often encountered large projects where such a tool would be useful....
15
by: Kannan Goundan | last post by:
Maintaining a C++ header file can be painful. I want a way to automatically generate header files from the implementation file. Does anybody know of a program that does this? If not, I'd like...
4
by: s.subbarayan | last post by:
Dear all, How different is a header file from a library file in C?Under what circumstance u go for library and under what circumstance u go for header?Afaik,both have some declarations which can...
2
by: Annie | last post by:
hello guys, I have a header file in the form of user control (.ascx) that all my pages inherit from it. I have a textbox that i need to access it from all the pages actually i show there user...
9
by: chat | last post by:
Hi, every body. I have 3 files like this: -------------------------------------------------------- file name : header.h #ifndef TEST_H #define TEST_H int a=1; double b=0.5;
11
by: whirlwindkevin | last post by:
I saw a program source code in which a variable is defined in a header file and that header file is included in 2 different C files.When i compile and link the files no error is being thrown.How is...
7
by: bcpkh | last post by:
Hello All Received a header file from a supplier that defines an interface to implement but it's giving me a problem, I reproduce the general structure of the header file below; #ifndef XYZ_H...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.