Opened 6 years ago

Closed 5 years ago

#57864 closed defect (fixed)

gdb "unknown load command 0x32"

Reported by: platipodium (Carsten Lemmen) Owned by: saagarjha (Saagar Jha)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc:
Port: gdb

Description

On a fresh MacPorts installation of gdb (and after code signing), I get on all executables on my system the following message

$> /opt/local/bin/gdb
(gdb) file /opt/local/bin/file
BFD: /opt/local/bin/file: unknown load command 0x32
BFD: /opt/local/bin/file: unknown load command 0x32
"/opt/local/bin/file": not in executable format: File format not recognized

Change History (11)

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Keywords: unknown load command removed

comment:2 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

I guess that version of gdb is too old to analyze files compiled by whatever new version of clang you're using.

Have you considered using lldb instead of gdb?

comment:3 Changed 6 years ago by platipodium (Carsten Lemmen)

OK, thanks. But many of the files (also those compiled outside of ports) where compiled with gcc-8.2, even those give the same error. I will try lldb for debugging.

comment:4 Changed 6 years ago by jmroot (Joshua Root)

Could you give any details about your system?

comment:5 Changed 6 years ago by kencu (Ken)

our gdb is outdated (8.0.1), and the newer gdb 8.2.1 seems to support that load command, looking through the code in bfd.

comment:6 Changed 6 years ago by kencu (Ken)

gdb built cleanly for me on 10.6.8, and installs without error. I'll push up a PR to run a build on the CI system, and if that goes through, we can update it.

comment:7 Changed 6 years ago by kencu (Ken)

Carsten, after the update to gdb rolls down the pipeline, try updating to the latest version and see if that solves your issue. If so, we can close this ticket (and perhaps a bunch of other open gdb tickets I see in the pipeline).

comment:8 in reply to:  4 Changed 6 years ago by platipodium (Carsten Lemmen)

Replying to jmroot:

Could you give any details about your system?

Sure, up to date Mac OX 10.14 system

Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64MacBook-sugarglider:code lemmen
$ /usr/bin/clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
Last edited 6 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:9 in reply to:  2 Changed 6 years ago by platipodium (Carsten Lemmen)

Replying to ryandesign:

I guess that version of gdb is too old to analyze files compiled by whatever new version of clang you're using.

Have you considered using lldb instead of gdb?

I can confirm that lldb is working on my system

comment:10 Changed 6 years ago by zap150 (Jan Zapletal)

I still get the same error with gdb 8.2.1 and Mojave. According to https://sourceware.org/bugzilla/show_bug.cgi?id=23728, a patch fixing this issue should be a part of gdb 8.3. Is it possible to update the version available via macports?

Jan

comment:11 Changed 5 years ago by saagarjha (Saagar Jha)

Owner: set to saagarjha
Resolution: fixed
Status: newclosed

In 0375c287829ea236d48db376c210bdbbc5bf1176/macports-ports (master):

gdb: Update to 8.3

Remove patch-gdb-aarch64-linux-tdep.c.diff because it's been merged in upstream.

Closes: #57864

Note: See TracTickets for help on using tickets.