From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16685 invoked by alias); 11 Jun 2009 18:53:41 -0000 Received: (qmail 16677 invoked by uid 22791); 11 Jun 2009 18:53:40 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Jun 2009 18:53:34 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MEpP0-0004Zh-UA for gdb-patches@sources.redhat.com; Thu, 11 Jun 2009 18:53:30 +0000 Received: from enigma.qnx.com ([209.226.137.106]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Jun 2009 18:53:30 +0000 Received: from aristovski by enigma.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Jun 2009 18:53:30 +0000 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: [patch] i386-nto-tdep.c - sigcontext Date: Thu, 11 Jun 2009 18:53:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090405080809000105000105" User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00310.txt.bz2 This is a multi-part message in MIME format. --------------090405080809000105000105 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 450 Hello, This is another cleanup patch for nto target (part of the ongoing effort to get my local changes into mainline). Thanks, -- Aleksandar Ristovski QNX Software Systems ChangeLog: * i386-nto-tdep.c (I386_NTO_SIGCONTEXT_OFFSET): Remove define. (i386nto_sigcontext_addr): Change the way context address is calculated. (i386nto_init_abi): Remove usage of deprecated sc_reg_offset and sc_sp_offset and set sc_reg_offset and sc_num_regs. --------------090405080809000105000105 Content-Type: text/plain; name="i386-nto-tdep.c-sigcontext_addr-20090611.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="i386-nto-tdep.c-sigcontext_addr-20090611.patch" Content-length: 1586 Index: gdb/i386-nto-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-nto-tdep.c,v retrieving revision 1.33 diff -u -p -r1.33 i386-nto-tdep.c --- gdb/i386-nto-tdep.c 11 Jun 2009 17:12:11 -0000 1.33 +++ gdb/i386-nto-tdep.c 11 Jun 2009 18:45:30 -0000 @@ -290,8 +290,6 @@ i386nto_sigtramp_p (struct frame_info *t return name && strcmp ("__signalstub", name) == 0; } -#define I386_NTO_SIGCONTEXT_OFFSET 136 - /* Assuming THIS_FRAME is a QNX Neutrino sigtramp routine, return the address of the associated sigcontext structure. */ @@ -299,12 +297,14 @@ static CORE_ADDR i386nto_sigcontext_addr (struct frame_info *this_frame) { char buf[4]; - CORE_ADDR sp; + CORE_ADDR ptrctx; - get_frame_register (this_frame, I386_ESP_REGNUM, buf); - sp = extract_unsigned_integer (buf, 4); + /* We store __ucontext_t addr in EDI register. */ + get_frame_register (this_frame, I386_EDI_REGNUM, buf); + ptrctx = extract_unsigned_integer (buf, 4); + ptrctx += 24 /* Context pointer is at this offset. */; - return sp + I386_NTO_SIGCONTEXT_OFFSET; + return ptrctx; } static void @@ -343,8 +343,8 @@ i386nto_init_abi (struct gdbarch_info in tdep->sigtramp_p = i386nto_sigtramp_p; tdep->sigcontext_addr = i386nto_sigcontext_addr; - tdep->sc_pc_offset = 56; - tdep->sc_sp_offset = 68; + tdep->sc_reg_offset = i386nto_gregset_reg_offset; + tdep->sc_num_regs = ARRAY_SIZE (i386nto_gregset_reg_offset); /* Setjmp()'s return PC saved in EDX (5). */ tdep->jb_pc_offset = 20; /* 5x32 bit ints in. */ --------------090405080809000105000105--