From: Michael Eager <eager@eagerm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Pedro Alves <palves@redhat.com>, Doug Evans <dje@google.com>
Subject: Re: [PATCH] Support gzip compressed exec and core files in gdb
Date: Sat, 28 Mar 2015 16:56:00 -0000 [thread overview]
Message-ID: <5516DD31.4020901@eagerm.com> (raw)
In-Reply-To: <551576A0.3060504@eagerm.com>
On 03/27/15 08:26, Michael Eager wrote:
> Removed binutils@sourceware.org.
>
> On 03/20/15 15:16, Mike Frysinger wrote:
>> On 18 Mar 2015 17:58, Michael Eager wrote:
>>> --- a/gdb/utils.c
>>> +++ b/gdb/utils.c
>>>
>>> +#define COMPRESS_BUF_SIZE (1024*1024)
>>
>> space around the *
>>
>> would be nice to have a comment noting where the 1MiB comes from
>
> I added a comment, but the buffer size is arbitrary.
>
>>> + /* Create temporary file name for uncompressed file. */
>>> + if (!(tmpdir = getenv ("TMPDIR")))
>>> + tmpdir = "/tmp";
>>> +
>>> + if (!asprintf (&template, "%s/%s-XXXXXX", tmpdir, basename (filename)))
>>> + return 0;
>>> +
>>> + decomp_fd = mkstemp (template);
>>
>> ignoring that assigningments in if statements are frowned upon, looks like you
>> can just use make_temp_file(NULL) from libiberty
>
> Fixed assignment. make_temp_file() generates an anonymous file; I want to
> keep the user-specified file name as part of the uncompressed file name.
> (I could update libiberty to add an alternate to make_temp_file() which
> takes a basename, I guess.) I replaced getenv("TMPDIR") with choose_tmpdir()
> from libiberty.
>
>> you would also leak the fopen() handle here. probably want to go through this
>> code again looking for such leaks. and maybe try breaking the func up into more
>> utility related chunks when possible.
>
> I refactored the gdb_uncompress() function and broke it into 3 functions.
>
>> you've got more missing tabs in this file. i'm going to stop checking.
>
> I cleaned up the white space. I hope I got all the tabs this time.
>
> gdb/ChangeLog:
> * utils.c (struct compressed_file_cache_search, eq_compressed_file,
> is_gzip, decompress_gzip, do_compressed_cleanup, identify_compression,
> uncompress_to_temporary, gdb_uncompress): New.
> * utils.h (gdb_uncompress): Declare.
> * corelow.c (core_open): Uncompress core file.
> * exec.c (exec_file_attach): Uncompress exec file.
> * symfile.c (symfile_bfd_open): Uncompress sym (exec) file.
> * NEWS: Mention new functionality.
>
> gdb/doc:
> * gdb.texinfo (Files): Mention gzipped exec and core files.
>
>
> I'm not fond of whitespace patches, but there were many whitespace errors
> in these files unrelated to my patch. I've attached a second patch to clean
> this up.
>
> gdb/ChangeLog:
> * corelow.c: Replace leading whitespace with tabs, eliminate trailing blanks.
> * exec.c: Ditto.
> * symfile.c: Ditto.
> * utils.c: Ditto
> * utils.h: Ditto
Pedro, Doug -- Can you approve this patch?
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
next prev parent reply other threads:[~2015-03-28 16:56 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
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 [this message]
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=5516DD31.4020901@eagerm.com \
--to=eager@eagerm.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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