From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: frame_register_unwind(): "frame != NULL" assertion failure
Date: Thu, 20 Feb 2003 16:18:00 -0000 [thread overview]
Message-ID: <1030220161810.ZM7859@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@redhat.com> "Re: frame_register_unwind(): "frame != NULL" assertion failure" (Feb 18, 5:55pm)
On Feb 18, 5:55pm, Andrew Cagney wrote:
> Change this call:
>
> frame_register_unwind (get_next_frame (frame), regnum, optimizedp, lvalp,
> addrp, &realnum, raw_buffer);
>
> to instead call:
>
> static void
> generic_unwind_get_saved_register (char *raw_buffer,
> int *optimizedp,
> CORE_ADDR *addrp,
> struct frame_info *frame,
> int regnum,
> enum lval_type *lvalp)
>
> (note that the get_next_frame(frame) call isn't needed - that function
> does not have a well chosen name). The function frame_register() would
> be better but because that knows about old style get_saved_register code
> it would result in infinite recursion :-(
That works. How does this look?
* frame.c (generic_unwind_get_saved_register): Make non-static.
* frame.h (generic_unwind_get_saved_register): Declare.
* mips-tdep.c (read_next_frame_reg): Fetch register from
current regcache when frame is NULL.
(mips_init_extra_frame_info): Pass NULL explicitly for parameter
that must be NULL.
(mips_get_saved_register): Call generic_unwind_get_saved_register()
instead of frame_register_unwind().
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.66
diff -u -p -r1.66 frame.c
--- frame.c 2 Feb 2003 20:31:43 -0000 1.66
+++ frame.c 20 Feb 2003 16:01:58 -0000
@@ -307,7 +307,7 @@ frame_read_signed_register (struct frame
frame_unwind_signed_register (frame->next, regnum, val);
}
-static void
+void
generic_unwind_get_saved_register (char *raw_buffer,
int *optimizedp,
CORE_ADDR *addrp,
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.66
diff -u -p -r1.66 frame.h
--- frame.h 2 Feb 2003 20:31:43 -0000 1.66
+++ frame.h 20 Feb 2003 16:01:58 -0000
@@ -553,6 +553,13 @@ extern void generic_fix_call_dummy (char
int nargs, struct value **args,
struct type *type, int gcc_p);
+void generic_unwind_get_saved_register (char *raw_buffer,
+ int *optimizedp,
+ CORE_ADDR *addrp,
+ struct frame_info *frame,
+ int regnum,
+ enum lval_type *lvalp);
+
/* The function generic_get_saved_register() has been made obsolete.
GET_SAVED_REGISTER now defaults to the recursive equivalent -
generic_unwind_get_saved_register() - so there is no need to even
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.161
diff -u -p -r1.161 mips-tdep.c
--- mips-tdep.c 28 Jan 2003 16:31:11 -0000 1.161
+++ mips-tdep.c 20 Feb 2003 16:01:59 -0000
@@ -1589,20 +1589,28 @@ read_next_frame_reg (struct frame_info *
int realnum;
enum lval_type lval;
void *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
- frame_register_unwind (fi, regno, &optimized, &lval, &addr, &realnum,
- raw_buffer);
- /* FIXME: cagney/2002-09-13: This is just soooo bad. The MIPS
- should have a pseudo register range that correspons to the ABI's,
- rather than the ISA's, view of registers. These registers would
- then implicitly describe their size and hence could be used
- without the below munging. */
- if (lval == lval_memory)
- {
- if (regno < 32)
- {
- /* Only MIPS_SAVED_REGSIZE bytes of GP registers are
- saved. */
- return read_memory_integer (addr, MIPS_SAVED_REGSIZE);
+
+ if (fi == NULL)
+ {
+ regcache_cooked_read (current_regcache, regno, raw_buffer);
+ }
+ else
+ {
+ frame_register_unwind (fi, regno, &optimized, &lval, &addr, &realnum,
+ raw_buffer);
+ /* FIXME: cagney/2002-09-13: This is just soooo bad. The MIPS
+ should have a pseudo register range that correspons to the ABI's,
+ rather than the ISA's, view of registers. These registers would
+ then implicitly describe their size and hence could be used
+ without the below munging. */
+ if (lval == lval_memory)
+ {
+ if (regno < 32)
+ {
+ /* Only MIPS_SAVED_REGSIZE bytes of GP registers are
+ saved. */
+ return read_memory_integer (addr, MIPS_SAVED_REGSIZE);
+ }
}
}
@@ -2473,11 +2481,16 @@ mips_init_extra_frame_info (int fromleaf
if (get_frame_type (fci) == DUMMY_FRAME)
return;
- /* Use proc_desc calculated in frame_chain */
+ /* Use proc_desc calculated in frame_chain. When there is no
+ next frame, i.e, get_next_frame (fci) == NULL, we call
+ find_proc_desc () to calculate it, passing an explicit
+ NULL as the frame parameter. */
proc_desc =
get_next_frame (fci)
? cached_proc_desc
- : find_proc_desc (get_frame_pc (fci), get_next_frame (fci), 1);
+ : find_proc_desc (get_frame_pc (fci),
+ NULL /* i.e, get_next_frame (fci) */,
+ 1);
frame_extra_info_zalloc (fci, sizeof (struct frame_extra_info));
@@ -5481,7 +5494,6 @@ mips_get_saved_register (char *raw_buffe
CORE_ADDR addrx;
enum lval_type lvalx;
int optimizedx;
- int realnum;
if (!target_has_registers)
error ("No registers.");
@@ -5493,8 +5505,8 @@ mips_get_saved_register (char *raw_buffe
lvalp = &lvalx;
if (optimizedp == NULL)
optimizedp = &optimizedx;
- frame_register_unwind (get_next_frame (frame), regnum, optimizedp, lvalp,
- addrp, &realnum, raw_buffer);
+ generic_unwind_get_saved_register (raw_buffer, optimizedp, addrp, frame,
+ regnum, lvalp);
/* FIXME: cagney/2002-09-13: This is just so bad. The MIPS should
have a pseudo register range that correspons to the ABI's, rather
than the ISA's, view of registers. These registers would then
next prev parent reply other threads:[~2003-02-20 16:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-13 21:24 Kevin Buettner
2003-02-13 21:29 ` Daniel Jacobowitz
2003-02-13 21:35 ` Kevin Buettner
2003-02-13 21:48 ` Kevin Buettner
2003-02-13 23:27 ` Kevin Buettner
2003-02-14 14:58 ` Andrew Cagney
2003-02-14 15:14 ` Daniel Jacobowitz
2003-02-14 15:24 ` Kevin Buettner
2003-02-17 15:37 ` Andrew Cagney
2003-02-17 23:21 ` Kevin Buettner
2003-02-18 2:39 ` Andrew Cagney
2003-02-18 1:59 ` Kevin Buettner
2003-02-18 22:51 ` Andrew Cagney
2003-02-20 16:18 ` Kevin Buettner [this message]
2003-02-20 16:28 ` Andrew Cagney
2003-02-20 16:36 ` Kevin Buettner
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=1030220161810.ZM7859@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=ac131313@redhat.com \
--cc=gdb@sources.redhat.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).