This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH gas -gstabs : add cwd
- From: Nick Clifton <nickc at redhat dot com>
- To: "Philippe De Muyter" <phdm at macqel dot be>
- Cc: binutils mailing list <binutils at sources dot redhat dot com>
- Date: Sat, 04 Oct 2003 11:41:01 +0100
- Subject: Re: PATCH gas -gstabs : add cwd
- References: <200310020952.h929q8206649@mail.macqel.be>
Hi Philippe,
> Below is a little patch I needed to make when debugging asm files with gdb :
> It adds the compilation directory in the stabs info, just like gcc does.
> 2003-10-01 Philippe De Muyter <phdm@macqel.be>
>
> * stabs.c (stabs_generate_asm_file) : Add the compilation directory
> to the stabs debug info.
Thanks for submitting this patch. There are a couple of problems with
it however:
* Adding a compilation directory stab entry is a GNU extension to
the STABS specificiation, so really there needs to be a command
line option to control whether it used or not.
* You code should follow the GNU Coding standards. In the case of
your patch there needs to be a single space between the name of a
function and its opening parenthesis.
* Choosing the current directory as the source directory for the
file is not necessarily the best thing to do. I think that it
would be worthwhile attempting to extract the directory from the
filename, if possible.
* The specification for getcwd() says that if the buffer pointer is
NULL then its behaviour is undefined. It would be better to use
the getpwd() function provided by the libiberty library.
Cheers
Nick