This is the mail archive of the
mailing list for the GDB project.
Re: linux-proc readlink patch
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: gdb-patches at sources dot redhat dot com, msnyder at redhat dot com
- Date: Wed, 09 Jan 2002 15:51:19 -0500
- Subject: Re: linux-proc readlink patch
- References: <20020109151622.A842@nevyn.them.org>
> This patch:
> 2002-01-08 Michael Snyder <firstname.lastname@example.org>
> * linux-proc.c (child_pid_to_exec_file): Use readlink to get the
> real name of the executable, rather than the /proc name.
> (which I never saw posted on gdb-patches; was that an artifact of the email
> breakage yesterday?)
> seems to have at least one problem.
> (1) It introduces a memory leak, if I understand the semantics of cleanups
> correctly. make_cleanup's cleanups will only be called (according to the
> comment in utils.c) after a failed command.
Since not looking at the code is current vogue .... :-)
People use cleanups to mimic two exception behavours:
TRY ... EXCEPT ... END
you'll see a discard_cleanups()
TRY ... ALWAYS ... END
you'll see a do_cleanups ()
it was probably a forget me.
> (2) It is not, IIRC, always correct in the case of chroots. Handling for
> this has changed across Linux versions several times. On 2.2 it seems to be
> correct (to my surprise, actually), but I believe it is not on 2.0. Do we
> care? Probably not, as 2.0 is now -very- old.
I don't know if we're really that worried about mimicing old broken
kernel behavour (at least until we get a real user complaint).