From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9206 invoked by alias); 9 Aug 2008 08:17:29 -0000 Received: (qmail 9190 invoked by uid 22791); 9 Aug 2008 08:17:28 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Aug 2008 08:16:54 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id m798FVXY021273; Sat, 9 Aug 2008 10:15:31 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m798FUhj011086; Sat, 9 Aug 2008 10:15:30 +0200 (CEST) Date: Sat, 09 Aug 2008 08:17:00 -0000 Message-Id: <200808090815.m798FUhj011086@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: pedro@codesourcery.com CC: gdb-patches@sourceware.org In-reply-to: <200808080420.05897.pedro@codesourcery.com> (message from Pedro Alves on Fri, 8 Aug 2008 04:20:04 +0100) Subject: Re: bsd-kvm target, always a thread References: <200808080420.05897.pedro@codesourcery.com> 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/msg00229.txt.bz2 > From: Pedro Alves > Date: Fri, 8 Aug 2008 04:20:04 +0100 > > Hi, > > This patches makes the bsd-kvm target register a main thread. > > I've "tested" this on a x86 OpenBSD-4.3 VM, but I'm not qualified > to do much more openbsd kernel debugging other than: > > (gdb) tar kvm > #0 0x00000006 in ?? () > (gdb) info threads > * 1 0x00000006 in ?? () > > B.T.W, with GDB 6.3, which came with the distro I always get: > > (gdb) tar kvm > #0 0xd034ee05 in ?? () > > With HEAD I always get 0x00000006. > > Is this difference expected? Related to the recent change to > build on 4.3? Hmm, for some reason the .sf_eip got lost when I committed that code. Fixed by the attached diff, which I committed. (I'll send a seperate reply to discuss your diff). Index: ChangeLog from Mark Kettenis * i386obsd-nat.c (i386obsd_supply_pcb): Supply the right bytes for the %eip register. Index: i386obsd-nat.c =================================================================== RCS file: /cvs/src/src/gdb/i386obsd-nat.c,v retrieving revision 1.12 diff -u -p -r1.12 i386obsd-nat.c --- i386obsd-nat.c 6 Aug 2008 19:56:20 -0000 1.12 +++ i386obsd-nat.c 9 Aug 2008 07:58:54 -0000 @@ -78,7 +78,7 @@ i386obsd_supply_pcb (struct regcache *re 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); + regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip); } regcache_raw_supply (regcache, I386_EBP_REGNUM, &pcb->pcb_ebp);