From: Tom Tromey Date: Wed, 8 Dec 2021 19:52:34 +0000 (-0700) Subject: Fix error in file_and_directory patch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=621f8c42d3df079ca5781cdb0925c5ec3498f59c;p=binutils-gdb.git Fix error in file_and_directory patch In my earlier C++-ization patch for file_and_directory, I introduced an error: - if (strcmp (fnd.name, "") != 0) + if (fnd.is_unknown ()) This change inverted the sense of the test, which causes failures with .debug_names. This patch fixes the bug. Regression tested on x86-64 Fedora 34. I also tested it using the AdaCore internal test suite, with .debug_names -- this was failing before, and now it works. --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index f2d7da7de52..dd2134b3c63 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -3008,7 +3008,7 @@ dw2_get_file_names_reader (const struct die_reader_specs *reader, file_and_directory &fnd = find_file_and_directory (comp_unit_die, cu); int offset = 0; - if (fnd.is_unknown ()) + if (!fnd.is_unknown ()) ++offset; else if (lh == nullptr) return;