This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH gas -gstabs : add cwd


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


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