Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: pedro@codesourcery.com
Cc: gdb-patches@sourceware.org
Subject: Re: Fix building on x86 OpenBSD 4.3
Date: Wed, 06 Aug 2008 20:04:00 -0000	[thread overview]
Message-ID: <200808061957.m76JvJeq017688@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <200808061632.58245.pedro@codesourcery.com> (message from Pedro 	Alves on Wed, 6 Aug 2008 16:32:57 +0100)

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Wed, 6 Aug 2008 16:32:57 +0100
> 
> > > And I can see it being set to != 0 in that files' history at:
> 
>          ^^^ Of course, I meant *can't* here.  :-)
> 
> > http://opengrok.creo.hu/openbsd/history/src/sys/arch/i386/i386/vm_machdep.c
> 
> > Thanks for pointing this out, I'll fix it ASAP.
> 
> Thanks!

I just comitted the attached patch.


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* i386obsd-nat.c (i386obsd_supply_pcb): Adjust for changes in
	OpenBSD 4.3.

Index: i386obsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386obsd-nat.c,v
retrieving revision 1.11
diff -u -p -r1.11 i386obsd-nat.c
--- i386obsd-nat.c 1 Jan 2008 22:53:11 -0000 1.11
+++ i386obsd-nat.c 6 Aug 2008 19:34:38 -0000
@@ -60,10 +60,11 @@ i386obsd_supply_pcb (struct regcache *re
   /* Read the stack frame, and check its validity.  We do this by
      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)
+#ifdef PCB_SAVECTX
+  if ((pcb->pcb_flags & PCB_SAVECTX) == 0)
     {
       /* Yes, we have a frame that matches cpu_switch().  */
+      read_memory (pcb->pcb_esp, (char *) &sf, sizeof 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);
@@ -71,9 +72,12 @@ i386obsd_supply_pcb (struct regcache *re
       regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip);
     }
   else
+#endif
     {
       /* No, the pcb must have been last updated by savectx().  */
-      pcb->pcb_esp += 4;
+      pcb->pcb_esp = pcb->pcb_ebp;
+      pcb->pcb_ebp = read_memory_integer(pcb->pcb_esp, 4);
+      sf.sf_eip = read_memory_integer(pcb->pcb_esp + 4, 4);
       regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf);
     }
 


      parent reply	other threads:[~2008-08-06 20:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 15:11 Pedro Alves
2008-08-06 15:23 ` Mark Kettenis
2008-08-06 15:28 ` Mark Kettenis
2008-08-06 15:33   ` Pedro Alves
2008-08-06 15:52     ` Mark Kettenis
2008-08-06 20:04     ` Mark Kettenis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200808061957.m76JvJeq017688@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox