Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d34c6e

Browse files
getting tests to pass again
1 parent da76644 commit 0d34c6e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/dwarf.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ void cu_header::read(freader& s, bool needs_byteswap) {
435435
_version = read_pod<std::uint16_t>(s, needs_byteswap);
436436

437437
if (_version == 2) {
438-
// Do nothing...? This version is so old, I'm not sure
439-
// what we should be doing with it...
438+
// Do nothing. DWARF2 has been found in some cases
439+
// and the current implementation seems to suffice.
440440
} else if (_version == 4) {
441441
// Do nothing. We started this project with DWARF4
442442
// so the baseline implementation should match that.
@@ -446,7 +446,7 @@ void cu_header::read(freader& s, bool needs_byteswap) {
446446
// it until it is necessary to do so.
447447
_unit_type = read_pod<std::uint8_t>(s, needs_byteswap);
448448
} else {
449-
throw std::runtime_error("unknown DWARF version: " + std::to_string(_version));
449+
ADOBE_INVARIANT(!"unhandled DWARF compilation unit");
450450
}
451451

452452
// note the read_pod types differ.
@@ -514,9 +514,11 @@ void line_header::read(freader& s, bool needs_byteswap) {
514514
}
515515
_version = read_pod<std::uint16_t>(s, needs_byteswap);
516516
if (_version == 2) {
517-
/* do nothing */
517+
// Do nothing. DWARF2 has been found in some cases
518+
// and the current implementation seems to suffice.
518519
} else if (_version == 4) {
519-
/* do nothing */
520+
// Do nothing. We started this project with DWARF4
521+
// so the baseline implementation should match that.
520522
} else if (_version == 5) {
521523
// SPECREF: DWARF5 page 26 (8) line 11 -- changes from DWARF4 to DWARF5
522524

@@ -526,7 +528,7 @@ void line_header::read(freader& s, bool needs_byteswap) {
526528
// SPECREF: DWARF5 page 172 (154) line 16
527529
_segment_selector_size = read_pod<std::int8_t>(s, needs_byteswap);
528530
} else {
529-
throw std::runtime_error("unhandled DWARF version (" + std::to_string(_version) + ")");
531+
ADOBE_INVARIANT(!"unhandled DWARF line header");
530532
}
531533
_header_length = read_pod<std::uint32_t>(s, needs_byteswap);
532534
_min_instruction_length = read_pod<std::uint8_t>(s);
@@ -660,7 +662,6 @@ bool skip_tagged_die(const die& d) {
660662
dw::tag::variable,
661663
dw::tag::formal_parameter,
662664
dw::tag::template_type_parameter,
663-
dw::tag::subprogram,
664665
};
665666
static const auto first = std::begin(skip_tags);
666667
static const auto last = std::end(skip_tags);
@@ -1224,6 +1225,8 @@ pool_string dwarf::implementation::die_identifier(const die& d,
12241225
// clang-format off
12251226
const dw::at string_attributes[] = {
12261227
dw::at::linkage_name,
1228+
dw::at::mips_linkage_name,
1229+
dw::at::hp_linkage_name,
12271230
dw::at::specification,
12281231
dw::at::name, // REVISIT (fosterbrereton): remove?
12291232
dw::at::type, // REVISIT (fosterbrereton): remove?

0 commit comments

Comments
 (0)