summaryrefslogtreecommitdiff
path: root/src/runtime/runtime-gdb.py
Commit message (Collapse)AuthorAgeFilesLines
* runtime: fix tab/space inconsistency in runtime-gdb.pyAustin Clements2017-06-081-1/+1
| | | | | | | | Change-Id: I78c6198eb909e679cf0f776b77dda52211bfd347 Reviewed-on: https://go-review.googlesource.com/45133 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* runtime: fix GDB goroutine N command when N is runningAustin Clements2017-06-081-2/+31
| | | | | | | | | | | | | | | | | | The current implementation of "goroutine N cmd" assumes it can get goroutine N's state from the goroutine's sched buffer. But this only works if the goroutine is blocked. Extend find_goroutine so that, if there is no saved scheduler state for a goorutine, it tries to find the thread the goroutine is running on and use the thread's current register state. We also extend find_goroutine to understand saved syscall register state. Fixes #13887. Change-Id: I739008a8987471deaa4a9da918655e4042cf969b Reviewed-on: https://go-review.googlesource.com/45031 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* runtime: set $sp before $pc in gdb python scriptCherry Zhang2016-06-091-3/+3
| | | | | | | | | | | | | | | | | | | | When setting $pc, gdb does a backtrace using the current value of $sp, and it may complain if $sp does not match that $pc (although the assignment went through successfully). This happens with ARM SSA backend: when setting $pc it prints > Cannot access memory at address 0x0 As well as occasionally on MIPS64: > warning: GDB can't find the start of the function at 0xc82003fe07. > ... Setting $sp before setting $pc makes it happy. Change-Id: Idd96dbef3e9b698829da553c6d71d5b4c6d492db Reviewed-on: https://go-review.googlesource.com/23940 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Austin Clements <austin@google.com>
* runtime: Fix GDB integration with Python 2Derek Buitenhuis2015-04-101-1/+1
| | | | | | | | | | | | | | | | A similar fix was applied in 545686857bc4c2e7a5306d97e5ef48f631d277bc but another instance of 'pc' was missed. Also adds a test for the goroutine gdb command. It currently uses goroutine 2 for the test, since goroutine 1 has its stack pointer set to 0 for some reason. Change-Id: I53ca22be6952f03a862edbdebd9b5c292e0853ae Reviewed-on: https://go-review.googlesource.com/8729 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* runtime: allow pointers to strings to be printedLee Packham2015-03-301-1/+1
| | | | | | | | | | | | | | | Being able to printer pointers to strings means one will able to output the result of things like the flag library and other components that use string pointers. While here, adjusted the tests for gdb to test original string pretty printing as well as pointers to them. It was doing it via the map before but for completeness this ensures it's tested as a unit. Change-Id: I4926547ae4fa6c85ef74301e7d96d49ba4a7b0c6 Reviewed-on: https://go-review.googlesource.com/8217 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* gdb: fix map prettyprinterJan Kratochvil2015-02-251-1/+1
| | | | | | | | | | | | | (gdb) p x Python Exception <class 'gdb.error'> There is no member named b.: $2 = map[string]string -> (gdb) p x $1 = map[string]string = {["shane"] = "hansen"} Change-Id: I874d02a029f2ac9afc5ab666afb65760ec2c3177 Reviewed-on: https://go-review.googlesource.com/5522 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* gdb: fix "gdb.error: No struct named reflect.rtype."Jan Kratochvil2015-02-221-3/+1
| | | | | | | | | | | | | | | | | | | | 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>
* runtime: in runtime-gdb.py, use SliceValue wrapperAustin Clements2015-02-171-4/+4
| | | | | | | | | Rather than reaching in to slices directly in the slice pretty printer, use the newly introduced SliceValue wrapper. Change-Id: Ibb25f8c618c2ffb3fe1a8dd044bb9a6a085df5b7 Reviewed-on: https://go-review.googlesource.com/4936 Reviewed-by: Minux Ma <minux@golang.org>
* runtime: fix GDB "info goroutines" for Go 1.5Austin Clements2015-02-171-6/+34
| | | | | | | | | | | | | | | | | | "info goroutines" is failing because it hasn't kept up with changes in the 1.5 runtime. This fixes three issues preventing "info goroutines" from working. allg is no longer a linked list, so switch to using the allgs slice. The g struct's 'status' field is now called 'atomicstatus', so rename uses of 'status'. Finally, this was trying to parse str(pc) as an int, but str(pc) can return symbolic information after the raw hex value; fix this by stripping everything after the first space. This also adds a test for "info goroutines" to runtime-gdb_test, which was previously quite skeletal. Change-Id: I8ad83ee8640891cdd88ecd28dad31ed9b5833b7a Reviewed-on: https://go-review.googlesource.com/4935 Reviewed-by: Minux Ma <minux@golang.org>
* runtime: fix runtime-gdb script loadingPaul Nasrat2015-01-151-1/+1
| | | | | | | | | | | runtime.rtype was a copy of reflect.rtype - update script to use that directly. Introduces a basic test which will skip on systems without appropriate GDB. Fixes #9326 Change-Id: I6ec74e947bd2e1295492ca34b3a8c1b49315a8cb Reviewed-on: https://go-review.googlesource.com/2821 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* build: move package sources from src/pkg to srcRuss Cox2014-09-081-0/+478
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.