DBX_DEBUGGING_INFO
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > DBX_DEBUGGING_INFO




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    DBX_DEBUGGING_INFO  
grid


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-05 10:59 PM

Hi,
Maybe this might be specific to gcc.I am working on Solaris 8, and in
the process of debugging some 64 bit executable,needed to use the
studio8 dbx debugger,because the default gdb cannot load 64 bit binaries
for debugging.

Now while compiling with debug options (passing -g),when working with
gdb might work fine as gcc emits extra information specific to gdb.
From the gcc Man Page :

-g
Produce debugging information in the operating system's native
format (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
information.

On most systems that use stabs format, -g enables use of extra
debugging information that only GDB can use; this extra information
makes debugging work better in GDB but will probably make other
debuggers crash or refuse to read the program. If you want to control
for certain whether to generate the extra information, use -gstabs+,
-gstabs, -gxcoff+, -gxcoff, or -gvms

What debug flags should I use use for DBX ? The below macro from the gcc
info pages tells :

DBX_DEBUGGING_INFO

Define this macro if GCC should produce debugging output for DBX in
response to the -g option.

Now with response to this macro,which is the flag that gets passed.Again
it depends on the OS's native format.How do I know whats the native
format for Solaris on SPARC ?If I would have used Sun's native
compiler,then it would automatically generate the debug info in a format
which dbx can understand.

There are multiple options like : -g -ggdb -gstabs -gstabs+ -gcoff
-gdwarf ... and I am not sure which should be the correct option.What if
I pass all the options , will it then pick up correctly according to the
native format of the OS.

Any light on this will be highly appreciated.

Thanks,






[ Post a follow-up to this message ]



    Re: DBX_DEBUGGING_INFO  
Paul Pluzhnikov


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-18-05 07:49 AM

grid <prohit99@gmail.com> writes:

>    Maybe this might be specific to gcc.I am working on Solaris 8, and
>    in the process of debugging some 64 bit executable,needed to use
>    the studio8 dbx debugger,because the default gdb cannot load 64 bit
>    binaries for debugging.

It may just be easier to build gdb-6.1 (or whatever the latest gdb
is), which has no trouble with 64-bit binaries.

>      If you
>      want to control for certain whether to generate the extra
>      information, use -gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms

You obviously know how to read the manual. The same manual contains:

`-gstabs'
Produce debugging information in stabs format (if that is
supported), without GDB extensions.
^^^^^^^^^^^^^^^^^^^^^^

That's the flag you'll want to use on Solaris 8.

> DBX_DEBUGGING_INFO
>
>      Define this macro if GCC should produce debugging output for DBX
>      in response to the -g option.

Define that macro if you are building 'gcc' itself, and want it to
generate DBX debug info in response to '-g'. If you are not
rebuilding 'gcc' itself, this macro is of no use to you.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.





[ Post a follow-up to this message ]



    Re: DBX_DEBUGGING_INFO  
grid


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-18-05 07:49 AM

> You obviously know how to read the manual. The same manual contains:
>
> `-gstabs'
>      Produce debugging information in stabs format (if that is
>      supported), without GDB extensions.
>                  ^^^^^^^^^^^^^^^^^^^^^^
>
> That's the flag you'll want to use on Solaris 8.
I used this flag this is what I get :
$/usr/local/packages/gcc-3.4.2/bin/gcc -gstabs test.c
bash-2.03$ ls
bash-2.03$ dbx a.out
Reading a.out
Reading ld.so.1
Reading libc.so.1
Reading libdl.so.1
Reading libc_psr.so.1
(dbx) stop in main

dbx: warning: 'main' has no debugger info -- will trigger on first
instruction
(2) stop in main
(dbx)

But using the -gstabs+ flags does not have any issues ,even though the
manual says this :
-gstabs+
Produce debugging information in stabs format (if  that
is  supported), using GNU extensions understood only by
the GNU debugger (GDB).  The use of these extensions is
likely  to make other debuggers crash or refuse to read
the program.

Thanks,





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:33 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register