From: Anthony Green <green@moxielogic.com>
To: gdb-patches@sourceware.org
Subject: [patch, moxie] Fix regression/crash in prologue analysis
Date: Sat, 18 Jul 2009 18:02:00 -0000 [thread overview]
Message-ID: <1247925160.2847.7.camel@localhost.localdomain> (raw)
[-- 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;
reply other threads:[~2009-07-18 13:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1247925160.2847.7.camel@localhost.localdomain \
--to=green@moxielogic.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