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:
Alessandro Arzilli
2019-03-20 18:32:51 +01:00
committed by Derek Parker
parent 09c92c75b9
commit af1ffc8504
19 changed files with 484 additions and 3 deletions

View File

@ -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