public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Cary Coutant <ccoutant@google.com>
To: Binutils <binutils@sourceware.org>, Ian Lance Taylor <iant@google.com>
Subject: [gold patch obvious] Fix dwarf reader to recognize compressed debug sections by name
Date: Wed, 17 Nov 2010 01:51:00 -0000	[thread overview]
Message-ID: <AANLkTikFCNzcaejo8NY9V_oSF4oze+Jq98e8APkXBpRc@mail.gmail.com> (raw)

Another problem found in PR 12220 is that gold does not do ODR
detection or print source line information when the debug information
is compressed. This was caused by a simple failure to recognize the
".zdebug_line" section name. I'm committing this patch as obvious.

-cary


        * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
        Check for ".zdebug_line".


Index: dwarf_reader.cc
===================================================================
RCS file: /cvs/src/src/gold/dwarf_reader.cc,v
retrieving revision 1.27
diff -u -p -r1.27 dwarf_reader.cc
--- dwarf_reader.cc	12 Jul 2010 17:59:58 -0000	1.27
+++ dwarf_reader.cc	17 Nov 2010 01:41:30 -0000
@@ -68,16 +68,19 @@ Sized_dwarf_line_info<size, big_endian>:
     directories_(), files_(), current_header_index_(-1)
 {
   unsigned int debug_shndx;
-  for (debug_shndx = 0; debug_shndx < object->shnum(); ++debug_shndx)
-    // FIXME: do this more efficiently: section_name() isn't super-fast
-    if (object->section_name(debug_shndx) == ".debug_line")
-      {
-        section_size_type buffer_size;
-        this->buffer_ = object->section_contents(debug_shndx, &buffer_size,
-						 false);
-        this->buffer_end_ = this->buffer_ + buffer_size;
-        break;
-      }
+  for (debug_shndx = 1; debug_shndx < object->shnum(); ++debug_shndx)
+    {
+      // FIXME: do this more efficiently: section_name() isn't super-fast
+      std::string name = object->section_name(debug_shndx);
+      if (name == ".debug_line" || name == ".zdebug_line")
+	{
+	  section_size_type buffer_size;
+	  this->buffer_ = object->section_contents(debug_shndx, &buffer_size,
+						   false);
+	  this->buffer_end_ = this->buffer_ + buffer_size;
+	  break;
+	}
+    }
   if (this->buffer_ == NULL)
     return;

                 reply	other threads:[~2010-11-17  1:51 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=AANLkTikFCNzcaejo8NY9V_oSF4oze+Jq98e8APkXBpRc@mail.gmail.com \
    --to=ccoutant@google.com \
    --cc=binutils@sourceware.org \
    --cc=iant@google.com \
    /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).