This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How does GDB run a program (exec flavor)?


On Thu, Jun 9, 2011 at 10:32 AM, Joel Brobecker <brobecker@adacore.com> wrote:
>> I've trying to ptrace a program for a quick-and-dirty audit. When I
>> start the program with execl(), the program faults. When I run the
>> same program under GDB, the program executes. So I'm guessing that I'm
>> not using the proper exec, or I'm using incorrect arguments to exec.
>
> Most of the time, we use vfork. ?We also have an extra layer, because
> we exec a shell that itself execs into our program. See
> gdb/fork-child.c:fork_inferior in the GDB sources.
Thanks Joel. I took a look at Apple's implementation and tweaks (Mac
OSX). It was helpful, but I'm still missing something.

> But why not use strace, for instance? Not enough?
Missing both `strace` and `ktrace`.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]