From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29497 invoked by alias); 21 Apr 2005 21:20:32 -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 29436 invoked from network); 21 Apr 2005 21:20:26 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 21 Apr 2005 21:20:26 -0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j3LLKLCb015749; Thu, 21 Apr 2005 23:20:21 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j3LLKKZZ007713; Thu, 21 Apr 2005 23:20:20 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j3LLKB42010991; Thu, 21 Apr 2005 23:20:11 +0200 (CEST) Date: Thu, 21 Apr 2005 21:20:00 -0000 Message-Id: <200504212120.j3LLKB42010991@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: davem@davemloft.net CC: gdb-patches@sources.redhat.com In-reply-to: <20050421122250.6108168c.davem@davemloft.net> Subject: Re: [PATCH] Add sparc64-linux sigtramp support References: <20050420204427.20d670e6.davem@davemloft.net> <200504211923.j3LJNHo6010891@elgar.sibelius.xs4all.nl> <20050421122250.6108168c.davem@davemloft.net> X-SW-Source: 2005-04/txt/msg00264.txt.bz2 Date: Thu, 21 Apr 2005 12:22:50 -0700 From: "David S. Miller" Sure, I'll fix this all up. Thanks for reviewing. I'd like to convert this stuff over to the cleaner infrastructure PPC and MIPS linux targets use, it might mean ditching the solaris tdep sharing though since they sniff the sigtramps slightly differently. It's kind of weird that we let the solaris code register it's sniffer in the chain on linux targets even though the linux sniffer is registered such that it trumps the solaris one. It'd be great if you could convert things to use the tramp_frame stuff. Should be doable for SPARC/UltraSPARC Linux without too much effort, and simplify the code a bit. The Solaris sniffer shouldn't really hurt the Linux stuff. But I guess it makes sense now, to copy the SVR4-style shared library stuff into sparcxx_linux_init_abi() and remove the call to sparcxx_sol2_init_abi(). I'll make that change. > P.S. I'm close to enabling the DWARF2 unwinder for SPARC, but there > still are a few issues that I have to solve yet. None of these affect > Linux/sparc64. I can send you a patch to test if you want. Funny, I started playing around with the DWARF2 unwinder last night as well on Sparc. It interacted badly with the signal trampoline sniffers but otherwise mostly worked, and that's as far as I got before I went to bed. Please send me your test patch and what issues you are aware of, I can likely work on fixing them today/tonight. The attached patch was what I was thinking about. If it has issues with signal handlers, take a look at i386-linux-tdep.c:i386_linux_dwarf_signale_p(), That might help in the case DWARF2 CFI for the signal trampoline is provided. Mark Index: sparc64-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sparc64-linux-tdep.c,v retrieving revision 1.5 diff -u -p -r1.5 sparc64-linux-tdep.c --- sparc64-linux-tdep.c 21 Apr 2005 19:38:20 -0000 1.5 +++ sparc64-linux-tdep.c 21 Apr 2005 21:06:47 -0000 @@ -206,6 +206,7 @@ sparc64_linux_init_abi (struct gdbarch_i { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); frame_unwind_append_sniffer (gdbarch, sparc64_linux_sigtramp_frame_sniffer); /* GNU/Linux is very similar to Solaris ... */ Index: sparc64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sparc64-tdep.c,v retrieving revision 1.21 diff -u -p -r1.21 sparc64-tdep.c --- sparc64-tdep.c 28 Mar 2005 13:42:49 -0000 1.21 +++ sparc64-tdep.c 21 Apr 2005 21:06:48 -0000 @@ -21,6 +21,7 @@ #include "defs.h" #include "arch-utils.h" +#include "dwarf2-frame.h" #include "floatformat.h" #include "frame.h" #include "frame-base.h" @@ -1103,6 +1104,26 @@ sparc64_return_value (struct gdbarch *gd } +static void +sparc64_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, + struct dwarf2_frame_state_reg *reg) +{ + switch (regnum) + { + case SPARC_SP_REGNUM: + reg->how = DWARF2_FRAME_REG_CFA; + break; + case SPARC64_PC_REGNUM: + reg->how = DWARF2_FRAME_REG_RA_OFFSET; + reg->loc.offset = 8; + break; + case SPARC64_NPC_REGNUM: + reg->how = DWARF2_FRAME_REG_RA_OFFSET; + reg->loc.offset = 12; + break; + } +} + void sparc64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -1137,6 +1158,12 @@ sparc64_init_abi (struct gdbarch_info in set_gdbarch_skip_prologue (gdbarch, sparc64_skip_prologue); + /* Hook in the DWARF CFI frame unwinder. */ + dwarf2_frame_set_init_reg (gdbarch, sparc64_dwarf2_frame_init_reg); +#if notyet + frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); +#endif + frame_unwind_append_sniffer (gdbarch, sparc64_frame_sniffer); frame_base_set_default (gdbarch, &sparc64_frame_base); }