public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Michael Eager <eager@eagerm.com>
To: Cary Coutant <ccoutant@google.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	 binutils <binutils@sourceware.org>
Subject: Re: [PATCH] Support gzip compressed exec and core files in gdb
Date: Wed, 11 Mar 2015 20:12:00 -0000	[thread overview]
Message-ID: <5500A1C0.8080702@eagerm.com> (raw)
In-Reply-To: <CAHACq4qSueTKEv++yN_AetU2oCTEiLmZLMCuJiJ6nPw8dHsO2g@mail.gmail.com>

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 <eager@eagerm.com> 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

  reply	other threads:[~2015-03-11 20:12 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 23:01 Michael Eager
2015-03-11  2:37 ` Mike Frysinger
2015-03-11 15:00   ` Michael Eager
2015-03-11  8:15 ` Alan Modra
2015-03-11 14:57   ` Michael Eager
2015-03-12  0:08     ` Alan Modra
2015-03-12  0:45       ` Michael Eager
2015-03-12  2:51         ` Alan Modra
2015-03-12 16:14           ` Michael Eager
2015-03-13  0:13             ` Alan Modra
2015-03-11 10:07 ` Gary Benson
2015-03-11 14:58   ` Michael Eager
2015-03-11 17:42     ` Gary Benson
2015-03-11 18:10       ` Doug Evans
2015-03-11 18:32         ` Gary Benson
2015-03-11 18:56           ` Doug Evans
2015-03-11 16:15 ` Eli Zaretskii
2015-03-11 19:55   ` Michael Eager
2015-03-11 20:18     ` Mike Frysinger
2015-03-11 20:24     ` Eli Zaretskii
2015-03-12 21:17       ` Sergio Durigan Junior
2015-03-13  6:04         ` Eli Zaretskii
2015-03-11 18:24 ` Cary Coutant
2015-03-11 20:12   ` Michael Eager [this message]
2015-03-11 20:19     ` Doug Evans
2015-03-11 22:13 ` Jan Kratochvil
2015-03-11 23:14   ` Doug Evans
2015-03-12 11:32     ` Jan Kratochvil
2015-03-12 15:24       ` Michael Eager
2015-03-12  0:40   ` Michael Eager
2015-03-12 11:31     ` Pedro Alves
2015-03-12 15:34       ` Michael Eager
2015-03-12 16:13         ` Pedro Alves
2015-03-12 16:58           ` Michael Eager
2015-03-12 17:11             ` Jan Kratochvil
2015-03-12 17:37               ` Michael Eager
2015-03-12 17:48                 ` Jan Kratochvil
2015-03-13  6:25               ` Ed Maste
2015-03-19  0:58 ` Michael Eager
2015-03-19  3:45   ` Eli Zaretskii
2015-03-20 22:16   ` Mike Frysinger
2015-03-27 15:26     ` Michael Eager
2015-03-28  4:49       ` Mike Frysinger
2015-03-28 16:56       ` Michael Eager
2015-04-01 12:41         ` Pedro Alves
2015-04-01 18:52           ` Michael Eager
2015-04-01 19:10             ` Pedro Alves
2015-05-01 14:40 ` Michael Eager
2015-05-01 17:53   ` Eli Zaretskii
2015-05-01 22:03     ` Michael Eager
2015-05-04  7:50       ` Mike Frysinger
2015-06-15 15:14         ` Michael Eager

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5500A1C0.8080702@eagerm.com \
    --to=eager@eagerm.com \
    --cc=binutils@sourceware.org \
    --cc=ccoutant@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).