Bryce Devoe
Bryce Devoe

Reputation: 35

Gdb run creating a hanging thread

I'm trying to use gdb version 9.2 to debug a C++ file on Mac OS 10.15. The file I'm debugging is simply a cout statement in the main method.

Within gdb, when I try and 'run' a file, I get something like: [New Thread 0x2741 of process 24251] instead of the actual output or step by step, as the program proceeds to just hang there.

A seemingly unrelated error that might be causing this is that when loading a file the error "unknown command 0x34" appears several times but gdb can still run.

I've seen several other posts about this error, but no actual answers.

I have setup the code cert for gdb.

Also, I can't avoid this issue by not using gdb.

Upvotes: 1

Views: 790

Answers (2)

Wenun Xiao
Wenun Xiao

Reputation: 11

run gdb with sudo works for me

Upvotes: 1

Bryce Devoe
Bryce Devoe

Reputation: 35

So here is the solution I found:

run brew uninstall --force gdb

This is so you avoid issues from things you tried before.

Then follow the instructions from the next link, ignoring the part about getting the right source, brew now selects a working version at the moment. I am unsure about the gcc stuff, I didn't do that section either.

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

It should work on MacOS 10.15.

Basically, your output will appear sometimes, and the thread will wait other times.

Upvotes: 0

Related Questions