From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11849 invoked by alias); 17 Nov 2005 12:17:32 -0000 Received: (qmail 11838 invoked by uid 22791); 17 Nov 2005 12:17:29 -0000 Received: from ip127.bb146.pacific.net.hk (HELO stl.com.hk) (202.64.146.127) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 17 Nov 2005 12:17:29 +0000 Received: from 241.206.17.210.dyn.pacific.net.hk ([210.17.206.241] helo=[192.168.1.10]) by stl.com.hk with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1Ecidr-0007wm-OL; Thu, 17 Nov 2005 20:13:27 +0800 Message-ID: <437C74CB.6030106@tausq.org> Date: Thu, 17 Nov 2005 12:44:00 -0000 From: Randolph Chung User-Agent: Debian Thunderbird 1.0.2 (X11/20050331) MIME-Version: 1.0 To: Mark Kettenis CC: gdb-patches@sources.redhat.com Subject: Re: [hppa-hpux] Signal frame unwinding support for hppa64-hp-hpux11.11 References: <437C0B76.7010109@tausq.org> <200511170956.jAH9uXfn030506@elgar.sibelius.xs4all.nl> <437C55B8.1070604@tausq.org> <200511171049.jAHAn3kx001850@elgar.sibelius.xs4all.nl> In-Reply-To: <200511171049.jAHAn3kx001850@elgar.sibelius.xs4all.nl> Content-Type: multipart/mixed; boundary="------------000807050909020708090703" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00275.txt.bz2 This is a multi-part message in MIME format. --------------000807050909020708090703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 34 Here's the new version. randolph --------------000807050909020708090703 Content-Type: text/x-patch; name="sig.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sig.diff" Content-length: 4200 2005-11-15 Randolph Chung * hppa-hpux-tdep.c (hppa_hpux_sigtramp_frame_unwind_cache): Use HPPA_HPUX_SS_* constants. Ensure "off" is large enough to hold 64-bit offset. Set proper signal context offset for 64-bit programs. Set pc properly for signal frames. Index: hppa-hpux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v retrieving revision 1.43 diff -u -p -r1.43 hppa-hpux-tdep.c --- hppa-hpux-tdep.c 29 Oct 2005 21:31:45 -0000 1.43 +++ hppa-hpux-tdep.c 17 Nov 2005 12:13:28 -0000 @@ -49,6 +49,26 @@ #define IS_32BIT_TARGET(_gdbarch) \ ((gdbarch_tdep (_gdbarch))->bytes_per_address == 4) +/* Bit in the `ss_flag' member of `struct save_state' that indicates + that the 64-bit register values are live. From + . */ +#define HPPA_HPUX_SS_WIDEREGS 0x40 + +/* Offsets of various parts of `struct save_state'. From + . */ +#define HPPA_HPUX_SS_FLAGS_OFFSET 0 +#define HPPA_HPUX_SS_NARROW_OFFSET 4 +#define HPPA_HPUX_SS_FPBLOCK_OFFSET 256 +#define HPPA_HPUX_SS_WIDE_OFFSET 640 + +/* The size of `struct save_state. */ +#define HPPA_HPUX_SAVE_STATE_SIZE 1152 + +/* The size of `struct pa89_save_state', which corresponds to PA-RISC + 1.1, the lowest common denominator that we support. */ +#define HPPA_HPUX_PA89_SAVE_STATE_SIZE 512 + + /* Forward declarations. */ extern void _initialize_hppa_hpux_tdep (void); extern initialize_file_ftype _initialize_hppa_hpux_tdep; @@ -1158,8 +1178,8 @@ hppa_hpux_sigtramp_frame_unwind_cache (s struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); struct hppa_hpux_sigtramp_unwind_cache *info; unsigned int flag; - CORE_ADDR sp, scptr; - int i, incr, off, szoff; + CORE_ADDR sp, scptr, off; + int i, incr, szoff; if (*this_cache) return *this_cache; @@ -1170,25 +1190,29 @@ hppa_hpux_sigtramp_frame_unwind_cache (s sp = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM); - scptr = sp - 1352; + if (IS_32BIT_TARGET (gdbarch)) + scptr = sp - 1352; + else + scptr = sp - 1520; + off = scptr; /* See /usr/include/machine/save_state.h for the structure of the save_state_t structure. */ - flag = read_memory_unsigned_integer(scptr, 4); - - if (!(flag & 0x40)) + flag = read_memory_unsigned_integer(scptr + HPPA_HPUX_SS_FLAGS_OFFSET, 4); + + if (!(flag & HPPA_HPUX_SS_WIDEREGS)) { /* Narrow registers. */ - off = scptr + offsetof (save_state_t, ss_narrow); + off = scptr + HPPA_HPUX_SS_NARROW_OFFSET; incr = 4; szoff = 0; } else { /* Wide registers. */ - off = scptr + offsetof (save_state_t, ss_wide) + 8; + off = scptr + HPPA_HPUX_SS_WIDE_OFFSET + 8; incr = 8; szoff = (tdep->bytes_per_address == 4 ? 4 : 0); } @@ -1203,11 +1227,15 @@ hppa_hpux_sigtramp_frame_unwind_cache (s { if (hppa_hpux_tramp_reg[i] > 0) info->saved_regs[hppa_hpux_tramp_reg[i]].addr = off + szoff; + off += incr; } /* TODO: fp regs */ + info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].addr = + info->saved_regs[HPPA_RP_REGNUM].addr; + info->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM); return info; @@ -1760,25 +1788,6 @@ hppa_hpux_push_dummy_code (struct gdbarc -/* Bit in the `ss_flag' member of `struct save_state' that indicates - that the 64-bit register values are live. From - . */ -#define HPPA_HPUX_SS_WIDEREGS 0x40 - -/* Offsets of various parts of `struct save_state'. From - . */ -#define HPPA_HPUX_SS_FLAGS_OFFSET 0 -#define HPPA_HPUX_SS_NARROW_OFFSET 4 -#define HPPA_HPUX_SS_FPBLOCK_OFFSET 256 -#define HPPA_HPUX_SS_WIDE_OFFSET 640 - -/* The size of `struct save_state. */ -#define HPPA_HPUX_SAVE_STATE_SIZE 1152 - -/* The size of `struct pa89_save_state', which corresponds to PA-RISC - 1.1, the lowest common denominator that we support. */ -#define HPPA_HPUX_PA89_SAVE_STATE_SIZE 512 - static void hppa_hpux_supply_ss_narrow (struct regcache *regcache, int regnum, const char *save_state) --------------000807050909020708090703--