Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH RFC 1/5] Rename some functions, index -> gdb_index
Date: Wed, 09 May 2018 21:27:00 -0000	[thread overview]
Message-ID: <1525901216-15031-2-git-send-email-simon.marchi@ericsson.com> (raw)
In-Reply-To: <1525901216-15031-1-git-send-email-simon.marchi@ericsson.com>

Since we now have two index formats, DWARF5/debug_names and gdb_index, I
wanted to rename some functions to make it clear that they deal with the
gdb_index format specifically.

gdb/ChangeLog:

	* dwarf2read.c (read_index_from_section): Rename to...
	(read_gdb_index_from_section): ... this, update all callers.
	(dwarf2_read_index): Rename to...
	(dwarf2_read_gdb_index): ... this, update all callers.
---
 gdb/dwarf2read.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 26ec5ef..823b498 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3421,15 +3421,15 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name,
    Returns 1 if all went well, 0 otherwise.  */
 
 static bool
-read_index_from_section (struct objfile *objfile,
-			 const char *filename,
-			 bool deprecated_ok,
-			 struct dwarf2_section_info *section,
-			 struct mapped_index *map,
-			 const gdb_byte **cu_list,
-			 offset_type *cu_list_elements,
-			 const gdb_byte **types_list,
-			 offset_type *types_list_elements)
+read_gdb_index_from_section (struct objfile *objfile,
+			     const char *filename,
+			     bool deprecated_ok,
+			     struct dwarf2_section_info *section,
+			     struct mapped_index *map,
+			     const gdb_byte **cu_list,
+			     offset_type *cu_list_elements,
+			     const gdb_byte **types_list,
+			     offset_type *types_list_elements)
 {
   const gdb_byte *addr;
   offset_type version;
@@ -3539,7 +3539,7 @@ to use the section anyway."),
    elements of all the CUs and return 1.  Otherwise, return 0.  */
 
 static int
-dwarf2_read_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
+dwarf2_read_gdb_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
 {
   struct mapped_index local_map, *map;
   const gdb_byte *cu_list, *types_list, *dwz_list = NULL;
@@ -3547,11 +3547,11 @@ dwarf2_read_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
   struct dwz_file *dwz;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
 
-  if (!read_index_from_section (objfile, objfile_name (objfile),
-				use_deprecated_index_sections,
-				&dwarf2_per_objfile->gdb_index, &local_map,
-				&cu_list, &cu_list_elements,
-				&types_list, &types_list_elements))
+  if (!read_gdb_index_from_section (objfile, objfile_name (objfile),
+				    use_deprecated_index_sections,
+				    &dwarf2_per_objfile->gdb_index, &local_map,
+				    &cu_list, &cu_list_elements, &types_list,
+				    &types_list_elements))
     return 0;
 
   /* Don't use the index if it's empty.  */
@@ -3567,12 +3567,12 @@ dwarf2_read_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
       const gdb_byte *dwz_types_ignore;
       offset_type dwz_types_elements_ignore;
 
-      if (!read_index_from_section (objfile, bfd_get_filename (dwz->dwz_bfd),
-				    1,
-				    &dwz->gdb_index, &dwz_map,
-				    &dwz_list, &dwz_list_elements,
-				    &dwz_types_ignore,
-				    &dwz_types_elements_ignore))
+      if (!read_gdb_index_from_section (objfile,
+					bfd_get_filename (dwz->dwz_bfd), 1,
+					&dwz->gdb_index, &dwz_map,
+					&dwz_list, &dwz_list_elements,
+					&dwz_types_ignore,
+					&dwz_types_elements_ignore))
 	{
 	  warning (_("could not read '.gdb_index' section from %s; skipping"),
 		   bfd_get_filename (dwz->dwz_bfd));
@@ -6213,7 +6213,7 @@ dwarf2_initialize_objfile (struct objfile *objfile, dw_index_kind *index_kind)
       return true;
     }
 
-  if (dwarf2_read_index (dwarf2_per_objfile))
+  if (dwarf2_read_gdb_index (dwarf2_per_objfile))
     {
       *index_kind = dw_index_kind::GDB_INDEX;
       return true;
-- 
2.7.4


  parent reply	other threads:[~2018-05-09 21:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 21:57 [PATCH RFC 0/5] Add a DWARF index cache Simon Marchi
2018-05-09 21:27 ` Simon Marchi
2018-05-09 21:27 ` Simon Marchi [this message]
2018-05-10 20:40   ` [PATCH RFC 1/5] Rename some functions, index -> gdb_index Tom Tromey
2018-06-12  2:03     ` Simon Marchi
2018-05-09 21:27 ` [PATCH RFC 3/5] Make index reading functions more modular Simon Marchi
2018-05-10 21:02   ` Tom Tromey
2018-05-10 21:18     ` Simon Marchi
2018-05-09 21:27 ` [PATCH RFC 4/5] Introduce scoped_mmapped_file Simon Marchi
2018-05-10 21:04   ` Tom Tromey
2018-05-10 21:27     ` Simon Marchi
2018-05-12 15:49       ` Tom Tromey
2018-06-13  1:36       ` Simon Marchi
2018-05-09 21:27 ` [PATCH RFC 5/5] Add DWARF index cache Simon Marchi
2018-05-10 22:24   ` Tom Tromey
2018-07-09 20:56     ` Simon Marchi
2018-05-09 23:08 ` [PATCH RFC 2/5] Remove mapped_index::total_size Simon Marchi
2018-05-09 21:27   ` Simon Marchi
2018-05-10 20:54   ` Tom Tromey
2018-05-18 20:26     ` Simon Marchi

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=1525901216-15031-2-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@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