diff options
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/linux-low.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 726a6b4..54e4c72 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,10 @@ 2012-03-13 Jan Kratochvil <jan.kratochvil@redhat.com> + * linux-low.c (linux_attach_lwp_1): New variable buffer. Call + linux_ptrace_attach_warnings. + +2012-03-13 Jan Kratochvil <jan.kratochvil@redhat.com> + * Makefile.in (linux-ptrace.o): New. * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*) (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 06ec576..d2d4c1d 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -652,6 +652,8 @@ linux_attach_lwp_1 (unsigned long lwpid, int initial) if (ptrace (PTRACE_ATTACH, lwpid, 0, 0) != 0) { + struct buffer buffer; + if (!initial) { /* If we fail to attach to an LWP, just warn. */ @@ -662,8 +664,11 @@ linux_attach_lwp_1 (unsigned long lwpid, int initial) } /* If we fail to attach to a process, report an error. */ - error ("Cannot attach to lwp %ld: %s (%d)\n", lwpid, - strerror (errno), errno); + buffer_init (&buffer); + linux_ptrace_attach_warnings (lwpid, &buffer); + buffer_grow_str0 (&buffer, ""); + error ("%sCannot attach to lwp %ld: %s (%d)", buffer_finish (&buffer), + lwpid, strerror (errno), errno); } if (initial) |