Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service,terminal: when libraries don't have debug_info print reason #3419

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/terminal/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 6 additions & 1 deletion service/api/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions service/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down