Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ojfd

macrumors 6502
Original poster
Oct 20, 2020
314
216
Does anyone here have successfully installed and have working gdb-apple from MacPorts on High Sierra?
I'm running in circles for the 4th hour with no success whatsoever. I've tried every suggestion that I was able to google, but still end up with "Unable to find Mach task port for process-id xxx: (os/kern) failure (0x5)" :(
 

ojfd

macrumors 6502
Original poster
Oct 20, 2020
314
216
Well, I've tried everything possible.

This: https://gist.github.com/danisfermi/17d6c0078a2fd4c6ee818c954d2de13c

and this: https://timnash.co.uk/getting-gdb-to-semi-reliably-work-on-mojave-macos/

Invested ~ 8 hours in it and there's still no go. Stiil the same result. :(

Note. I'm trying to install gdb-apple That's the port of old GNU gdb 6.3.50 from here:
not the latest gdb https://ports.macports.org/port/gdb/

In contrast to newer gdb, the older version plays nicely with gdbinit by https://reverse.put.as/
I have it working without problems in Yosemite, but in High Sierra I've met with some kind of resistance or compatibility problems, hence my initial post.
 
Last edited:

f54da

macrumors 6502
Dec 22, 2021
344
128
Almost certainly related to codesigning/entitlement for task_for_pid. You mentioned you already tried adding entitlement though, so I'm not sure... seems like it might be less effort to forward-port gdbinit? Fwiw there's also lldbinit some other guys made.
 
  • Like
Reactions: casperes1996

ojfd

macrumors 6502
Original poster
Oct 20, 2020
314
216
All I wanted to do is quickly check where and maybe why one particular app crashes with SIGABORT in High Sierra. I certainly don't want to start learning lldb or porting something. I give up for the time being.
 

f54da

macrumors 6502
Dec 22, 2021
344
128
Isn't using lldb the quickest option if that's all you need? Just run it under lldb, then after it halts do a "bt" and you get a backtrace. Here's a page that gives you lldb equivalent of gdb commands https://lldb.llvm.org/use/map.html. LLDB's objective-c support is also probably more robust than gdb's so separately it's worth learning for that on its own.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.