home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
Atari
/
Gnu
/
gdb36p4s.zoo
/
README.ST
< prev
next >
Wrap
Text File
|
1993-10-04
|
3KB
|
94 lines
This is PatchLevel 4 of GDB 3.6 for AtariST/MiNT. It has all features
included except core files and remote debugging. MiNT 0.98 or later is
required.
This version of GDB has better C++ support than GDB 3.5. Function
names are output demangled, and printing of classes with `ptype' also
displays the methods attached. I have upgraded the symbol table
handling to support the extensions introduced in GCC 2. But on the
input side there is still no mangling support, i.e. function names
have to be specified mangled (the completion feature of readline helps
much).
Check the Makefile to match your setup. If you have a working shell in
/bin/sh, you can comment out the marked line. The debugged program is
then spawned through /bin/sh, allowing full redirection support and
file name globbing on arguments. Otherwise the program is spawned
directly, with simple redirection (which is usually sufficient,
though). Changing the definition of NO_SHELL requires recompilation of
dep.o, inflow.o and infrun.o (via START_INFERIOR_TRAPS_EXPECTED in
m-atari.h).
The original sources of GDB 3.6 can be found in
labrea.stanford.edu:pub/gnu/gdb.xtar.Z (thanks to J.Bammi for pointing
this out)
How to use GDB:
- Compile your program with "-g".
- Make an executable as usual.
- Make a symbol file using sym-ld
- Example:
Suppose you want to debug a program named foo consisting of
foo.c and bar.c. The following steps are needed:
gcc -g foo.c
gcc -g bar.c
gcc -o foo.ttp foo.o bar.o
gcc -o foo.sym foo.o bar.o -B/gnu/bin/sym-
In the last line change the path to match your installation
of sym-ld. You can also add "-O" to the compilation flags, but
not "-fomit-frame-pointer". Be sure to use the *same* order
of object files in both linking steps. It's easiest to use a
makefile for compilation, e.g.:
CFLAGS = -O -g
obj = foo.o bar.o
all: foo.ttp foo.sym
foo.ttp: $(obj)
$(CC) $(LDFLAGS) $(obj) $(LDLIBS) -o $@
foo.sym: $(obj)
$(CC) $(LDFLAGS) -B/gnu/bin/sym- $(obj) $(LDLIBS) -o $@
- run GDB:
gdb foo.ttp foo.sym
This tells GDB to use `foo.ttp' as executable and `foo.sym' as
symbol file. (This is different from the original GDB where
the second argument is interpreted as a core file. But core
files don't exists on the ST, so it's pretty useless :-)
You can now use GDB as usual: set breakpoints, run the
program, examine the program's state after a stop, continue or
restart the program, etc. Since GDB and the debugged program
are running in separate processes you don't have to leave GDB
to restart the program.
See gdb.texinfo for details.
- GDB and -mshort:
This should be detected automagically. However, GDB always
assumes that `int' has 32 bits, and uses `short' for 16 bit
int's.
- GDB and -mbaserel:
There is no support for -mbaserel yet. That is, you can
compile with -mbaserel, but you must reset the shared text
flag after compilation in order to be able to debug the
program.
- Memory requirements:
Since the symbol table is loaded incrementally, even large
programs can be debugged without running out of memory. If you
are low on memory, you can try to compile only the some
modules with debugging symbols, so that they are not
accidentally loaded.
Enjoy,
--
Andreas Schwab
schwab@ls5.informatik.uni-dortmund.de