This is the mail archive of the gdb@sources.redhat.com 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]

Re: gdb: detection and/or fork+gethostbyname crash workaround?


> I'm trying to work around this bug in another program, now, where making
> a separate binary for resolving is undesirable; I want to force it to
> not fork resolves when being debugged, and do so automatically.

How about something like this:

  /* Global variable.  Do resolve by forking a child process.
     This is usually one, but you can turn it off to make debugging
     easier. */
  int g_resolve_fork = 1;

Then in your .gdbinit file, say:

  print g_resolve_fork = 0

Alternatively, you can wire up g_resolve_fork to a command line
argument or to an environment variable.  You can set an environment
variable in gdb with "set env FOO BAR", and then stash that in a
.gdbinit file.

It doesn't solve the core problem but it might be a useful
workaround.

Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"


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