[comp.sys.atari.st.tech] GDB question

ZVD007@DMSWWU1C.BITNET (Ulrich Kuehn) (04/30/91)

I'm using now g++ and tried to use gdb for debugging, but there are no
symbols in the programfiles. I read in a readme-file that I haveto use
sym-ld for filling the prg-file with debugging info, but I dont know how
to use it. Can someone give me a hint?
Thanks in advance

Ulrich Kuehn

warwick@cs.uq.oz.au (Warwick Allison) (05/01/91)

>I'm using now g++ and tried to use gdb for debugging, but there are no
>symbols in the programfiles. I read in a readme-file that I haveto use
>sym-ld for filling the prg-file with debugging info, but I dont know how
>to use it. Can someone give me a hint?
>Thanks in advance

From the gnu (.dvi :-) manual:

	`-gg' Produce debugging information in GDB's own format. This requires
the GNUassembler and linker in order to work.

   `sym-ld.ttp' is a special version of the linker. Its sole purpose is to
create a special symbol file used by the GNUdebugger. The following example
shows the usage.(`$' is the prompt of a CLI, `*' is the GDB prompt, `#' marks
a comment)
 
     $ gcc -c -gg foo.c    # compile `foo.c'
     $ gcc -o foo.prg foo.o # linkwith normal `gcc-ld.ttp'
     $ sym-ld  -r -o foo.sym $(GNULIB)"crt0.o foo.o -lgnugdb  (or -lgdb)
                           # link with `sym-ld.ttp' to get symbol file
     $ gdb
     * exec-file foo.prg   # executable (`gcc-ld.ttp' linked Atari
                             executable)
     * symbol-file foo.sym  # symbols file (`sym-ld.ttp' `-r -o' linked)
     * run
     * <start doing gdb commands here>
      : : :
     * q
     $                     # back
 
 
   Note the line in the example, where `sym-ld.ttp'is invoked. A library
`gnugdb.olb' is used to create the symbol file. This is just like the normal
library `gnu.olb' except that is was compiled.
 
Warwick.
--
  _-_|\       warwick@cs.uq.oz.au
 /     *  <-- Computer Science Department,
 \_.-._/      University of Queensland,
      v       Brisbane, AUSTRALIA.

timothyg@ncsa.uiuc.edu (Timothy Gallivan) (05/01/91)

	[in response to a question about how to use the gnu debugger]

|>      $ gcc -c -gg foo.c    # compile `foo.c'
|>      $ gcc -o foo.prg foo.o # linkwith normal `gcc-ld.ttp'
|>      $ sym-ld  -r -o foo.sym $(GNULIB)"crt0.o foo.o -lgnugdb  (or -lgdb)
|>                            # link with `sym-ld.ttp' to get symbol file
|>      $ gdb
|>      * exec-file foo.prg   # executable (`gcc-ld.ttp' linked Atari
|>                              executable)
|>      * symbol-file foo.sym  # symbols file (`sym-ld.ttp' `-r -o' linked)
|>      * run
|>      * <start doing gdb commands here>
|>       : : :
|>      * q
|>      $                     # back
|>

Well, that is what the instructions say. When I follow this procedure,
I get bombs after 'symbol-file foo.sym'. I have yet to hear from anyone
who has been able to get gdb to work. I have heard from several people
who cannot. Good Luck!

Can anyone help the poor souls who are without a debugger?
  

Tim Gallivan
timothyg@ncsa.uiuc.edu