public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Fix error in file_and_directory patch
Date: Wed,  8 Dec 2021 20:07:48 +0000 (GMT)	[thread overview]
Message-ID: <20211208200748.F31A53858002@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=621f8c42d3df079ca5781cdb0925c5ec3498f59c

commit 621f8c42d3df079ca5781cdb0925c5ec3498f59c
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed Dec 8 12:52:34 2021 -0700

    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, "<unknown>") != 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:
---
 gdb/dwarf2/read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;


                 reply	other threads:[~2021-12-08 20:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211208200748.F31A53858002@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).