This is the mail archive of the binutils@sourceware.org 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] Improve objdump --stabs for darwin


Hi,

this patch makes 'objdump --stabs' more useful on darwin.
First objdump now looks for the darwin-specific stabs sections.
Second a few darwin-specific stabs are added to stab.def

Manually tested on x86-darwin using an example.

Tristan.

binutils/
2008-08-28  Tristan Gingold  <gingold@adacore.com>

* objdump.c (dump_stabs): Add sections for Darwin.

include/aout
2008-08-28  Tristan Gingold  <gingold@adacore.com>

* stab.def: Add BNSYM, ENSYM, OSO for darwin.

*** binutils/objdump.c	30 Jul 2008 04:34:56 -0000	1.145
--- binutils/objdump.c	28 Aug 2008 10:48:07 -0000
***************
*** 2474,2479 ****
--- 2474,2483 ----
    dump_stabs_section (abfd, ".stab", ".stabstr");
    dump_stabs_section (abfd, ".stab.excl", ".stab.exclstr");
    dump_stabs_section (abfd, ".stab.index", ".stab.indexstr");
+
+   /* For Darwin.  */
+   dump_stabs_section (abfd, "LC_SYMTAB.stabs", "LC_SYMTAB.stabstr");
+
    dump_stabs_section (abfd, "$GDB_SYMBOLS$", "$GDB_STRINGS$");
  }
  
*** include/aout/stab.def	10 May 2005 10:21:09 -0000	1.4
--- include/aout/stab.def	28 Aug 2008 10:48:11 -0000
***************
*** 53,58 ****
--- 53,62 ----
  /* Solaris2:  Read-only data symbols.  */
  __define_stab (N_ROSYM, 0x2c, "ROSYM")

+ /* MacOS X:
+ The beginning of a relocatable function block - including stabs. */
+ __define_stab (N_BNSYM, 0x2e, "BNSYM")
+
/* Global symbol in Pascal.
Supposedly the value is its line number; I'm skeptical. */
__define_stab (N_PC, 0x30, "PC")
***************
*** 106,111 ****
--- 110,118 ----
/* New in Solaris2. Function start/body/end line numbers. */
__define_stab(N_FLINE, 0x4C, "FLINE")


+ /* MacOS X: This tells the end of a relocatable function + debugging info. */
+ __define_stab(N_ENSYM, 0x4E, "ENSYM")
+
/* THE FOLLOWING TWO STAB VALUES CONFLICT. Happily, one is for Modula-2
and one is for C++. Still,... */
/* GNU C++ exception variable. Name is variable name. */
***************
*** 136,141 ****
--- 143,152 ----


__define_stab (N_SO, 0x64, "SO")

+ /* Apple: This is the stab that associated the .o file with the
+ N_SO stab, in the case where debug info is mostly stored in the .o file. */
+ __define_stab (N_OSO, 0x66, "OSO")
+
/* SunPro F77: Name of alias. */
__define_stab (N_ALIAS, 0x6c, "ALIAS")




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