This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[2/4] RFC: check psymtabs_addrmap before reading FDEs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]