I'm running a Linux container via Docker on a MacBook M1 running Tahoe (macOS 26.0.1). Following the appendix for setting up GDB in the back of the book I'm using, I start by typing in GDB on the command line. Then when the GDB prompt comes up, I do file foo which is my executable file that I'm hoping to step through. The author says to then add a breakpoint to the entry point of the program, which I do with break *_start. All good so far. After that it's just a simple matter of typing run and we're good to go. It should "immediately stop and let me know that the debugging hit the breakpoint that I added." Except that when I enter run, I get this error message:
Starting program: /my-code/programs/tallest/longestname
warning: Error disabling address space randomization: Operation not permitted
Couldn't get registers: Input/output error.
Couldn't get registers: Input/output error.
If I try to run the program again it will tell me that the program is already running, and do I want to start it again. But all core functionality of the debugger is unavailable. If I try to do disassemble or info registers it just tells me Couldn't get registers: Input/output error. again.
The file in question has full permissions for the owner (-rwxr) and so that doesn't seem to be the problem, and I can't figure out what is.
warning: Error disabling address space randomization: Operation not permitted. So that's something, at least. Appreciate your taking the time to reply. Unfortunately, these input/output errors are still there, and one comes up every time I try to check the values of the registers or disassemble the executable to generate object code. No idea what to do next.