This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch Darwin] be more friendly to gdb
- From: Iain Sandoe <developer at sandoe-acoustics dot co dot uk>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Mike Stump <mrs at gcc dot gnu dot org>, Tristan Gingold <gingold at adacore dot com>
- Date: Thu, 17 Nov 2011 16:24:37 +0000
- Subject: [Patch Darwin] be more friendly to gdb
As things stand, Darwin's 'as' cannot produce dwarf debug.
Unfortunately, if "-g" is given to -x assembler-with-cpp ... this
results in 'as' being called with --stabs.
So, it can be the case that an exe ends up with some stabs debug in it
- usually with a source file of "{standard input}" (and without an OSO
entry).
This upsets the OSO parser in machoread.c (in gdb) causing gdb to fail
with an OSO != NULL assert.
===
This patch prevents "as" being asked to give debug output unless
stabs is the chosen debug scheme (so for the default on Darwin >= 9
asm files will not get any debug data).
It doesn't prevent the scenario completely - the user could still
produce the situation manually (I have a gdb patch to work around
it) ...
===
However, this does mean that a standard (ppc) build of gcc doesn't
abort gdb (because the .S files in libgcc_s are causing this on ppc).
OK for trunk?
Iain
Attachment:
181436-as-debug-diff.txt
Description: Text document