* technical question on GDB for MacOS
@ 2007-06-04 3:24 Jeff Roberts
2007-06-04 10:55 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Roberts @ 2007-06-04 3:24 UTC (permalink / raw)
To: gdb
I'm using GDB on MacOS and we do a lot of dynamically generated code in our
products. This is all done safely on various platforms with valloc and
mprotect, and everything runs fine. However, when I want to debug, I can't
convince GDB to display the disassembly for my generated code. It silently
steps and nexts just fine, but it never shows me my asm. I can't even use
the disass <addr> command, because it tells me that there is not any
functions at that address.
Is there a way to convince it to show this?
->Jeff
RAD Game Tools
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: technical question on GDB for MacOS
2007-06-04 3:24 technical question on GDB for MacOS Jeff Roberts
@ 2007-06-04 10:55 ` Daniel Jacobowitz
2007-06-04 21:43 ` Jeff Roberts
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-06-04 10:55 UTC (permalink / raw)
To: Jeff Roberts; +Cc: gdb
On Sun, Jun 03, 2007 at 08:21:31PM -0700, Jeff Roberts wrote:
> I'm using GDB on MacOS
We can't help you much with this - GNU GDB releases don't support
MacOS X. Apple has extensive changes. Fortunately your question is
mostly platform independent.
> steps and nexts just fine, but it never shows me my asm. I can't even use
> the disass <addr> command, because it tells me that there is not any
> functions at that address.
Right. You can use "display/i $pc" and "x/i <addr>" to show the
assembly anyway.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: technical question on GDB for MacOS
2007-06-04 10:55 ` Daniel Jacobowitz
@ 2007-06-04 21:43 ` Jeff Roberts
2007-06-05 18:01 ` Michael Snyder
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Roberts @ 2007-06-04 21:43 UTC (permalink / raw)
To: gdb
> Right. You can use "display/i $pc" and "x/i <addr>" to show the
> assembly anyway.
Perfect, thank you!
->Jeff
RAD Game Tools
----- Original Message -----
From: "Daniel Jacobowitz" <drow@false.org>
To: "Jeff Roberts" <jeffr@radgametools.com>
Cc: <gdb@sourceware.org>
Sent: Monday, June 04, 2007 3:55 AM
Subject: Re: technical question on GDB for MacOS
> On Sun, Jun 03, 2007 at 08:21:31PM -0700, Jeff Roberts wrote:
>> I'm using GDB on MacOS
>
> We can't help you much with this - GNU GDB releases don't support
> MacOS X. Apple has extensive changes. Fortunately your question is
> mostly platform independent.
>
>> steps and nexts just fine, but it never shows me my asm. I can't even
>> use
>> the disass <addr> command, because it tells me that there is not any
>> functions at that address.
>
> Right. You can use "display/i $pc" and "x/i <addr>" to show the
> assembly anyway.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: technical question on GDB for MacOS
2007-06-04 21:43 ` Jeff Roberts
@ 2007-06-05 18:01 ` Michael Snyder
2007-06-05 18:15 ` Andreas Schwab
0 siblings, 1 reply; 5+ messages in thread
From: Michael Snyder @ 2007-06-05 18:01 UTC (permalink / raw)
To: Jeff Roberts; +Cc: gdb
On Mon, 2007-06-04 at 14:42 -0700, Jeff Roberts wrote:
> > Right. You can use "display/i $pc" and "x/i <addr>" to show the
> > assembly anyway.
>
> Perfect, thank you!
Yes, the problem is that "disassemble" wants to do a whole function --
so it has to find symbols for the beginning and end of the function.
Self generated code doesn't have any symbols.
The examine /i command can take a start address and a repeat count
(number of instructions), eg "x/100i 0x1000"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: technical question on GDB for MacOS
2007-06-05 18:01 ` Michael Snyder
@ 2007-06-05 18:15 ` Andreas Schwab
0 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2007-06-05 18:15 UTC (permalink / raw)
To: Michael Snyder; +Cc: Jeff Roberts, gdb
Michael Snyder <Michael.Snyder@access-company.com> writes:
> On Mon, 2007-06-04 at 14:42 -0700, Jeff Roberts wrote:
>> > Right. You can use "display/i $pc" and "x/i <addr>" to show the
>> > assembly anyway.
>>
>> Perfect, thank you!
>
> Yes, the problem is that "disassemble" wants to do a whole function --
> so it has to find symbols for the beginning and end of the function.
disassemble also takes two arguments, using those as the bounds.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-06-05 18:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-04 3:24 technical question on GDB for MacOS Jeff Roberts
2007-06-04 10:55 ` Daniel Jacobowitz
2007-06-04 21:43 ` Jeff Roberts
2007-06-05 18:01 ` Michael Snyder
2007-06-05 18:15 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox