That <code>struct hchan<*testing.T></code> is the runtime-internal representation of a channel. It is currently empty, or gdb would have pretty-printed it's contents.
That <code>struct hchan<*testing.T></code> is the runtime-internal representation of a channel. It is currently empty, or gdb would have pretty-printed it's contents.
</p>
<p>
...
...
@@ -384,7 +386,7 @@ We can step into the <code>String</code>function call with <code>"s"</code>:
<pre>
(gdb) <b>s</b>
regexp.(*Regexp).String (re=0xf84068d070, noname=void) at /home/lvd/g/src/pkg/regexp/regexp.go:97
regexp.(*Regexp).String (re=0xf84068d070, noname=void) at /home/user/go/src/pkg/regexp/regexp.go:97
97 func (re *Regexp) String() string {
</pre>
...
...
@@ -394,14 +396,13 @@ Get a stack trace to see where we are:
#1 0x0000000000425615 in regexp.TestFind (t=0xf840688b60)
at /home/lvd/g/src/pkg/regexp/find_test.go:151
at /home/user/go/src/pkg/regexp/find_test.go:151
#2 0x0000000000430233 in testing.tRunner (t=0xf840688b60, test=0x5747b8)
at /home/lvd/g/src/pkg/testing/testing.go:156
#3 0x000000000040ea6f in runtime.initdone () at /home/lvd/g/src/pkg/runtime/proc.c:243
at /home/user/go/src/pkg/testing/testing.go:156
#3 0x000000000040ea6f in runtime.initdone () at /home/user/go/src/pkg/runtime/proc.c:243
....
</pre>
...
...
@@ -442,7 +443,7 @@ you can look inside the runtime representation to do that (tab completion helps
(gdb) <b>p slc</b>
$11 = []int = {0, 0}
(gdb) <b>p slc-></b><i><TAB></i>
(gdb) <b>p slc-></b><i><TAB></i>
array slc len
(gdb) <b>p slc->array</b>
$12 = (int *) 0xf84057af00
...
...
@@ -463,7 +464,7 @@ $24 = 4
</pre>
<p>
Channels and maps are 'reference' types, which gdb shows as pointers to C++-like types <code>hash<int,string>*</code>. Dereferencing will trigger prettyprinting
Channels and maps are 'reference' types, which gdb shows as pointers to C++-like types <code>hash<int,string>*</code>. Dereferencing will trigger prettyprinting