conda-forge / gdb-feedstock

A conda-smithy repository for gdb.
BSD 3-Clause "New" or "Revised" License
17 stars 62 forks source link

MacOS codesiging GDB not working #68

Open bradbell opened 9 months ago

bradbell commented 9 months ago

Solution to issue cannot be found in the documentation.

Issue

The output below are the details that reproduce my problem. Note that I am following the instructions generated by

macos-show-caveats.sh

I tried removing gdb and its codesign (using conda and the Keychain Access progam), but the problem just repeated itself.

I tried exiting gdb and re-running it many times and got the same result.

(base) cppad.git>which gdb
/Users/bradbell/miniconda/bin/gdb

(base) cppad.git>xcode-select --install
xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates

(base) ~>macos-codesign-gdb.sh
Generating and installing gdb_codesign certificate
Password:
YES (0)
YES (0)
YES (0)
/Users/bradbell/miniconda/bin/gdb: replacing existing signature

base) cppad.git>gdb test_one.exe
GNU gdb (GDB) 12.1

... snip ...

Reading symbols from test_one.exe...
Reading symbols from /Users/bradbell/repo/cppad.git/test_one.exe.dSYM/Contents/Resources/DWARF/test_one.exe...

(gdb) run
Starting program: /Users/bradbell/repo/cppad.git/test_one.exe 
Unable to find Mach task port for process-id 98045: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

Installed packages

# packages in environment at /Users/bradbell/miniconda:
#
# Name                    Version                   Build  Channel
archspec                  0.2.1              pyhd3eb1b0_0
boltons                   23.0.0          py311hecd8cb5_0
brotli-python             1.0.9           py311hcec6c5f_7
bzip2                     1.0.8                h1de35cc_0
c-ares                    1.19.1               h6c40b1e_0
ca-certificates           2023.12.12           hecd8cb5_0
certifi                   2023.11.17      py311hecd8cb5_0
cffi                      1.16.0          py311h6c40b1e_0
charset-normalizer        2.0.4              pyhd3eb1b0_0
cmake                     3.26.4               hbb7d193_0
conda                     23.11.0         py311hecd8cb5_0
conda-content-trust       0.2.0           py311hecd8cb5_0
conda-libmamba-solver     23.12.0            pyhd3eb1b0_1
conda-package-handling    2.2.0           py311hecd8cb5_0
conda-package-streaming   0.9.0           py311hecd8cb5_0
cryptography              41.0.7          py311h30e54ef_0
distro                    1.8.0           py311hecd8cb5_0
expat                     2.5.0                hcec6c5f_0
fmt                       9.1.0                ha357a0b_0
gdb                       12.1            py311hb54940f_0    conda-forge
gmp                       6.2.1                he9d5cce_3
"temp" 87L, 5246B

Environment info

MacBook Pro
Chip: Apple M1 Pro
MacOS: Sonoma 14.2.1

(base) cppad.git>uname -a
Darwin bradbell-YJ9MWG707F 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
phil-blain commented 7 months ago

Hi,

You are on a M1 Mac. GDB does not support this platform. I'm guessing you it (or your whole conda installation) is an x86-64 version and is running in Rosetta ?

Either case, I don't think this use case can work.

You'll have better luck with LLDB for debugging on that platform.

Cheers!