* disassemble on Linux x64
[not found] <293b12a20705031255u1d211aa3hec1c464566d16b1f@mail.gmail.com>
@ 2007-05-03 19:57 ` jj shen
2007-05-03 20:10 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: jj shen @ 2007-05-03 19:57 UTC (permalink / raw)
To: gdb
Hi,
I try to disassemble a simple program on x64 Linux using GDB.
The test program is like:
> main()
> {
> getuid();
> }
"disassemble main" shows that getuid() corresponds to "callq addr".
But when I try to "disassemble getuid" or "disassemble addr", GDB says
it is not a vaild function address.
Why, while it is ok on x86 Linux? Is callq a new instruction added by
x86-64? What is the difference to the call instruction?
Another question: do I need to use a 32-bit GDB to debug 32-bit program?
Thanks,
Shen
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: disassemble on Linux x64
2007-05-03 19:57 ` disassemble on Linux x64 jj shen
@ 2007-05-03 20:10 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-05-03 20:10 UTC (permalink / raw)
To: jj shen; +Cc: gdb
On Fri, May 04, 2007 at 03:57:11AM +0800, jj shen wrote:
> "disassemble main" shows that getuid() corresponds to "callq addr".
> But when I try to "disassemble getuid" or "disassemble addr", GDB says
> it is not a vaild function address.
Start the program running first. Those functions are in shared
libraries. You may be seeing the PLT entry.
> Is callq a new instruction added by x86-64? What is the difference
> to the call instruction?
Roughly nothing.
> Another question: do I need to use a 32-bit GDB to debug 32-bit program?
No.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-05-03 20:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <293b12a20705031255u1d211aa3hec1c464566d16b1f@mail.gmail.com>
2007-05-03 19:57 ` disassemble on Linux x64 jj shen
2007-05-03 20:10 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox