This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] Support gzip compressed exec and core files in gdb
- From: Michael Eager <eager at eagerm dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, binutils <binutils at sourceware dot org>
- Date: Wed, 11 Mar 2015 17:45:28 -0700
- Subject: Re: [PATCH] Support gzip compressed exec and core files in gdb
- Authentication-results: sourceware.org; auth=none
- References: <54FF77D6 dot 7010400 at eagerm dot com> <20150311081454 dot GK11451 at bubble dot grove dot modra dot org> <5500579E dot 50706 at eagerm dot com> <20150312000822 dot GA8533 at bubble dot grove dot modra dot org>
On 03/11/15 17:08, Alan Modra wrote:
On Wed, Mar 11, 2015 at 07:56:30AM -0700, Michael Eager wrote:
On 03/11/15 01:14, Alan Modra wrote:
On Tue, Mar 10, 2015 at 04:01:42PM -0700, Michael Eager wrote:
This operation cannot be done completely by BFD because BFD allows an opened
file to be passed to it for processing. GDB uses this functionality.
I'd prefer you do this entirely outside of BFD, without adding another
field to struct bfd. I think that can be done by simply clearing
abfd->cacheable on files you uncompress. This prevents BFD from
closing the file, so you won't need to open it again.
GDB closes the exec file, then uses BFD to seek (I think when reading
syms). BFD then re-opens the file, so it needs the name of the
Really? I think it quite unclean if gdb expects BFD to reopen a file
that gdb has closed!
GDB doesn't expect BFD to reopen the file, per se. But it does a seek
on an exec file (IIRC, while reading symbols) which it previously closed
and when BFD notices that the file is closed, it opens it. I don't think
that it is feasible to remove calls to exec_close() so this doesn't happen.
There's overlapping code between BFD and GDB. It would be much cleaner if
GDB let BFD do everything with files, and BFD had support for opening files
with additional flags like O_CLOEXEC.
Michael Eager firstname.lastname@example.org
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077