This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Relocate phdr in read_program_header
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Aleksandar Ristovski <aristovski at qnx dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 18 Oct 2011 15:31:59 +0200
- Subject: Re: [patch] Relocate phdr in read_program_header
- References: <j655em$75r$1@dough.gmane.org> <20111016192157.GA619@host1.jankratochvil.net> <4E9C5734.4000609@qnx.com>
On Mon, 17 Oct 2011 18:26:28 +0200, Aleksandar Ristovski wrote:
> I was contemplating a testcase but I couldn't think of a trick to
> "make" gdb not find the executable... Thanks for the test.
The testcase of mine has a problem it will stop working in future.
[patch] Attach to running but deleted executable
http://sourceware.org/ml/gdb-patches/2010-03/msg00950.html
The problem is the patch above is not so useful as it still does not work for
deleted libraries, there was discussed some Linux kernel support like
/proc/PID/mappedfileshandlesdirectory/ but it probably has not happened yet.
Anyway one could also use gdbserver - which is probably the case your fix
targets IIUC, the testcase will regress with a fix like above.
> <date> Aleksandar Ristovski <aristovski@qnx.com>
>
> * solib-svr4.c (read_program_header): New variable pt_phdr,
> initialize
> it from target PT_PHDR p_vaddr, relocate sect_addr by it.
There should be now two new variables pt_phdr and pt_phdr_p. :-)
OK with that ChangeLog change in a single commit with my testcase.
Thanks,
Jan