public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/28094] New: Support executable with only line debug section
@ 2021-07-15 14:26 vries at gcc dot gnu.org
  2021-07-15 14:30 ` [Bug symtab/28094] " vries at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: vries at gcc dot gnu.org @ 2021-07-15 14:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28094

            Bug ID: 28094
           Summary: Support executable with only line debug section
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

In the dwarf 5 standard we find:
...
Prior to DWARF Version 5, the current directory was not represented in the
directories field and a directory index of 0 implicitly referred to that
directory as found in the DW_AT_comp_dir attribute of the compilation unit
debugging information entry.  In DWARF Version 5, the current directory is
explicitly present in the directories field. This is needed to support the
common practice of stripping all but the line number sections (.debug_line and
.debug_line_str) from an executable.
...

FWIW, the change comes from issue
http://dwarfstd.org/ShowIssue.php?issue=140724.1 .

I tried an experiment where I compiled a hello world with gcc (and dwarf-4) and
stripped all but the .debug_line section:
...
$ gcc -g hello.c
$ for s in $(readelf -S -W a.out | grep debug | awk '{print $2}'| grep -v
.debug_line); do objcopy --remove-section=$s a.out; done
...

But gdb doesn't do well with that:
...
$ gdb -q a.out -ex start
Reading symbols from a.out...
(No debugging symbols found in a.out)
Temporary breakpoint 1 at 0x40054b
Starting program: /home/vries/a.out 

Temporary breakpoint 1, 0x000000000040054b in main ()
(gdb) 
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-16 11:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 14:26 [Bug symtab/28094] New: Support executable with only line debug section vries at gcc dot gnu.org
2021-07-15 14:30 ` [Bug symtab/28094] " vries at gcc dot gnu.org
2021-07-15 14:33 ` [Bug symtab/28094] Support executable with only line debug section(s) vries at gcc dot gnu.org
2021-07-15 14:34 ` vries at gcc dot gnu.org
2021-07-15 14:56 ` vries at gcc dot gnu.org
2021-07-15 15:09 ` vries at gcc dot gnu.org
2021-07-15 15:28 ` pedro at palves dot net
2021-07-16 11:51 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).