From 0afae3cf2e83e8bc2dca4fe865afc85f0362d312 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 23 Mar 2012 20:27:08 +0000 Subject: [PATCH] 2012-03-23 Pedro Alves * linux-low.c (linux_qxfer_libraries_svr4): Terminate the "library-list-svr4" element's start tag when the the DSO list is empty. --- gdb/gdbserver/ChangeLog | 6 ++++++ gdb/gdbserver/linux-low.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index d141bac70eb..d585afbf443 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2012-03-23 Pedro Alves + + * linux-low.c (linux_qxfer_libraries_svr4): Terminate the + "library-list-svr4" element's start tag when the the DSO list is + empty. + 2012-03-23 Pedro Alves * linux-low.c (read_one_ptr): Read the inferior's pointer through diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 2dc903dd122..71cde01d43a 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -5630,7 +5630,13 @@ linux_qxfer_libraries_svr4 (const char *annex, unsigned char *readbuf, lm_addr = l_next; } done: - strcpy (p, ""); + if (!header_done) + { + /* Empty list; terminate `"); + } + else + strcpy (p, ""); } document_len = strlen (document); -- 2.30.2