From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8598 invoked by alias); 6 Aug 2008 15:11:17 -0000 Received: (qmail 8587 invoked by uid 22791); 6 Aug 2008 15:11:16 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Aug 2008 15:10:18 +0000 Received: (qmail 21123 invoked from network); 6 Aug 2008 15:10:16 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Aug 2008 15:10:15 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Fix building on x86 OpenBSD 4.3 Date: Wed, 06 Aug 2008 15:11:00 -0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_07bmIIwG6g0rQqF" Message-Id: <200808061610.44404.pedro@codesourcery.com> 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: 2008-08/txt/msg00116.txt.bz2 --Boundary-00=_07bmIIwG6g0rQqF Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 766 Hi, In my testing on several targets, I noticed that GDB isn't building on x86 OpenBSD 4.3, due to the fact that struct switchframe got its sf_ppl member removed, and GDB is trying to access it. I can't claim I know a think about this, but, The patch that seems to have removed it, shows that is was always 0 just before removal: http://archive.netbsd.se/?ml=openbsd-tech&a=2007-09&m=5239543 And I can see it being set to != 0 in that files' history at: http://opengrok.creo.hu/openbsd/history/src/sys/arch/i386/i386/vm_machdep.c So, I guess that the attached is the best to do, and I didn't notice any breakage. Of course, I don't even know what triggers this code path. :-) Mark, perhaps you have a better fix in your local trees? OK? -- Pedro Alves --Boundary-00=_07bmIIwG6g0rQqF Content-Type: text/x-diff; charset="utf-8"; name="obsd_build_4.3.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="obsd_build_4.3.diff" Content-length: 1775 2008-08-06 Pedro Alves * i386obsd-nat.c (i386obsd_supply_pcb): Remove handling of switchframe.sf_ppl != 0. --- gdb/i386obsd-nat.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) Index: src/gdb/i386obsd-nat.c =================================================================== --- src.orig/gdb/i386obsd-nat.c 2008-01-01 22:53:11.000000000 +0000 +++ src/gdb/i386obsd-nat.c 2008-08-06 16:00:41.000000000 +0100 @@ -61,21 +61,12 @@ i386obsd_supply_pcb (struct regcache *re checking if the saved interrupt priority level in the stack frame looks reasonable.. */ read_memory (pcb->pcb_esp, (char *) &sf, sizeof sf); - if ((unsigned int) sf.sf_ppl < 0x100 && (sf.sf_ppl & 0xf) == 0) - { - /* Yes, we have a frame that matches cpu_switch(). */ - pcb->pcb_esp += sizeof (struct switchframe); - regcache_raw_supply (regcache, I386_EDI_REGNUM, &sf.sf_edi); - regcache_raw_supply (regcache, I386_ESI_REGNUM, &sf.sf_esi); - regcache_raw_supply (regcache, I386_EBX_REGNUM, &sf.sf_ebx); - regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip); - } - else - { - /* No, the pcb must have been last updated by savectx(). */ - pcb->pcb_esp += 4; - regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf); - } + + pcb->pcb_esp += sizeof (struct switchframe); + regcache_raw_supply (regcache, I386_EDI_REGNUM, &sf.sf_edi); + regcache_raw_supply (regcache, I386_ESI_REGNUM, &sf.sf_esi); + regcache_raw_supply (regcache, I386_EBX_REGNUM, &sf.sf_ebx); + regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip); regcache_raw_supply (regcache, I386_EBP_REGNUM, &pcb->pcb_ebp); regcache_raw_supply (regcache, I386_ESP_REGNUM, &pcb->pcb_esp); --Boundary-00=_07bmIIwG6g0rQqF--