From owner-freebsd-hackers Fri Jun 4 21:46:15 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from peterw.yahoo.com (peterw.yahoo.com [206.132.89.237]) by hub.freebsd.org (Postfix) with ESMTP id 4B9E414DDF for ; Fri, 4 Jun 1999 21:46:11 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost.yahoo.com [127.0.0.1]) by peterw.yahoo.com (8.9.3/8.9.2) with ESMTP id VAA04735; Fri, 4 Jun 1999 21:44:53 -0700 (PDT) (envelope-from peter@netplex.com.au) Message-Id: <199906050444.VAA04735@peterw.yahoo.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Marc Tardif Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: disassembling execve (fwd) In-reply-to: Your message of "Sat, 05 Jun 1999 00:26:00 EDT." Date: Fri, 04 Jun 1999 21:44:53 -0700 From: Peter Wemm Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Marc Tardif wrote: > How can I disassemble the execve syscall? [..] > ... using the following command: > gcc -o program -ggdb -static program.c > ... followed by: > disassemble main > disassemble execve > > The gcc manpage specifies that "on systems that support dynamic linking, > this prevents linking with the shared libraries" regarding the -static > flag. I've noted changes when using 'disassemble main' and using the > -static flag, so it seems FreeBSD is among such systems. Yet, when running > disassemble execve (which is what appears in the main disassembly), I get: > "No function contains the specified address." > > Well, I'm stumped, I can't find any way to disassemble execve. Please let > me know if there's a way, the above procedure apparently works on linux > platforms, though execve will appear as __execve in the main disassembly. Hmm, it works for me... (gdb) disassemble execve Dump of assembler code for function _execve: 0x80481d8 <_execve>: leal 0x3b,%eax 0x80481de <_execve+6>: int $0x80 0x80481e0 <_execve+8>: jb 0x80481d0 0x80481e2 <_execve+10>: ret 0x80481e3 <_execve+11>: nop End of assembler dump. In this particular case, the jb reference is to cerror for setting errno. Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message