Skip to content

gdb on macOS Ventura (M2) fails  #13

@juananpe

Description

@juananpe

Hi, @simonjwright,

First of all, thank you for distributing the GCC binary tools for macOS and for documenting everything on your blog.

I'd like to continue this thread here. Using the comments section on Stack Overflow for extended discussion is quite cumbersome due to character limitations. If you'd rather discuss this elsewhere, please let me know.

I'm aware that PR24069 is a bug opened in 2019 for Intel CPUs, but it seems to affect Apple silicon laptops as well. At least, when I used your GDB build (after code-signing the binary and noting that this GDB is an x86_64 binary running under Rosetta on my M2), I encountered this bug trying to debug a trivial hello_world Ada program:

/opt/gcc-13.1.0/bin $ ./gdb /opt/adatutorial/.objs/hello_world
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin21".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /opt/adatutorial/.objs/hello_world...
(gdb) break main
Breakpoint 1 at 0x10000132f: file b__hello_world.adb, line 215.
(gdb) run
Starting program: /opt/adatutorial/.objs/hello_world
[New Thread 0x2e03 of process 2885]
[New Thread 0x3c03 of process 2885]
During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.

A comment in that bug's thread in SO suggests PR24069 might be responsible. Honestly, I can't confirm if that's the root cause, but it appears likely.

I'm still uncertain if it's currently even possible to use any debugger (be it x86_64 GDB, aarch64 GDB or LLDB) to debug Ada programs on Apple silicon. From my tests, it seems impossible at the moment.

Any comments will be very much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions