|author||Jordan Lewis <firstname.lastname@example.org>||Sat Mar 26 00:42:25 2022 +0000|
|committer||Dominik Honnef <email@example.com>||Sun Apr 03 17:08:28 2022 +0000|
gocore: bugfix to Go 1.17 cores, Go 1.16 cores and Go 1.11+ cores This CL fixes several bugs in `gocore`, the library that `viewcore` uses to parse a core dump, as well as adds general updates for the more recent Go versions. First, we fix _func types for Go 1.16. In 1.16, the types of a few fields in _func were changed. This commit makes the corresponding change to gocore. This is the commit the changed the field types: CL 248332. Additionally, we updated the func parsing to deal with the new split pclntab. Previously, the code that deserialized the heapArena.bitmap field to check whether addresses contained pointers or not was incorrect. It was treating the entire bitmap as 1 bit per pointer. However, that is not what the bitmap represents. Each byte in the bitmap is actually split in half. The high bits contain the 4 scan bits. And the low bits contain the 4 pointer bits. See https://github.com/golang/go/blob/3b304ce7fe35b9d1e8cf0b0518ed2550c361a010/src/runtime/mbitmap.go#L17-L35 for a more detailed description. This commit corrects the issue and allows gocore to correctly traverse the object graph. Finally, for Go 1.17, we stop subtracting the heap unallocated space represented by curArena from the total size of the heap. This reflects the change that was made in CL 270537. Also, a few incidental fixes: - Stop thrashing the viewcore cache on the first command in interactive mode. - Synthesize types for 0-size arrays in structs Change-Id: Ia1636932d7c6c59bbd640f6b5b00b221369fed44 GitHub-Last-Rev: c66ea5a6d246f1f5f089a49824a91d34ebab5279 GitHub-Pull-Request: golang/debug#7 Reviewed-on: https://go-review.googlesource.com/c/debug/+/321736 Trust: Cherry Mui <firstname.lastname@example.org> Trust: Daniel Martí <email@example.com> Reviewed-by: Keith Randall <firstname.lastname@example.org> Run-TryBot: Dmitri Shuralyov <email@example.com> TryBot-Result: Gopher Robot <firstname.lastname@example.org>
This repository holds utilities and libraries for debugging Go programs.
WARNING! Please expect breaking changes and unstable APIs. Most of them are currently are at an early, experimental stage.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the debug repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/debug:” in the subject line, so it is easy to find.