From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31869 invoked by alias); 9 Dec 2004 17:23:11 -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 31775 invoked from network); 9 Dec 2004 17:23:05 -0000 Received: from unknown (HELO arwen.tausq.org) (64.81.244.109) by sourceware.org with SMTP; 9 Dec 2004 17:23:05 -0000 Received: by arwen.tausq.org (Postfix, from userid 1000) id AA493111F58; Thu, 9 Dec 2004 09:23:03 -0800 (PST) Date: Thu, 09 Dec 2004 17:35:00 -0000 From: Randolph Chung To: gdb-patches@sources.redhat.com Subject: [rfa] Add some flags to tramp frame unwinder Message-ID: <20041209172303.GF29171@tausq.org> Reply-To: Randolph Chung Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.6+20040722i X-SW-Source: 2004-12/txt/msg00251.txt.bz2 I'd like to use the generic tramp frame code for pa targets; unfortunately hpux decided that the signal trampoline function should have a regular function name, so we cannot use the generic infrastructure (it considers code which is inside a function to be not a trampoline). I added some flags to the tramp_frame structure to make those checks optional. Really, I only need the "ok_inside_function" flag, but for completeness I added "ok_inside_section" as well. is this ok? randolph 2004-12-09 Randolph Chung * tramp-frame.h (tramp_frame): Add flags for trampoline frame checks. * tramp-frame.c (tramp_frame_sniffer): Use new flags to control sniffer checks. * mips-linux-tdep.c (mips_linux_o32_sigframe): Initialize new flags. (mips_linux_o32_rt_sigframe): Likewise. (mips_linux_n32_rt_sigframe): Likewise. (mips_linux_n64_rt_sigframe): Likewise. * mips64obsd-tdep.c (mips64obsd_sigframe): Likewise. * ppcnbsd-tdep.c (ppcnbsd_sigtram): Likewise. Index: tramp-frame.h =================================================================== RCS file: /cvs/src/src/gdb/tramp-frame.h,v retrieving revision 1.5 diff -u -p -r1.5 tramp-frame.h --- tramp-frame.h 20 Jul 2004 15:11:37 -0000 1.5 +++ tramp-frame.h 9 Dec 2004 17:15:11 -0000 @@ -71,6 +71,11 @@ struct tramp_frame struct frame_info *next_frame, struct trad_frame_cache *this_cache, CORE_ADDR func); + /* Typically, a trampoline is not inside a function or section, but on + some targets (e.g. HPUX) they can be. Make these checks optional. */ + unsigned int ok_inside_function:1; + unsigned int ok_inside_section:1; + }; void tramp_frame_prepend_unwinder (struct gdbarch *gdbarch, Index: tramp-frame.c =================================================================== RCS file: /cvs/src/src/gdb/tramp-frame.c,v retrieving revision 1.7 diff -u -p -r1.7 tramp-frame.c --- tramp-frame.c 7 Nov 2004 12:54:58 -0000 1.7 +++ tramp-frame.c 9 Dec 2004 17:15:11 -0000 @@ -128,11 +128,11 @@ tramp_frame_sniffer (const struct frame_ /* If the function has a valid symbol name, it isn't a trampoline. */ find_pc_partial_function (pc, &name, NULL, NULL); - if (name != NULL) + if (!tramp->ok_inside_function && name != NULL) return 0; /* If the function lives in a valid section (even without a starting point) it isn't a trampoline. */ - if (find_pc_section (pc) != NULL) + if (!tramp->ok_inside_section && find_pc_section (pc) != NULL) return 0; /* Finally, check that the trampoline matches at PC. */ func = tramp_frame_start (tramp, next_frame, pc); Index: mips-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-linux-tdep.c,v retrieving revision 1.35 diff -u -p -r1.35 mips-linux-tdep.c --- mips-linux-tdep.c 14 Nov 2004 19:29:27 -0000 1.35 +++ mips-linux-tdep.c 9 Dec 2004 17:15:10 -0000 @@ -841,7 +841,8 @@ static const struct tramp_frame mips_lin { MIPS_INST_SYSCALL, -1 }, { TRAMP_SENTINEL_INSN, -1 } }, - mips_linux_o32_sigframe_init + mips_linux_o32_sigframe_init, + 0, 0 }; static const struct tramp_frame mips_linux_o32_rt_sigframe = { @@ -851,7 +852,8 @@ static const struct tramp_frame mips_lin { MIPS_INST_LI_V0_RT_SIGRETURN, -1 }, { MIPS_INST_SYSCALL, -1 }, { TRAMP_SENTINEL_INSN, -1 } }, - mips_linux_o32_sigframe_init + mips_linux_o32_sigframe_init, + 0, 0 }; static const struct tramp_frame mips_linux_n32_rt_sigframe = { @@ -862,14 +864,16 @@ static const struct tramp_frame mips_lin { MIPS_INST_SYSCALL, -1 }, { TRAMP_SENTINEL_INSN, -1 } }, - mips_linux_n32n64_sigframe_init + mips_linux_n32n64_sigframe_init, + 0, 0 }; static const struct tramp_frame mips_linux_n64_rt_sigframe = { SIGTRAMP_FRAME, 4, { MIPS_INST_LI_V0_N64_RT_SIGRETURN, MIPS_INST_SYSCALL, TRAMP_SENTINEL_INSN }, - mips_linux_n32n64_sigframe_init + mips_linux_n32n64_sigframe_init, + 0, 0 }; /* *INDENT-OFF* */ Index: mips64obsd-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips64obsd-tdep.c,v retrieving revision 1.2 diff -u -p -r1.2 mips64obsd-tdep.c --- mips64obsd-tdep.c 7 Nov 2004 17:02:44 -0000 1.2 +++ mips64obsd-tdep.c 9 Dec 2004 17:15:10 -0000 @@ -125,7 +125,8 @@ static const struct tramp_frame mips64ob { 0x0000000d, -1 }, /* break */ { TRAMP_SENTINEL_INSN, -1 } }, - mips64obsd_sigframe_init + mips64obsd_sigframe_init, + 0, 0 }; Index: ppcnbsd-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ppcnbsd-tdep.c,v retrieving revision 1.25 diff -u -p -r1.25 ppcnbsd-tdep.c --- ppcnbsd-tdep.c 24 Jul 2004 01:00:20 -0000 1.25 +++ ppcnbsd-tdep.c 9 Dec 2004 17:15:10 -0000 @@ -314,7 +314,8 @@ static const struct tramp_frame ppcnbsd_ { 0x44000002, -1 }, /* sc */ { TRAMP_SENTINEL_INSN, -1 } }, - ppcnbsd_sigtramp_cache_init + ppcnbsd_sigtramp_cache_init, + 0, 0 }; static void -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/