gdb's run command fails on Mac OS 10.5

703 views
Skip to first unread message

Simon Liedtke

unread,
Mar 30, 2012, 2:17:05 PM3/30/12
to golan...@googlegroups.com
I installed gdb 7.3 via macports. When trying to call the run command within a gdb-session which loaded a simple HelloWorld program, the following error message appears: “Error calling thread_get_state for GP registers for thread 0x4867lxwarning: Mach error at "i386-darwin-nat.c:119" in function "i386_darwin_fetch_inferior_registers": (os/kern) invalid argument (0x4)
darwin_set_sstep: unknown flavour: 4


The content of hello.go:

package main

func main() {
println("Hello World!")
}


 I then used the command "go tool 6g hello.go && go tool 6l hello.6" to create the binary 6.out and called "gdb 6.out" to debug it. Here's the complete gdb session: http://paste.pocoo.org/show/573738/

What does this error message mean and how can I fix it? Go version is: weekly.2012-03-27 +2e68ba67a644

Kyle Lemons

unread,
Mar 30, 2012, 2:24:38 PM3/30/12
to Simon Liedtke, golan...@googlegroups.com
Running gdb usually pops up a dialog that asks me to "ante up" as an admin.  Does this happen for you?  There are some weirdnesses debugging and profiling on os x because of permissions of various things.
Go 1 is out!

minux

unread,
Mar 30, 2012, 2:34:17 PM3/30/12
to Simon Liedtke, golan...@googlegroups.com
try this:
sudo chgrp procmod /path/to/your/gdb73
sudo chmod g+s /path/to/your/gdb73

And then try again. I also encounter problem where the gdb installed macports doesn't work, but
the gdb 7.3 compiled from vanilla source by myself works well.

Also, note that Go doesn't support Mac OS 10.5 now.

Simon Liedtke

unread,
Mar 30, 2012, 3:03:02 PM3/30/12
to golan...@googlegroups.com, Simon Liedtke
Thanks for the advice, will try it out later and tell if it worked.

Simon Liedtke

unread,
Mar 31, 2012, 10:17:32 AM3/31/12
to golan...@googlegroups.com, Simon Liedtke
Gaaah, didn't change anything at all :(

Simon Liedtke

unread,
Apr 23, 2012, 1:36:36 PM4/23/12
to golan...@googlegroups.com
I works now, I think the reason is that I used the wrong gdb binary: If I install gdb via macports, the binary ggdb (with two g's) is located in /opt/local/bin.

Simon Liedtke

unread,
Apr 23, 2012, 1:42:12 PM4/23/12
to golan...@googlegroups.com
unfortunately, no. The run command still gives this weird error message:

(gdb) run
Starting program: /Users/simon/go/6.out 
Error calling thread_get_state for GP registers for thread 0x4867lxwarning: Mach error at "i386-darwin-nat.c:119" in function "i386_darwin_fetch_inferior_registers": (os/kern) invalid argument (0x4)
darwin_set_sstep: unknown flavour: 4

I should buy a laptop with linux on it, can't wait to be a student to get the benefits.
Reply all
Reply to author
Forward
0 new messages