From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11862 invoked by alias); 6 Oct 2003 21:15:03 -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 11844 invoked from network); 6 Oct 2003 21:15:00 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 6 Oct 2003 21:15:00 -0000 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id E799B800153 for ; Mon, 6 Oct 2003 17:14:56 -0400 (EDT) Message-ID: <3F81DB50.6020202@redhat.com> Date: Mon, 06 Oct 2003 21:15:00 -0000 From: "J. Johnston" Organization: Red Hat Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: RFA: frame id enhancement Content-Type: multipart/mixed; boundary="------------040408050609000602050104" X-SW-Source: 2003-10/txt/msg00127.txt.bz2 This is a multi-part message in MIME format. --------------040408050609000602050104 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 839 The following patch enhances the frame id support to allow an architecture to set a special address for the frame. This enables architectures such as the ia64 (which has a 2nd stack) to properly mark distinct frames. I added a new routine that builds frame ids that has a special address parameter. The current frame_id_build() has been changed to call the new routine with a default special address of 0. This means that existing calls to frame_id_build() require no changes. Ok to commit to mainline? -- Jeff J. 2003-10-06 Jeff Johnston * frame.h (struct frame_id): Add new field: special_addr. (frame_id_build_special): New prototype. * frame.c (frame_id_build_special): New function. (frame_id_build): Change to call frame_id_build_special(). (frame_id_eq): Change to also test special_addr field. --------------040408050609000602050104 Content-Type: text/plain; name="frame-special.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="frame-special.patch" Content-length: 3972 Index: frame.c =================================================================== RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.145 diff -u -r1.145 frame.c --- frame.c 2 Oct 2003 20:28:29 -0000 1.145 +++ frame.c 6 Oct 2003 21:07:51 -0000 @@ -144,9 +144,10 @@ void fprint_frame_id (struct ui_file *file, struct frame_id id) { - fprintf_unfiltered (file, "{stack=0x%s,code=0x%s}", + fprintf_unfiltered (file, "{stack=0x%s,code=0x%s,special=0x%s}", paddr_nz (id.stack_addr), - paddr_nz (id.code_addr)); + paddr_nz (id.code_addr), + paddr_nz (id.special_addr)); } static void @@ -256,14 +257,22 @@ const struct frame_id null_frame_id; /* All zeros. */ struct frame_id -frame_id_build (CORE_ADDR stack_addr, CORE_ADDR code_addr) +frame_id_build_special (CORE_ADDR stack_addr, CORE_ADDR code_addr, + CORE_ADDR special_addr) { struct frame_id id; id.stack_addr = stack_addr; id.code_addr = code_addr; + id.special_addr = special_addr; return id; } +struct frame_id +frame_id_build (CORE_ADDR stack_addr, CORE_ADDR code_addr) +{ + return frame_id_build_special (stack_addr, code_addr, 0); +} + int frame_id_p (struct frame_id l) { @@ -288,6 +297,9 @@ eq = 0; else if (l.stack_addr != r.stack_addr) /* If .stack addresses are different, the frames are different. */ + eq = 0; + else if (l.special_addr != r.special_addr) + /* If .special addresses are different, the frames are different. */ eq = 0; else if (l.code_addr == 0 || r.code_addr == 0) /* A zero code addr is a wild card, always succeed. */ Index: frame.h =================================================================== RCS file: /cvs/src/src/gdb/frame.h,v retrieving revision 1.109 diff -u -r1.109 frame.h --- frame.h 28 Sep 2003 22:32:19 -0000 1.109 +++ frame.h 6 Oct 2003 21:07:52 -0000 @@ -95,8 +95,6 @@ is used. Watch out for all the legacy targets that still use the function pointer register or stack pointer register. They are wrong. */ - /* NOTE: cagney/2002-11-16: The ia64 has two stacks and hence two - frame bases. This will need to be expanded to accomodate that. */ CORE_ADDR stack_addr; /* The frame's code address. This shall be constant through out the lifetime of the frame. While the PC (a.k.a. resume address) @@ -104,6 +102,12 @@ Typically, it is set to the address of the entry point of the frame's function (as returned by frame_func_unwind(). */ CORE_ADDR code_addr; + /* The frame's special address. This shall be constant through out the + lifetime of the frame. This is used for architectures that may have + frames that have the same stack_addr and code_addr but are distinct + due to some other qualification (e.g. the ia64 uses a register + stack which is distinct from the memory stack). */ + CORE_ADDR special_addr; }; /* Methods for constructing and comparing Frame IDs. @@ -120,9 +124,19 @@ /* Construct a frame ID. The first parameter is the frame's constant stack address (typically the outer-bound), and the second the frame's constant code address (typically the entry point) (or zero, - to indicate a wild card). */ + to indicate a wild card). The special identifier address is + defaulted to zero. */ extern struct frame_id frame_id_build (CORE_ADDR stack_addr, CORE_ADDR code_addr); + +/* Construct a special frame ID. The first parameter is the frame's constant + stack address (typically the outer-bound), the second is the + frame's constant code address (typically the entry point) (or zero, + to indicate a wild card), and the third parameter is the frame's + special identifier address. */ +extern struct frame_id frame_id_build_special (CORE_ADDR stack_addr, + CORE_ADDR code_addr, + CORE_ADDR special_addr); /* Returns non-zero when L is a valid frame (a valid frame has a non-zero .base). */ --------------040408050609000602050104--