public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] Convert read_indirect_line_string to a method
Date: Thu, 09 Apr 2020 21:19:46 -0400	[thread overview]
Message-ID: <86c0bb4c57111422b30da6b1b20256bd3a06778a@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 86c0bb4c57111422b30da6b1b20256bd3a06778a ***

commit 86c0bb4c57111422b30da6b1b20256bd3a06778a
Author:     Tom Tromey <tom@tromey.com>
AuthorDate: Thu Mar 26 09:28:08 2020 -0600
Commit:     Tom Tromey <tom@tromey.com>
CommitDate: Thu Mar 26 09:28:19 2020 -0600

    Convert read_indirect_line_string to a method
    
    This changes read_indirect_line_string to be a method on
    dwarf2_per_objfile.  This makes it a bit simpler to share between
    files.
    
    gdb/ChangeLog
    2020-03-26  Tom Tromey  <tom@tromey.com>
    
            * dwarf2/read.h (struct dwarf2_per_objfile) <read_line_string>:
            Declare method.
            * dwarf2/read.c (read_attribute_value): Update.
            (dwarf2_per_objfile::read_line_string): Rename from
            read_indirect_line_string.
            (read_formatted_entries): Update.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1472f6679c..5e25a9befb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2020-03-26  Tom Tromey  <tom@tromey.com>
+
+	* dwarf2/read.h (struct dwarf2_per_objfile) <read_line_string>:
+	Declare method.
+	* dwarf2/read.c (read_attribute_value): Update.
+	(dwarf2_per_objfile::read_line_string): Rename from
+	read_indirect_line_string.
+	(read_formatted_entries): Update.
+
 2020-03-26  Tom Tromey  <tom@tromey.com>
 
 	* dwarf2/macro.c (dwarf_decode_macro_bytes): Use objfile local
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index e00151e8b1..dbd5b6a480 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -1251,10 +1251,6 @@ static const char *read_indirect_string
   (struct dwarf2_per_objfile *dwarf2_per_objfile, bfd *, const gdb_byte *,
    const struct comp_unit_head *, unsigned int *);
 
-static const char *read_indirect_line_string
-  (struct dwarf2_per_objfile *dwarf2_per_objfile, bfd *, const gdb_byte *,
-   const struct comp_unit_head *, unsigned int *);
-
 static const char *read_indirect_string_at_offset
   (struct dwarf2_per_objfile *dwarf2_per_objfile, LONGEST str_offset);
 
@@ -18550,9 +18546,9 @@ read_attribute_value (const struct die_reader_specs *reader,
     case DW_FORM_line_strp:
       if (!cu->per_cu->is_dwz)
 	{
-	  DW_STRING (attr) = read_indirect_line_string (dwarf2_per_objfile,
-							abfd, info_ptr,
-							cu_header, &bytes_read);
+	  DW_STRING (attr)
+	    = dwarf2_per_objfile->read_line_string (info_ptr, cu_header,
+						    &bytes_read);
 	  DW_STRING_IS_CANONICAL (attr) = 0;
 	  info_ptr += bytes_read;
 	  break;
@@ -18786,21 +18782,17 @@ read_indirect_string (struct dwarf2_per_objfile *dwarf2_per_objfile, bfd *abfd,
   return read_indirect_string_at_offset (dwarf2_per_objfile, str_offset);
 }
 
-/* Return pointer to string at .debug_line_str offset as read from BUF.
-   BUF is assumed to be in a compilation unit described by CU_HEADER.
-   Return *BYTES_READ_PTR count of bytes read from BUF.  */
+/* See read.h.  */
 
-static const char *
-read_indirect_line_string (struct dwarf2_per_objfile *dwarf2_per_objfile,
-			   bfd *abfd, const gdb_byte *buf,
+const char *
+dwarf2_per_objfile::read_line_string (const gdb_byte *buf,
 			   const struct comp_unit_head *cu_header,
 			   unsigned int *bytes_read_ptr)
 {
+  bfd *abfd = objfile->obfd;
   LONGEST str_offset = cu_header->read_offset (abfd, buf, bytes_read_ptr);
 
-  return dwarf2_per_objfile->line_str.read_string (dwarf2_per_objfile->objfile,
-						   str_offset,
-						   "DW_FORM_line_strp");
+  return line_str.read_string (objfile, str_offset, "DW_FORM_line_strp");
 }
 
 /* Given index ADDR_INDEX in .debug_addr, fetch the value.
@@ -19284,10 +19276,10 @@ read_formatted_entries (struct dwarf2_per_objfile *dwarf2_per_objfile,
 	      break;
 
 	    case DW_FORM_line_strp:
-	      string.emplace (read_indirect_line_string (dwarf2_per_objfile,
-							 abfd, buf,
-							 cu_header,
-							 &bytes_read));
+	      string.emplace
+		(dwarf2_per_objfile->read_line_string (buf,
+						       cu_header,
+						       &bytes_read));
 	      buf += bytes_read;
 	      break;
 
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index c5a8ecf8a6..039113f87e 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -110,6 +110,14 @@ struct dwarf2_per_objfile
 
   /* Free all cached compilation units.  */
   void free_cached_comp_units ();
+
+  /* Return pointer to string at .debug_line_str offset as read from BUF.
+     BUF is assumed to be in a compilation unit described by CU_HEADER.
+     Return *BYTES_READ_PTR count of bytes read from BUF.  */
+  const char *read_line_string (const gdb_byte *buf,
+				const struct comp_unit_head *cu_header,
+				unsigned int *bytes_read_ptr);
+
 private:
   /* This function is mapped across the sections and remembers the
      offset and size of each of the debugging sections we are


             reply	other threads:[~2020-04-10  1:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10  1:19 gdb-buildbot [this message]
2020-04-10  1:20 ` Failures on Fedora-x86_64-cc-with-index, branch master gdb-buildbot
2020-04-10  3:15 ` Failures on Fedora-i686, " gdb-buildbot
2020-04-10  3:53 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-04-10  4:08 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-04-10  4:54 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-04-10  5:13 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-04-14 10:37 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2020-04-15 19:49 ` Failures on Ubuntu-Aarch64-m64, " gdb-buildbot

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=86c0bb4c57111422b30da6b1b20256bd3a06778a@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@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).