From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 89EF33858C31; Thu, 16 Feb 2023 02:55:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89EF33858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676516103; bh=oCHWwW93W7ihPC/7PJYUxtgAcIB+eXN5Srb9dehN+Ak=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PnGzZfR91sXbzrEC/5XppmTty4798uvzT+MKsbwbJqXVW9ZuYwrQNdmejqDDGl3md u5RSB9xyO80CRF76zUULhwEV5DCpacTr5EuvtcxMCoSDpVWxp6rctZTl8Zv7tCQGio 0AKFbl2C5uJjA3oCxnkNAMAP34xBPiLJlGlfEW5M= From: "i at maskray dot me" To: gdb-prs@sourceware.org Subject: [Bug gdb/29584] gdb: support zstd compressed .gnu_debugdata Date: Thu, 16 Feb 2023 02:55:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: i at maskray dot me X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29584 --- Comment #1 from Fangrui Song --- 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=3D.gnu_debugdata=3Da.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=3D.gnu_debugdata=3Da.debug.zstd a a.stripped --=20 You are receiving this mail because: You are on the CC list for the bug.=