public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [2/4] RFC: check psymtabs_addrmap before reading FDEs
@ 2010-06-30 22:37 Tom Tromey
  2010-07-01 15:41 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2010-06-30 22:37 UTC (permalink / raw)
  To: gdb-patches

This patch changes dwarf2_frame_find_fde to check psymtabs_addrmap
before trying to read the FDE data.

I am not totally convinced this is safe, so comments are especially
appreciated here.

This patch is actually independent of the rest of the series; it is just
a possible optimization I found while working in this area.

Tom

b/gdb/ChangeLog:
2010-06-30  Tom Tromey  <tromey@redhat.com>

	* dwarf2-frame.c (dwarf2_frame_find_fde): Check psymtabs_addrmap.

From 3836ada921fcc8605362f51c163774f53d3db1c9 Mon Sep 17 00:00:00 2001
From: Tom Tromey <tromey@redhat.com>
Date: Wed, 30 Jun 2010 10:15:34 -0600
Subject: [PATCH 2/4] check psymtabs_addrmap before decoding FDEs

---
 gdb/ChangeLog      |    4 ++++
 gdb/dwarf2-frame.c |    7 +++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 9576341..e7c5d31 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -32,6 +32,7 @@
 #include "objfiles.h"
 #include "regcache.h"
 #include "value.h"
+#include "addrmap.h"
 
 #include "gdb_assert.h"
 #include "gdb_string.h"
@@ -1593,6 +1594,12 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
       CORE_ADDR offset;
       CORE_ADDR seek_pc;
 
+      if (objfile->psymtabs_addrmap)
+	{
+	  if (!addrmap_find (objfile->psymtabs_addrmap, *pc))
+	    continue;
+	}
+
       fde_table = objfile_data (objfile, dwarf2_frame_objfile_data);
       if (fde_table == NULL)
 	{
-- 
1.6.2.5

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

* Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs
  2010-06-30 22:37 [2/4] RFC: check psymtabs_addrmap before reading FDEs Tom Tromey
@ 2010-07-01 15:41 ` Daniel Jacobowitz
  2010-07-01 16:13   ` Mark Kettenis
  2010-07-01 16:56   ` Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2010-07-01 15:41 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Wed, Jun 30, 2010 at 04:37:23PM -0600, Tom Tromey wrote:
> This patch changes dwarf2_frame_find_fde to check psymtabs_addrmap
> before trying to read the FDE data.
> 
> I am not totally convinced this is safe, so comments are especially
> appreciated here.

This doesn't sound right.  I don't know how any of the psymtab changes
work, but there shouldn't be a link between psymtabs and FDEs at all;
they don't have to correspond.  Wouldn't this break a library with
.debug_frame for all code, and .debug_info for only one input object?

-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs
  2010-07-01 15:41 ` Daniel Jacobowitz
@ 2010-07-01 16:13   ` Mark Kettenis
  2010-07-01 16:56   ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Kettenis @ 2010-07-01 16:13 UTC (permalink / raw)
  To: dan; +Cc: tromey, gdb-patches

> Date: Thu, 1 Jul 2010 11:41:01 -0400
> From: Daniel Jacobowitz <dan@codesourcery.com>
> 
> On Wed, Jun 30, 2010 at 04:37:23PM -0600, Tom Tromey wrote:
> > This patch changes dwarf2_frame_find_fde to check psymtabs_addrmap
> > before trying to read the FDE data.
> > 
> > I am not totally convinced this is safe, so comments are especially
> > appreciated here.
> 
> This doesn't sound right.  I don't know how any of the psymtab changes
> work, but there shouldn't be a link between psymtabs and FDEs at all;
> they don't have to correspond.  Wouldn't this break a library with
> .debug_frame for all code, and .debug_info for only one input object?

I agree with Daniel here.

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

* Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs
  2010-07-01 15:41 ` Daniel Jacobowitz
  2010-07-01 16:13   ` Mark Kettenis
@ 2010-07-01 16:56   ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2010-07-01 16:56 UTC (permalink / raw)
  To: gdb-patches

Daniel> This doesn't sound right.  I don't know how any of the psymtab changes
Daniel> work, but there shouldn't be a link between psymtabs and FDEs at all;
Daniel> they don't have to correspond.  Wouldn't this break a library with
Daniel> .debug_frame for all code, and .debug_info for only one input object?

Yeah.  Thanks.

Tom

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

end of thread, other threads:[~2010-07-01 16:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-30 22:37 [2/4] RFC: check psymtabs_addrmap before reading FDEs Tom Tromey
2010-07-01 15:41 ` Daniel Jacobowitz
2010-07-01 16:13   ` Mark Kettenis
2010-07-01 16:56   ` Tom Tromey

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