1
0
mirror of https://github.com/golang/go synced 2024-11-05 12:06:15 -07:00

gdb: fix "gdb.error: No struct named reflect.rtype."

With a trivial Golang-built program loaded in gdb-7.8.90.20150214-7.fc23.x86_64
I get this error:

(gdb) source ./src/runtime/runtime-gdb.py
Loading Go Runtime support.
Traceback (most recent call last):
  File "./src/runtime/runtime-gdb.py", line 230, in <module>
    _rctp_type = gdb.lookup_type("struct reflect.rtype").pointer()
gdb.error: No struct type named reflect.rtype.
(gdb) q

No matter if this struct should or should not be in every Golang-built binary
this change should fix that with no disadvantages.

Change-Id: I0c490d3c9bbe93c65a2183b41bfbdc0c0f405bd1
Reviewed-on: https://go-review.googlesource.com/5521
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Jan Kratochvil 2015-02-21 17:35:01 +01:00 committed by Ian Lance Taylor
parent 4e408e0cc9
commit 02d80b9e93

View File

@ -227,8 +227,6 @@ def lookup_type(name):
except gdb.error:
pass
_rctp_type = gdb.lookup_type("struct reflect.rtype").pointer()
def iface_commontype(obj):
if is_iface(obj):
@ -238,7 +236,7 @@ def iface_commontype(obj):
else:
return
return go_type_ptr.cast(_rctp_type).dereference()
return go_type_ptr.cast(gdb.lookup_type("struct reflect.rtype").pointer()).dereference()
def iface_dtype(obj):