This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Borland TDS reading + BFD Interface Change


The attached patches and additional files (together with a patch I have 
just sent for BFD) add support for Borland TDS debugging information to 
GDB. I have been primarily concerned with TDS version 10 (which is used by 
Borland's "Free" compiler), but have also got things working within 
reasonable parameters for TDS version 9, which is used by Borland C++ 4.x

While I have added files to GDB before (in 1993), my understanding is I 
still need to send another assignment agreement and employer disclaimer to 
RMS because of the new files in this patch, so I will be putting that in 
the mail tomorrow.

Specific things to be aware of:

1. I have included the Borland demangling as a module of GDB rather than 
trying to get it into the common demangling code - that code appears to be 
designed to deal with demangling formats that are fundamentally similar, 
but Borland's bears no resemblence to any of those formats.

2. TDS stores partially mangled symbols - they often don't have the 
arguments mangled in them. To get past this, I have made a call to 
c_type_print_args when necessary to put the arguments into the C++ 
demangled name. This of course entailed making c_type_print_args non-static.

3. There was a bug in main.c that meant that the --symbols command line 
argument was effectively ignored in any practical case. I had to fix that 
because we need the --symbols argument for TDS, because the debug 
information may be in a sepearate file to the executable.

4. Binutils interface change - In the BFD structure I have added a data 
element "opened_for_symbols" - because TDS data may or may not be in the 
same file as an executable, and we need to recognise the executable in one 
case and the debug information in another, I added this member that the 
Borland TDS recognition code checks before deciding if it matches.

5. Almost everything else should be reasonably kosher as far as 
modifications to existing files go.

I use the following shell script to launch GDB for Borland files - it may 
be useful to people who are going to do this, but I'm not sure if it 
belongs anywhere in the GDB source tree itself.

#!/bin/sh

GNUTARGET=borland-tds
export GNUTARGET

GDB=/usr/local/bin/gdb

case "x$1" in
x)
	;;

*)
	[ -f "$1.tds" ] && {
		exec ${GDB} --symbols="$1.tds" "$@"
	}
	;;
esac
exec ${GDB} "$@"

diffs

gdbnewfiles.tar.gz

______________________________________________________________________________
troy@rollo.com				         Troy Rollo, Sydney, Australia
       Fight spam in Australia - Join CAUBE.AU - http://www.caube.org.au/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]