diff options
Diffstat (limited to 'libdwfl/argp-std.c')
| -rw-r--r-- | libdwfl/argp-std.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c index cf178eee..3a2d2a59 100644 --- a/libdwfl/argp-std.c +++ b/libdwfl/argp-std.c @@ -170,6 +170,11 @@ parse_opt (int key, char *arg, struct argp_state *state) int result = INTUSE(dwfl_linux_proc_report) (dwfl, atoi (arg)); if (result != 0) return fail (dwfl, result, arg); + + result = INTUSE(dwfl_linux_proc_attach) (dwfl, atoi (arg), false); + if (result != 0) + /* Non-fatal to not be able to attach to process. */ + failure (dwfl, result, _("cannot attach to process")); opt->dwfl = dwfl; } else @@ -296,6 +301,11 @@ parse_opt (int key, char *arg, struct argp_state *state) return fail (dwfl, result, opt->core); } + result = INTUSE(dwfl_core_file_attach) (dwfl, core); + if (result < 0) + /* Non-fatal to not be able to attach to core. */ + failure (dwfl, result, _("cannot attach to core")); + /* From now we leak FD and CORE. */ if (result == 0) |
