Debugging a C++ program that uses C code.

D

DaLoverhino

Hello. I think I messed up my last post. Sorry about that.

I have a C++ program made up of two cpp files. I have the following
makefile:

stepprog: main.o parse_sql.o
c++ main.o parse_sql.o -o stepprog

main.o: main.c IWCallback.h parse_sql.h
c++ -g -c main.cpp

parse_sql.o: parse_sql.cpp parse_sql.h
c++ -g -c parse_sql.cpp

main.c parse_sql.c IWCallback.h parse_sql.h:


Now, when I try to set a break point in the top function of
parse_sql.o, the debugger always complains that this module doesn't
have any debugger information. main.o has debugger information, so I
can always set breakpoint in that piece of code.

Anyways, I'm wondering why this might be so, and the only thing I can
think of is that parse_sql.c has all code declared as extern "C". Is
this true? And if so, how do I get around it? Anyone have ideas?

I'm on solaris 5.8 using the solaris compiler and dbx.

Thanks.
 
J

Jack Klein

Hello. I think I messed up my last post. Sorry about that.

I have a C++ program made up of two cpp files. I have the following
makefile:

stepprog: main.o parse_sql.o
c++ main.o parse_sql.o -o stepprog

main.o: main.c IWCallback.h parse_sql.h
c++ -g -c main.cpp

parse_sql.o: parse_sql.cpp parse_sql.h
c++ -g -c parse_sql.cpp

main.c parse_sql.c IWCallback.h parse_sql.h:


Now, when I try to set a break point in the top function of
parse_sql.o, the debugger always complains that this module doesn't
have any debugger information. main.o has debugger information, so I
can always set breakpoint in that piece of code.

Anyways, I'm wondering why this might be so, and the only thing I can
think of is that parse_sql.c has all code declared as extern "C". Is
this true? And if so, how do I get around it? Anyone have ideas?

I'm on solaris 5.8 using the solaris compiler and dbx.

There is nothing in the C++ language that specifies the workings of
debuggers or debugging information. This is all specific to your tool
set, and not a language issue.

You need to find a group to post in the supports your compiler/OS
combination, if there is one, or perhaps contact Sun's technical
support.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top