aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2018-06-01 03:46:10 +0200
committerMark Wielaard <mark@klomp.org>2018-06-01 16:40:44 +0200
commita6a783a32ee0e6428c15c87e62476b74ecd77686 (patch)
treee63f2bbcbd3a65aa8f3eb50de503f34bcfeb42e3 /src
parent0f5b772dec3f7c6fdd99739468706956b1bd04b9 (diff)
downloadelfutils-a6a783a32ee0e6428c15c87e62476b74ecd77686.tar.gz
readelf: Fix .debug_types printing with implicit section_info.
Commit 314e9d7d "readelf: Handle .debug_info first if any other debug section needs it" disabled section_info printing if it was already handled. But section_types was an alias for section_info. So unless section_info was explicitly printed, .debug_types wasn't. Make section_types its own thing to print .debug_types and make section_info imply section_types. Add a testcase to make sure .debug_types is now printed. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/readelf.c16
2 files changed, 19 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3cd7ae7b..bd3befd6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,14 @@
2018-05-31 Mark Wielaard <mark@klomp.org>
+ * readelf.c (enum section_e): Make section_types not an alias of
+ section_info.
+ (section_all): Add section_types.
+ (parse_opt): Add both section_info and section_types for "info"
+ and "info+".
+ (print_debug_units): Don't be silent for debug_types.
+
+2018-05-31 Mark Wielaard <mark@klomp.org>
+
* readelf.c (attr_callback): Only register section_loc when not
looking at a split dwarf from a skeleton.
diff --git a/src/readelf.c b/src/readelf.c
index 45401b30..18ce3f7d 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -237,8 +237,7 @@ static enum section_e
section_abbrev = 1, /* .debug_abbrev */
section_aranges = 2, /* .debug_aranges */
section_frame = 4, /* .debug_frame or .eh_frame & al. */
- section_info = 8, /* .debug_info, .debug_types */
- section_types = section_info,
+ section_info = 8, /* .debug_info, (implies .debug_types) */
section_line = 16, /* .debug_line */
section_loc = 32, /* .debug_loc */
section_pubnames = 64, /* .debug_pubnames */
@@ -248,12 +247,13 @@ static enum section_e
section_exception = 1024, /* .eh_frame & al. */
section_gdb_index = 2048, /* .gdb_index */
section_macro = 4096, /* .debug_macro */
- section_addr = 8192,
+ section_addr = 8192, /* .debug_addr */
+ section_types = 16384, /* .debug_types (implied by .debug_info) */
section_all = (section_abbrev | section_aranges | section_frame
| section_info | section_line | section_loc
| section_pubnames | section_str | section_macinfo
| section_ranges | section_exception | section_gdb_index
- | section_macro | section_addr)
+ | section_macro | section_addr | section_types)
} print_debug_sections, implicit_debug_sections;
/* Select hex dumping of sections. */
@@ -463,10 +463,14 @@ parse_opt (int key, char *arg,
else if (strcmp (arg, "frame") == 0 || strcmp (arg, "frames") == 0)
print_debug_sections |= section_frame;
else if (strcmp (arg, "info") == 0)
- print_debug_sections |= section_info;
+ {
+ print_debug_sections |= section_info;
+ print_debug_sections |= section_types;
+ }
else if (strcmp (arg, "info+") == 0)
{
print_debug_sections |= section_info;
+ print_debug_sections |= section_types;
show_split_units = true;
}
else if (strcmp (arg, "loc") == 0)
@@ -7448,7 +7452,7 @@ print_debug_units (Dwfl_Module *dwflmod,
Elf_Scn *scn, GElf_Shdr *shdr,
Dwarf *dbg, bool debug_types)
{
- const bool silent = !(print_debug_sections & section_info);
+ const bool silent = !(print_debug_sections & section_info) && !debug_types;
const char *secname = section_name (ebl, ehdr, shdr);
if (!silent)