Why can't I use gdb?

L

Linda

After I type "make" on the screen, I got the following result:

/usr/local/sunone/SUNWspro/bin/CC -xs -pto -PIC -xtarget=ultra
-xarch=v9 -DIL_STD -g -xs -DNDEBUG
-I/usr/local/ilog/solver60/include
-I/usr/local/ilog/solver60/../concert20/include
-I/usr/local/ilog/solver60/examples/include
/uac/rshr/xhji/Ilog/money.cpp -c
/usr/local/sunone/SUNWspro/bin/CC -xs -pto -PIC -xtarget=ultra
-xarch=v9 -DIL_STD -g -xs -DNDEBUG
-I/usr/local/ilog/solver60/include
-I/usr/local/ilog/solver60/../concert20/include
-I/usr/local/ilog/solver60/examples/include money.o -o money -g
-L/usr/local/ilog/solver60/lib/ultrasparc64_8_6.2/static_pic_mt
-L/usr/local/ilog/solver60/../concert20/lib/ultrasparc64_8_6.2/static_pic_m­t

-lsolverfloat -lsolver -lconcert -lsocket -lnsl -lm -lsunmath


We can see that "-g" is there. But when I type "gdb money"(money is my
executable file name:)), I get:


GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as
"sparc-sun-solaris2.6"..."/data/a1/rshr/xhji/Ilog/money": not in
executable format: File format not recognized


So I cannot debug normally! Then what's wrong with it? How can I debug
with gdb or dbx normally?


Thanks!
 
V

Victor Bazarov

Linda said:
[...]
So I cannot debug normally! Then what's wrong with it? How can I debug
with gdb or dbx normally?

Please try 'gnu.utils.help' or any other '.help' newsgroup from the
'gnu.*' hierarchy. Here any utilities are OT since they are platform-
specific. As the last resort you should try a newsgroup for your OS.

V
 
W

WittyGuy

Linda said:
After I type "make" on the screen, I got the following result:

/usr/local/sunone/SUNWspro/bin/CC -xs -pto -PIC -xtarget=ultra
-xarch=v9 -DIL_STD -g -xs -DNDEBUG

We can see that "-g" is there. But when I type "gdb money"(money is my
executable file name:)), I get:

This GDB was configured as
"sparc-sun-solaris2.6"..."/data/a1/rshr/xhji/Ilog/money": not in
executable format: File format not recognized


So I cannot debug normally! Then what's wrong with it? How can I debug
with gdb or dbx normally?

Have you tried dbx as a debugger for this binary?
As the compiler you've used is Solaris CC, it is advisable to try dbx.

--Wg-
 
L

Linda

Thanks! And I have tried! When I type "dbx money", the result is:

Reading money
Reading ld.so.1
Reading libsocket.so.1
Reading libnsl.so.1
Reading libm.so.1
Reading libsunmath.so.1
Reading libCstd.so.1
Reading libCrun.so.1
Reading libw.so.1
Reading libc.so.1
Reading libdl.so.1
Reading libmp.so.2
Reading libc_psr.so.1
dbx: warning: Skipping debugging info (incompatible format) in
'money.o'

And in dbx, when I type "stop at 41", the result is:

dbx: no executable code at line "money.cpp":41

So, what I should do next? Thanks!
 
W

WittyGuy

Linda said:
Thanks! And I have tried! When I type "dbx money", the result is:

dbx: warning: Skipping debugging info (incompatible format) in
'money.o'

And in dbx, when I type "stop at 41", the result is:

dbx: no executable code at line "money.cpp":41

So, what I should do next? Thanks!

I think you would have displaced your binary/source file to someother
place.
I mean, if the binary is moved to someother place from the original
place where compiled, after successful compilation with -g option, then
the debugger attempting to look at the source at the original location
fails which could result in not showing the source lines in debugger.

Please check that.

--Wg-
 
L

Linda

I cannot fully understand your suggestion. But after I removed those
things like -w -xO4 -xtarget=ultra -xarch=v8plus in Makefile, dbx can
work normally. But gdb can not still.

Thank you anyway!
 
D

Default User

Linda said:
I cannot fully understand your suggestion. But after I removed those
things like -w -xO4 -xtarget=ultra -xarch=v8plus in Makefile, dbx can
work normally. But gdb can not still.

As Victor told you, this off-topic here. You will better and more
thorough answers in the correct newsgroup. Also, read the information
below.



Brian
 

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,070
Latest member
BiogenixGummies

Latest Threads

Top