Project

General

Profile

Actions

Bug #10823

closed

should ignore DW_TAG_subprogram with DW_AT_declaration tags

Added by John Levon about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
2019-04-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

http://smartos.org/bugview/OS-7733

While inspecting CTF diffs for GCC7, I noticed this in dockerexec:

f905ddb5-9113-c52a-d3ce-d0db83321d72:dockerinit $ ctfdump -c ./build/dockerexec | grep custr_alloc\(
extern void custr_alloc(void);

What's happening here is this DWARF:

<1><1f12>: Abbrev Number: 80 (DW_TAG_subprogram)
<1f13> DW_AT_external : 1
<1f14> DW_AT_declaration : 1
<1f15> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x600): custr_alloc
<1f19> DW_AT_name : (indirect string, offset: 0x600): custr_alloc
<1f1d> DW_AT_decl_file : 28
<1f1e> DW_AT_decl_line : 35
<1><1f1f>: Abbrev Number: 80 (DW_TAG_subprogram)

Note the lack of any formal parameter children. GCC4 doesn't generate these. But they don't seem useful at all.

So for dockerexec, we end up generating an argument-less entry. Later, when we see the real custr_alloc(), we do parse it fine, but we end up keeping the wrong version.

The fix is most likely to ignore these DW_AT_declaration entries.

Actions

Also available in: Atom PDF