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]

PATCH gas -gstabs : add cwd


Hello,

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.

Philippe

Philippe De Muyter  phdm at macqel dot be  Tel +32 27029044
Macq Electronique SA  rue de l'Aeronef 2  B-1140 Bruxelles  Fax +32 27029077

2003-10-01  Philippe De Muyter  <phdm@macqel.be>

	* stabs.c (stabs_generate_asm_file) : Add the compilation directory
	to the stabs debug info.

--- gas/stabs.c	2000-02-02 01:24:17.000000000 +0100
+++ gas/stabs.c	2003-10-01 12:42:20.000000000 +0200
@@ -482,8 +482,14 @@ stabs_generate_asm_file ()
 {
   char *file;
   unsigned int lineno;
+  char *dir, *dir2;
 
   as_where (&file, &lineno);
+  dir = getcwd(NULL, 0);
+  dir2 = alloca(strlen(dir) + 2);
+  sprintf(dir2, "%s%s", dir, "/");
+  free(dir);
+  generate_asm_file (N_SO, dir2);
   generate_asm_file (N_SO, file);
 }
 


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