From 1594fa5616a49b5942c88b9e569fddc5c8e54753 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 13 Mar 2003 18:09:30 +0000 Subject: [PATCH] 2003-03-13 Andrew Cagney * frame.c (legacy_frame_p): New function. (get_prev_frame): Use legacy_frame_p. * frame.h (legacy_frame_p): Declare. --- gdb/ChangeLog | 6 ++++++ gdb/frame.c | 14 ++++++++++---- gdb/frame.h | 4 ++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c9ec531b46d..fa4f836ad2f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-03-13 Andrew Cagney + + * frame.c (legacy_frame_p): New function. + (get_prev_frame): Use legacy_frame_p. + * frame.h (legacy_frame_p): Declare. + 2003-03-13 D. Venkatasubramanian * MAINTAINERS (write after approval): Alphabetically diff --git a/gdb/frame.c b/gdb/frame.c index 267d484b606..94e9a4ae6d5 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1327,10 +1327,7 @@ get_prev_frame (struct frame_info *this_frame) the legacy get_prev_frame method. Just don't try to unwind a sentinel frame using that method - it doesn't work. All sentinal frames use the new unwind code. */ - if ((DEPRECATED_INIT_FRAME_PC_P () - || DEPRECATED_INIT_FRAME_PC_FIRST_P () - || DEPRECATED_INIT_EXTRA_FRAME_INFO_P () - || FRAME_CHAIN_P ()) + if (legacy_frame_p (current_gdbarch) && this_frame->level >= 0) { prev_frame = legacy_get_prev_frame (this_frame); @@ -1696,6 +1693,15 @@ deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs, return frame; } +int +legacy_frame_p (struct gdbarch *current_gdbarch) +{ + return (DEPRECATED_INIT_FRAME_PC_P () + || DEPRECATED_INIT_FRAME_PC_FIRST_P () + || DEPRECATED_INIT_EXTRA_FRAME_INFO_P () + || FRAME_CHAIN_P ()); +} + void _initialize_frame (void) { diff --git a/gdb/frame.h b/gdb/frame.h index 18c4df4397f..9e477a6c4e7 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -701,4 +701,8 @@ extern struct context *deprecated_get_frame_context (struct frame_info *fi); extern void deprecated_set_frame_context (struct frame_info *fi, struct context *context); +/* Return non-zero if the architecture is relying on legacy frame + code. */ +extern int legacy_frame_p (struct gdbarch *gdbarch); + #endif /* !defined (FRAME_H) */