mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +08:00
service,terminal: when libraries don't have debug_info print reason (#3419)
Print the reason why libraries don't have debug info in response to the 'libraries' command.
This commit is contained in:
committed by
GitHub
parent
d006538bb6
commit
95dac8f19b
@ -2547,6 +2547,9 @@ func libraries(t *Term, ctx callContext, args string) error {
|
||||
d := digits(len(libs))
|
||||
for i := range libs {
|
||||
fmt.Fprintf(t.stdout, "%"+strconv.Itoa(d)+"d. %#x %s\n", i, libs[i].Address, libs[i].Path)
|
||||
if libs[i].LoadError != "" {
|
||||
fmt.Fprintf(t.stdout, " Load error: %s", libs[i].LoadError)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -431,7 +431,12 @@ func ConvertRegisters(in *op.DwarfRegisters, dwarfRegisterToString func(int, *op
|
||||
|
||||
// ConvertImage converts proc.Image to api.Image.
|
||||
func ConvertImage(image *proc.Image) Image {
|
||||
return Image{Path: image.Path, Address: image.StaticBase}
|
||||
err := image.LoadError()
|
||||
lerr := ""
|
||||
if err != nil {
|
||||
lerr = err.Error()
|
||||
}
|
||||
return Image{Path: image.Path, Address: image.StaticBase, LoadError: lerr}
|
||||
}
|
||||
|
||||
// ConvertDumpState converts proc.DumpState to api.DumpState.
|
||||
|
||||
@ -571,8 +571,9 @@ type Checkpoint struct {
|
||||
|
||||
// Image represents a loaded shared object (go plugin or shared library)
|
||||
type Image struct {
|
||||
Path string
|
||||
Address uint64
|
||||
Path string
|
||||
Address uint64
|
||||
LoadError string
|
||||
}
|
||||
|
||||
// Ancestor represents a goroutine ancestor
|
||||
|
||||
Reference in New Issue
Block a user