From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36026 invoked by alias); 11 Mar 2015 20:12:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 36007 invoked by uid 89); 11 Mar 2015 20:12:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: homiemail-a47.g.dreamhost.com Received: from sub5.mail.dreamhost.com (HELO homiemail-a47.g.dreamhost.com) (208.113.200.129) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Mar 2015 20:12:50 +0000 Received: from homiemail-a47.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a47.g.dreamhost.com (Postfix) with ESMTP id 178EC28406C; Wed, 11 Mar 2015 13:12:49 -0700 (PDT) Received: from redwood.eagercon.com (c-24-7-16-38.hsd1.ca.comcast.net [24.7.16.38]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eager@eagerm.com) by homiemail-a47.g.dreamhost.com (Postfix) with ESMTPSA id E59C628405C; Wed, 11 Mar 2015 13:12:48 -0700 (PDT) Message-ID: <5500A1C0.8080702@eagerm.com> Date: Wed, 11 Mar 2015 20:12:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Cary Coutant CC: "gdb-patches@sourceware.org" , binutils Subject: Re: [PATCH] Support gzip compressed exec and core files in gdb References: <54FF77D6.7010400@eagerm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00320.txt.bz2 On 03/11/15 11:24, Cary Coutant wrote: > How will this affect split DWARF? > > If you uncompress a foo.gz binary, and the binary has relative paths > to .dwo files, will GDB look for the .dwo files relative to the > original binary, or to the uncompressed binary? GDB should look for .dwo files relative to the original file. The uncompressed file is essentially hidden. If you can send me a test case creating .dwo files, I'll make sure that it works. > When it looks for a .dwp file, will it look for foo.dwp or foo.gz.dwp, > and will it look in the same directory as the original, or in /tmp? > > If foo.dwp is also compressed, will it uncompress that? The file search for exec and core are unchanged, so gdb will find whatever file it is asked to look for, using the current search path, exactly as it does now. No file names are modified. There's specific code to uncompress exec and core files. I might need to add code for dwp. I originally looked at doing decompression in BFD, so that it would simply be transparent. If a component opened a gzipped file, BFD would transparently decompress it. This didn't work. GDB does some file operations, like closing and reopening files, which I think should be done in BFD. > Would it make sense to support .tar.gz/.tgz files containing both a > binary and its .dwp? Perhaps, but I don't want to extend this (conceptually) simple extension to also handling tar files. Maybe as a follow-on. > > -cary > > > > On Tue, Mar 10, 2015 at 4:01 PM, Michael Eager wrote: >> Add support to automatically unzip compressed executable and core files. >> Files will be uncompressed into temporary directory (/tmp or $TMPDIR) >> and are deleted when GDB exits. This should be transparent to users, >> except for disk space requirements. The name of the uncompressed file is >> mentioned, but all references to the file in GDB messages is to the file >> which the user specified. >> >> 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. >> >> BFD: >> * bfd-in2.h: Regenerate. >> * bfd.c (struct bfd): Add uncompressed_filename. >> * bfdio.c (bfd_get_mtime): Set bfd->mtime_set to true. >> * cache.c (bfd_open): Open previously created uncompressed file. >> >> GDB: >> * common/filestuff.c (struct compressed_file_cache_search, >> eq_compressed_file, >> is_gzip, decompress_gzip, do_compressed_cleanup, gdb_uncompress): New. >> * common/filestuff.h (gdb_uncompress): Declare. >> * corelow.c (core_open): Uncompress core file. >> * exec.c (exec_file_attach): Uncompress exe file. >> * symfile.c (symfile_bfd_open): Uncompress sym (exe) file. >> >> GDB/DOC: >> * gdb.texinfo: Mention gzipped exec and core files. >> >> -- >> Michael Eager eager@eagercon.com >> 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077 > -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077