public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [review] [ARM] Store exception handling information per-bfd instead of per-obj...
@ 2019-10-30 16:19 Luis Machado (Code Review)
  2019-10-30 19:02 ` Simon Marchi (Code Review)
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luis Machado (Code Review) @ 2019-10-30 16:19 UTC (permalink / raw)
  To: gdb-patches

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/448
......................................................................

[ARM] Store exception handling information per-bfd instead of per-objfile

Based on feedback from Tromey, update the use of objfile_key in gdb/arm-tdep.c
to use bfd_key instead. That way we don't have to re-create the exception
handling data all over again if it was done before for the same BFD.

OK?

2019-10-30  Luis Machado  <luis.machado@linaro.org>

	gdb/ChangeLog:
	* arm-tdep.c (arm_exidx_data_key): Use bfd_key instead of
	objfile_key.
	(arm_exidx_new_objfile): Adjust to use objfile->obfd instead of
	objfile to fetch per-bfd data.
	(arm_find_exidx_entry): Likewise.

Signed-off-by: Luis Machado <luis.machado@linaro.org>
Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859
---
M gdb/arm-tdep.c
1 file changed, 5 insertions(+), 4 deletions(-)



diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 8694618..48772d7 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1999,7 +1999,8 @@
   std::vector<std::vector<arm_exidx_entry>> section_maps;
 };
 
-static const struct objfile_key<arm_exidx_data> arm_exidx_data_key;
+/* Per-BFD key to store exception handling information.  */
+static const struct bfd_key<arm_exidx_data> arm_exidx_data_key;
 
 static struct obj_section *
 arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma)
@@ -2043,7 +2044,7 @@
   LONGEST i;
 
   /* If we've already touched this file, do nothing.  */
-  if (!objfile || arm_exidx_data_key.get (objfile) != NULL)
+  if (!objfile || arm_exidx_data_key.get (objfile->obfd) != NULL)
     return;
 
   /* Read contents of exception table and index.  */
@@ -2074,7 +2075,7 @@
     }
 
   /* Allocate exception table data structure.  */
-  data = arm_exidx_data_key.emplace (objfile);
+  data = arm_exidx_data_key.emplace (objfile->obfd);
   data->section_maps.resize (objfile->obfd->section_count);
 
   /* Fill in exception table.  */
@@ -2246,7 +2247,7 @@
       struct arm_exidx_data *data;
       struct arm_exidx_entry map_key = { memaddr - obj_section_addr (sec), 0 };
 
-      data = arm_exidx_data_key.get (sec->objfile);
+      data = arm_exidx_data_key.get (sec->objfile->obfd);
       if (data != NULL)
 	{
 	  std::vector<arm_exidx_entry> &map

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859
Gerrit-Change-Number: 448
Gerrit-PatchSet: 1
Gerrit-Owner: Luis Machado <luis.machado@linaro.org>
Gerrit-MessageType: newchange

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review] [ARM] Store exception handling information per-bfd instead of per-obj...
  2019-10-30 16:19 [review] [ARM] Store exception handling information per-bfd instead of per-obj Luis Machado (Code Review)
@ 2019-10-30 19:02 ` Simon Marchi (Code Review)
  2019-10-31 19:33 ` Luis Machado (Code Review)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Simon Marchi (Code Review) @ 2019-10-30 19:02 UTC (permalink / raw)
  To: Luis Machado, gdb-patches

Simon Marchi has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/448
......................................................................


Patch Set 1: Code-Review+2

I think that makes sense.


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859
Gerrit-Change-Number: 448
Gerrit-PatchSet: 1
Gerrit-Owner: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Wed, 30 Oct 2019 19:02:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [review] [ARM] Store exception handling information per-bfd instead of per-obj...
  2019-10-30 16:19 [review] [ARM] Store exception handling information per-bfd instead of per-obj Luis Machado (Code Review)
  2019-10-30 19:02 ` Simon Marchi (Code Review)
@ 2019-10-31 19:33 ` Luis Machado (Code Review)
  2019-10-31 19:34 ` [pushed] " Sourceware to Gerrit sync (Code Review)
  2019-10-31 19:34 ` Sourceware to Gerrit sync (Code Review)
  3 siblings, 0 replies; 5+ messages in thread
From: Luis Machado (Code Review) @ 2019-10-31 19:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Luis Machado has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/448
......................................................................


Patch Set 1:

Pushed now. Thanks!


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859
Gerrit-Change-Number: 448
Gerrit-PatchSet: 1
Gerrit-Owner: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Thu, 31 Oct 2019 19:33:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pushed] [ARM] Store exception handling information per-bfd instead of per-obj...
  2019-10-30 16:19 [review] [ARM] Store exception handling information per-bfd instead of per-obj Luis Machado (Code Review)
  2019-10-30 19:02 ` Simon Marchi (Code Review)
  2019-10-31 19:33 ` Luis Machado (Code Review)
@ 2019-10-31 19:34 ` Sourceware to Gerrit sync (Code Review)
  2019-10-31 19:34 ` Sourceware to Gerrit sync (Code Review)
  3 siblings, 0 replies; 5+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-10-31 19:34 UTC (permalink / raw)
  To: Luis Machado, Simon Marchi, gdb-patches

The original change was created by Luis Machado.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/448
......................................................................

[ARM] Store exception handling information per-bfd instead of per-objfile

Based on feedback from Tromey, update the use of objfile_key in gdb/arm-tdep.c
to use bfd_key instead. That way we don't have to re-create the exception
handling data all over again if it was done before for the same BFD.

gdb/ChangeLog:

2019-10-31  Luis Machado  <luis.machado@linaro.org>

	* arm-tdep.c (arm_exidx_data_key): Use bfd_key instead of
	objfile_key.
	(arm_exidx_new_objfile): Adjust to use objfile->obfd instead of
	objfile to fetch per-bfd data.
	(arm_find_exidx_entry): Likewise.

Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859
---
M gdb/ChangeLog
M gdb/arm-tdep.c
2 files changed, 13 insertions(+), 4 deletions(-)



diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ee48133..7abe20e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2019-10-31  Luis Machado  <luis.machado@linaro.org>
+
+	* arm-tdep.c (arm_exidx_data_key): Use bfd_key instead of
+	objfile_key.
+	(arm_exidx_new_objfile): Adjust to use objfile->obfd instead of
+	objfile to fetch per-bfd data.
+	(arm_find_exidx_entry): Likewise.
+
 2019-10-31  Christian Biesinger  <cbiesinger@google.com>
 
 	* gdbsupport/agent.c (debug_agent): Change type to bool.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 8694618..48772d7 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1999,7 +1999,8 @@
   std::vector<std::vector<arm_exidx_entry>> section_maps;
 };
 
-static const struct objfile_key<arm_exidx_data> arm_exidx_data_key;
+/* Per-BFD key to store exception handling information.  */
+static const struct bfd_key<arm_exidx_data> arm_exidx_data_key;
 
 static struct obj_section *
 arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma)
@@ -2043,7 +2044,7 @@
   LONGEST i;
 
   /* If we've already touched this file, do nothing.  */
-  if (!objfile || arm_exidx_data_key.get (objfile) != NULL)
+  if (!objfile || arm_exidx_data_key.get (objfile->obfd) != NULL)
     return;
 
   /* Read contents of exception table and index.  */
@@ -2074,7 +2075,7 @@
     }
 
   /* Allocate exception table data structure.  */
-  data = arm_exidx_data_key.emplace (objfile);
+  data = arm_exidx_data_key.emplace (objfile->obfd);
   data->section_maps.resize (objfile->obfd->section_count);
 
   /* Fill in exception table.  */
@@ -2246,7 +2247,7 @@
       struct arm_exidx_data *data;
       struct arm_exidx_entry map_key = { memaddr - obj_section_addr (sec), 0 };
 
-      data = arm_exidx_data_key.get (sec->objfile);
+      data = arm_exidx_data_key.get (sec->objfile->obfd);
       if (data != NULL)
 	{
 	  std::vector<arm_exidx_entry> &map

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859
Gerrit-Change-Number: 448
Gerrit-PatchSet: 2
Gerrit-Owner: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-MessageType: newpatchset

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pushed] [ARM] Store exception handling information per-bfd instead of per-obj...
  2019-10-30 16:19 [review] [ARM] Store exception handling information per-bfd instead of per-obj Luis Machado (Code Review)
                   ` (2 preceding siblings ...)
  2019-10-31 19:34 ` [pushed] " Sourceware to Gerrit sync (Code Review)
@ 2019-10-31 19:34 ` Sourceware to Gerrit sync (Code Review)
  3 siblings, 0 replies; 5+ messages in thread
From: Sourceware to Gerrit sync (Code Review) @ 2019-10-31 19:34 UTC (permalink / raw)
  To: Luis Machado, gdb-patches; +Cc: Simon Marchi

Sourceware to Gerrit sync has submitted this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/448
......................................................................

[ARM] Store exception handling information per-bfd instead of per-objfile

Based on feedback from Tromey, update the use of objfile_key in gdb/arm-tdep.c
to use bfd_key instead. That way we don't have to re-create the exception
handling data all over again if it was done before for the same BFD.

gdb/ChangeLog:

2019-10-31  Luis Machado  <luis.machado@linaro.org>

	* arm-tdep.c (arm_exidx_data_key): Use bfd_key instead of
	objfile_key.
	(arm_exidx_new_objfile): Adjust to use objfile->obfd instead of
	objfile to fetch per-bfd data.
	(arm_find_exidx_entry): Likewise.

Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859
---
M gdb/ChangeLog
M gdb/arm-tdep.c
2 files changed, 13 insertions(+), 4 deletions(-)


diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ee48133..7abe20e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2019-10-31  Luis Machado  <luis.machado@linaro.org>
+
+	* arm-tdep.c (arm_exidx_data_key): Use bfd_key instead of
+	objfile_key.
+	(arm_exidx_new_objfile): Adjust to use objfile->obfd instead of
+	objfile to fetch per-bfd data.
+	(arm_find_exidx_entry): Likewise.
+
 2019-10-31  Christian Biesinger  <cbiesinger@google.com>
 
 	* gdbsupport/agent.c (debug_agent): Change type to bool.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 8694618..48772d7 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1999,7 +1999,8 @@
   std::vector<std::vector<arm_exidx_entry>> section_maps;
 };
 
-static const struct objfile_key<arm_exidx_data> arm_exidx_data_key;
+/* Per-BFD key to store exception handling information.  */
+static const struct bfd_key<arm_exidx_data> arm_exidx_data_key;
 
 static struct obj_section *
 arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma)
@@ -2043,7 +2044,7 @@
   LONGEST i;
 
   /* If we've already touched this file, do nothing.  */
-  if (!objfile || arm_exidx_data_key.get (objfile) != NULL)
+  if (!objfile || arm_exidx_data_key.get (objfile->obfd) != NULL)
     return;
 
   /* Read contents of exception table and index.  */
@@ -2074,7 +2075,7 @@
     }
 
   /* Allocate exception table data structure.  */
-  data = arm_exidx_data_key.emplace (objfile);
+  data = arm_exidx_data_key.emplace (objfile->obfd);
   data->section_maps.resize (objfile->obfd->section_count);
 
   /* Fill in exception table.  */
@@ -2246,7 +2247,7 @@
       struct arm_exidx_data *data;
       struct arm_exidx_entry map_key = { memaddr - obj_section_addr (sec), 0 };
 
-      data = arm_exidx_data_key.get (sec->objfile);
+      data = arm_exidx_data_key.get (sec->objfile->obfd);
       if (data != NULL)
 	{
 	  std::vector<arm_exidx_entry> &map

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859
Gerrit-Change-Number: 448
Gerrit-PatchSet: 2
Gerrit-Owner: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-MessageType: merged

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-31 19:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 16:19 [review] [ARM] Store exception handling information per-bfd instead of per-obj Luis Machado (Code Review)
2019-10-30 19:02 ` Simon Marchi (Code Review)
2019-10-31 19:33 ` Luis Machado (Code Review)
2019-10-31 19:34 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-10-31 19:34 ` Sourceware to Gerrit sync (Code Review)

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).