From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18525 invoked by alias); 11 May 2002 00:23:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18484 invoked from network); 11 May 2002 00:23:33 -0000 Received: from unknown (HELO deimos.hpl.hp.com) (192.6.19.190) by sources.redhat.com with SMTP; 11 May 2002 00:23:33 -0000 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by deimos.hpl.hp.com (8.9.3 (PHNE_24419)/HPL-PA Relay) with ESMTP id RAA01207 for ; Fri, 10 May 2002 17:23:32 -0700 (PDT) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.10.2/8.10.2 HPL-PA Hub) with ESMTP id g4B0NWH15154 for ; Fri, 10 May 2002 17:23:32 -0700 (PDT) Received: from napali.hpl.hp.com (localhost [127.0.0.1]) by napali.hpl.hp.com (8.12.2/8.12.2/Debian -5) with ESMTP id g4B0NWeM004836; Fri, 10 May 2002 17:23:32 -0700 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.2/8.12.2/Debian -5) id g4B0NVCF004832; Fri, 10 May 2002 17:23:31 -0700 Date: Fri, 10 May 2002 17:23:00 -0000 From: David Mosberger Message-Id: <200205110023.g4B0NVCF004832@napali.hpl.hp.com> To: gdb-patches@sources.redhat.com cc: davidm@napali.hpl.hp.com Subject: new gdb arch routine FRAME_UNCHANGED X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ Reply-to: davidm@hpl.hp.com X-SW-Source: 2002-05/txt/msg00377.txt.bz2 The patch below defines a new gdbarch routine called FRAME_UNCHANGED. This is needed for gdb/ia64 because the ia64 architecture has two separate stack pointers (one for memory stack and one for register stack). Because of the two stacks, it's not possible to look just at the frame pointer and PC to determine whether a frame changed. If the patch looks OK, I'd appreciate if someone could apply it. Note: the patch below doesn't include the ia64 version of FRAME_UNCHANGED. It is part of a larger update to add unwind library support to gdb/ia64 and I'll submit that separately. So, for now, the patch is effectively a no-op for all platforms. Also, it will be necessary to re-generate gdbarch.[ch] after applying the patch. Thanks, --david ChangeLog 2002-05-08 David Mosberger-Tang * gdbarch.sh (FRAME_UNCHANGED): New routine. * frame.h: Declare default_frame_unchanged() and generic_dummy_frame_chain(). * blockframe.c (default_frame_unchanged): New function. (get_prev_frame): Use FRAME_UNCHANGED() to determine whether the new frame is different from the old one. diff -u -r1.134 gdbarch.sh --- gdbarch.sh 8 May 2002 20:43:04 -0000 1.134 +++ gdbarch.sh 9 May 2002 05:33:48 -0000 @@ -548,6 +548,7 @@ f:2:BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc::0 f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0 f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0 +f:2:FRAME_UNCHANGED:int:frame_unchanged:struct frame_info *prev, struct frame_info *next:prev, next::0:default_frame_unchanged::0 v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1 f::PREPARE_TO_PROCEED:int:prepare_to_proceed:int select_it:select_it::0:default_prepare_to_proceed::0 v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1 diff -u -r1.27 blockframe.c --- blockframe.c 5 May 2002 01:15:12 -0000 1.27 +++ blockframe.c 9 May 2002 05:33:25 -0000 @@ -39,6 +39,16 @@ void _initialize_blockframe (void); +/* Default FRAME_UNCHANGED. Returns true if the current and next + frame have the same frame address and the same PC. This version + should work for most platforms. One exception is ia64, since it + has separate memory and register stacks. */ +int +default_frame_unchanged (struct frame_info *prev, struct frame_info *next) +{ + return (prev->frame == next->frame && prev->pc == next->pc); +} + /* A default FRAME_CHAIN_VALID, in the form that is suitable for most targets. If FRAME_CHAIN_VALID returns zero it means that the given frame is the outermost one and has no caller. */ @@ -447,8 +457,7 @@ this can't be an architecture-independent check. */ if (next_frame != NULL) { - if (prev->frame == next_frame->frame - && prev->pc == next_frame->pc) + if (FRAME_UNCHANGED (prev, next_frame)) { next_frame->prev = NULL; obstack_free (&frame_cache_obstack, prev); diff -u -r1.17 frame.h --- frame.h 5 May 2002 02:24:38 -0000 1.17 +++ frame.h 9 May 2002 05:33:38 -0000 @@ -160,6 +160,12 @@ #define FRAME_FP(fi) ((fi)->frame) +/* Define a default FRAME_UNCHANGED in the form that that is suitable + for most targets. If FRAME_UNCHANGED returns zero it means that + the two frames are indistinguishable. */ + +extern int default_frame_unchanged (struct frame_info *, struct frame_info *); + /* Level of the frame: 0 for innermost, 1 for its caller, ...; or -1 for an invalid frame. */