This is the mail archive of the
mailing list for the GDB project.
Re: How does GDB run a program (exec flavor)?
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Jeffrey Walton <noloader at gmail dot com>
- Cc: GDB Users <gdb at sourceware dot org>
- Date: Thu, 9 Jun 2011 07:32:38 -0700
- Subject: Re: How does GDB run a program (exec flavor)?
- References: <BANLkTindE7UOntiEsas=iws6_-06OOPR5A@mail.gmail.com>
> 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.
But why not use strace, for instance? Not enough?