mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 18:27:37 +08:00
proc,proc/native,proc/gdbserial: initial plugin support (#1413)
Adds initial support for plugins, this is only the code needed to keep track of loaded plugins on linux (both native and gdbserial backend). It does not actually implement support for debugging plugins on linux. Updates #865
This commit is contained in:
committed by
Derek Parker
parent
09c92c75b9
commit
af1ffc8504
@ -343,6 +343,7 @@ Defines <alias> as an alias to <command> or removes an alias.`},
|
||||
edit [locspec]
|
||||
|
||||
If locspec is omitted edit will open the current source file in the editor, otherwise it will open the specified location.`},
|
||||
{aliases: []string{"libraries"}, cmdFn: libraries, helpMsg: `List loaded dynamic libraries`},
|
||||
}
|
||||
|
||||
if client == nil || client.Recorded() {
|
||||
@ -1581,6 +1582,18 @@ func disassCommand(t *Term, ctx callContext, args string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func libraries(t *Term, ctx callContext, args string) error {
|
||||
libs, err := t.client.ListDynamicLibraries()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d := digits(len(libs))
|
||||
for i := range libs {
|
||||
fmt.Printf("%"+strconv.Itoa(d)+"d. %s\n", i, libs[i].Path)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func digits(n int) int {
|
||||
if n <= 0 {
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user