Comments (3)
Thanks, I was just able to reproduce this locally. Looks like an issue with cgo enabled programs (in your example, include net/http enables cgo).
I'll investigate this.
from delve.
My friend and I hit this issue and debugged through it. At least for all the cases we hit (both for 'info vars' and 'info locals') the underlying issue was always that it was drilling into an array of strings. And it would blow up when one of the strings was nil (length == 0, ptr == 0). The fix or workaround I used in my own copy of Delve is pretty straightforward. Basically just return the empty string "" out of readString, rather than attempting to dereference a null pointer and construct a string struct at that bogus address. I'm happy to generate a pull request if you like. But I'm not (yet) set up to run tests with Delve so it might be a few days before I can get around to it. What would you like me to do?
diff --git a/proctl/variables.go b/proctl/variables.go
index 4554bc4..f0735bf 100644
--- a/proctl/variables.go
+++ b/proctl/variables.go
@@ -693,6 +693,10 @@ func (thread *ThreadContext) readString(addr uintptr) (string, error) {
}
addr = uintptr(binary.LittleEndian.Uint64(val))
-
if addr == 0 {
-
return "", err
-
}
-
val, err = thread.readMemory(addr, strlen) if err != nil { return "", err
from delve.
@bforsyth927 that looks like a pretty reasonable patch. If you submit a PR I'll merge it in.
from delve.
Related Issues (20)
- Add installation note that build requires CGO
- golang cannot debug HOT 2
- [BUG]Unable to perform single-step debugging HOT 11
- panic incorrectly attributed to wrong line
- "not an executable file" when exec an exe file which has been modified by UpdateResourceA API HOT 5
- "empty OP stack" for values running `dlv test` HOT 9
- Breakpoint ignored due to "protocol error E09 during set breakpoint for packet" error HOT 2
- Unpredictable debugger link error HOT 2
- (*LineTable).funcName() causes panic: runtime error: slice bounds out of range [795306342:43562440] HOT 3
- debug with dlv can't continue on panics+defer recover properly HOT 1
- feature request: option to disable unrecovered panic breakpoint HOT 2
- Feature request: Make it possible to listen on a Unix Domain Socket HOT 1
- unix domain sockets only work in headless mode without --continue flag
- Highlight (new) AGPL (Affero General Public License dependency go-delve/gore HOT 3
- layer=dap runtime error: protocol error E32 during register write for packet $P10 HOT 7
- RR chaos mode HOT 8
- upstream "cmd/compile: move runtime.itab to internal/abi.ITab" causes Delve to no longer print variables HOT 4
- Printing a slice at non-0 base shows wrong "more" HOT 4
- Delve unable to launch process in Neovim or Command Line on M3 Apple Silicon HOT 4
- Debug Excessively Slow Stepping Through Code HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delve.