This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug macros/21055] New: docs use -gdwarf-2 to avoid unavailable dwarf1
- From: "karlp at tweak dot net.au" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 16 Jan 2017 20:51:08 +0000
- Subject: [Bug macros/21055] New: docs use -gdwarf-2 to avoid unavailable dwarf1
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21055
Bug ID: 21055
Summary: docs use -gdwarf-2 to avoid unavailable dwarf1
Product: gdb
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: macros
Assignee: unassigned at sourceware dot org
Reporter: karlp at tweak dot net.au
Target Milestone: ---
The docs available at
https://sourceware.org/gdb/onlinedocs/gdb/Macros.html#fn-1, contain the
following lines:
```
Now, we compile the program using the gnu C compiler, gcc. We pass the
-gdwarf-2[footnote] and -g3 flags to ensure the compiler includes information
about preprocessor macros in the debugging information.
$ gcc -gdwarf-2 -g3 sample.c -o sample
$
```
While this advice to use -gdwarf2 to avoid dwarf1 was appropriate in 2002 when
it seems this documentation was written, it's redundant and unhelpful in 2017.
The footnote _does_ indicate that it only needs to be _at least_ dwarf2, which
is helpful, if anyone actually reads the footnotes.
Note that current gcc doesn't even have an option for building dwarf1, let
alone is it the default. (It was deprecated back in gcc 3.3, and removed in
3.4)
I recommend that the documentation simply be:
```
Now, we compile the program using the gnu C compiler, gcc. We pass the -g3
flags to ensure the compiler includes information about preprocessor macros in
the debugging information.
$ gcc -g3 sample.c -o sample
$
```
I don't believe even a footnote on minimum required dwarf versions is
appropriate in current version gdb documentation.
--
You are receiving this mail because:
You are on the CC list for the bug.