All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Help with gdb on Mac OS
@ 2007-02-12  6:54 Ilya Shar
  2007-02-12 10:17 ` Pierre d'Herbemont
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Shar @ 2007-02-12  6:54 UTC (permalink / raw)
  To: qemu-devel

I am trying to step through i386-darwin-user/qemu-i386
in gdb but I am getting a KERN_PROTECTION_FAILURE
fairly early in the run: 

(gdb) run /bin/ls
Starting program:
/Users/ilya/tmp/feb11/qemu-0.9.0/i386-darwin-user/qemu-i386
/bin/ls
Reading symbols for shared libraries . done
Starting /bin/ls with qemu
----------------

Program received signal EXC_BAD_ACCESS, Could not
access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x2115eaf5
helper_cmpxchg8b () at ../cpu-all.h:344
344         ((uint32_t *)ptr)[0] = x.p[0];
(gdb) 

The offending value of ptr is misalligned, can this
indicate a problem?  Reducing optimization or setting
-g3 doesn't change this behavior.  Strangely, the same
example runs fine without gdb. 

Is there any way to correct the gdb problem?  I am
using gdb 6.3 on Mac OS Intel with QEMU 0.9.0 and
patches for gcc4/Mac posted by Mike Kronenberg.  

Thanks for your help, 
Ilya 



 
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] Help with gdb on Mac OS
  2007-02-12  6:54 [Qemu-devel] Help with gdb on Mac OS Ilya Shar
@ 2007-02-12 10:17 ` Pierre d'Herbemont
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre d'Herbemont @ 2007-02-12 10:17 UTC (permalink / raw)
  To: qemu-devel


On 12 févr. 07, at 07:54, Ilya Shar wrote:

> I am trying to step through i386-darwin-user/qemu-i386
>
> Program received signal EXC_BAD_ACCESS, Could not
> access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x2115eaf5
> helper_cmpxchg8b () at ../cpu-all.h:344
> 344         ((uint32_t *)ptr)[0] = x.p[0];
> (gdb)
>
> The offending value of ptr is misalligned, can this
> indicate a problem?  Reducing optimization or setting
> -g3 doesn't change this behavior.  Strangely, the same
> example runs fine without gdb.

qemu will handle the signal fine. Actually it is more a feature than  
a bug ;-)

Unfortunately
"(gdb) handle EXC_BAD_ACCESS pass"
is kind of broken as EXC_BAD_ACCESS is not translated to the  
corresponding bsd signal, so qemu won't handle it.

You should probably try to use the gdb interface provided by qemu if  
you wan't to debug the target program instead of qemu:
# i386-darwin-user/qemu-i386 -g /bin/ls

You can now connect to the gdb interface using:
#gdb -arch i386
(gdb) target remote localhost:1234
(gdb) c

Pierre.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-12 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12  6:54 [Qemu-devel] Help with gdb on Mac OS Ilya Shar
2007-02-12 10:17 ` Pierre d'Herbemont

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.