public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "i at maskray dot me" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/29584] gdb: support zstd compressed .gnu_debugdata
Date: Thu, 16 Feb 2023 02:55:02 +0000	[thread overview]
Message-ID: <bug-29584-4717-oWaIiyTJL7@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29584-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29584

--- Comment #1 from Fangrui Song <i at maskray dot me> ---
If this is a good idea, can we get an agreement about the format even if the
actual implementation may take a while?

xz compressed .gnu_debugdata can be used this way:

objcopy --only-keep-debug a a.debug
xz a.debug
objcopy -S --add-section=.gnu_debugdata=a.debug.xz a a.stripped

The data has a header magic of 0xFD, '7', 'z', 'X', 'Z', 0x00.

I suggest that if the first 4 bytes are little-endian value 0xFD2FB528 (zstd
header), than interpret .gnu_debugdata as zstd compressed, i.e.:

objcopy --only-keep-debug a a.debug
zstd a.debug
objcopy -S --add-section=.gnu_debugdata=a.debug.zstd a a.stripped

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-02-16  2:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  4:24 [Bug gdb/29584] New: " i at maskray dot me
2022-09-19  4:24 ` [Bug gdb/29584] " i at maskray dot me
2022-09-27  2:54 ` i at maskray dot me
2023-02-16  2:55 ` i at maskray dot me [this message]
2023-02-16  6:15 ` tromey at sourceware dot org
2023-02-16  6:25 ` i at maskray dot me
2023-02-16  9:08 ` mark at klomp dot org
2023-02-16 17:42 ` i at maskray dot me
2023-02-16 21:46 ` tromey at sourceware dot org
2023-02-19 13:23 ` mark at klomp dot org
2023-02-19 19:24 ` i at maskray dot me
2024-03-15  9:16 ` sam at gentoo dot org

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=bug-29584-4717-oWaIiyTJL7@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).