Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch, moxie] Fix regression/crash in prologue analysis
@ 2009-07-18 18:02 Anthony Green
  0 siblings, 0 replies; only message in thread
From: Anthony Green @ 2009-07-18 18:02 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

This patch...

http://sourceware.org/ml/gdb-patches/2009-07/msg00079.html

...introduced a frame_info argument to moxie_analyze_prologue from which
we extract a gdbarch to get the frame's endianess for later use.
Unfortunately moxie_skip_prologue calls moxie_analyze_prologue with a
NULL frame_info, resulting in a crash.

My solution is to change that frame_info argument into a gdbarch
argument because all of the callers have a valid gdbarch.

I'm checking this patch in.

AG


[-- Attachment #2: p.txt --]
[-- Type: text/plain, Size: 1673 bytes --]

2009-07-18  Anthony Green  <green@moxielogic.org>

	* moxie-tdep.c (moxie_analyze_prologue): Take gdbarch as last
	parameter instead of frame_info.
	(moxie_frame_cache): Call moxie_analyze_prologue with different
	args.


Index: gdb/moxie-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/moxie-tdep.c,v
retrieving revision 1.5
diff -u -r1.5 moxie-tdep.c
--- gdb/moxie-tdep.c	13 Jul 2009 04:56:14 -0000	1.5
+++ gdb/moxie-tdep.c	18 Jul 2009 13:25:42 -0000
@@ -145,10 +145,9 @@
 
 static CORE_ADDR
 moxie_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
-		      struct moxie_frame_cache *cache,
-		      struct frame_info *this_frame)
+			struct moxie_frame_cache *cache,
+			struct gdbarch *gdbarch)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR next_addr;
   ULONGEST inst, inst2;
@@ -226,7 +225,7 @@
 	  memset (&cache, 0, sizeof cache);
 	  
 	  plg_end = moxie_analyze_prologue (func_addr, 
-					    func_end, &cache, NULL);
+					    func_end, &cache, gdbarch);
 	  /* Found a function.  */
 	  sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL);
 	  /* Don't use line number debug info for assembly source
@@ -384,7 +383,10 @@
   cache->pc = get_frame_func (this_frame);
   current_pc = get_frame_pc (this_frame);
   if (cache->pc)
-    moxie_analyze_prologue (cache->pc, current_pc, cache, this_frame);
+    {
+      struct gdbarch *gdbarch = get_frame_arch (this_frame);
+      moxie_analyze_prologue (cache->pc, current_pc, cache, gdbarch);
+    }
 
   cache->saved_sp = cache->base - cache->framesize;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-18 13:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-18 18:02 [patch, moxie] Fix regression/crash in prologue analysis Anthony Green

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox