From a61408f8aa07c0b9df31474eb4b1277fc63d34ff Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Fri, 18 Jun 2010 23:06:30 +0000 Subject: 2010-06-18 Stan Shebs * osdata.c (get_osdata): Warn separately if target does not report type list. (info_osdata_command): Allow empty type, report error if target does not return available types of OS data. * linux-nat.c (linux_nat_xfer_osdata): Report list of OS data types if no annex supplied. * gdb.texinfo (Operating System Auxiliary Information): Describe "info os" when no arguments given. --- gdb/linux-nat.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'gdb/linux-nat.c') diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 43370f0..93ba8e2 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -4948,6 +4948,45 @@ linux_nat_xfer_osdata (struct target_ops *ops, enum target_object object, gdb_assert (object == TARGET_OBJECT_OSDATA); + if (!annex) + { + if (offset == 0) + { + if (len_avail != -1 && len_avail != 0) + obstack_free (&obstack, NULL); + len_avail = 0; + buf = NULL; + obstack_init (&obstack); + obstack_grow_str (&obstack, "\n"); + + obstack_xml_printf ( + &obstack, + "" + "processes" + "Listing of all processes" + ""); + + obstack_grow_str0 (&obstack, "\n"); + buf = obstack_finish (&obstack); + len_avail = strlen (buf); + } + + if (offset >= len_avail) + { + /* Done. Get rid of the obstack. */ + obstack_free (&obstack, NULL); + buf = NULL; + len_avail = 0; + return 0; + } + + if (len > len_avail - offset) + len = len_avail - offset; + memcpy (readbuf, buf + offset, len); + + return len; + } + if (strcmp (annex, "processes") != 0) return 0; -- cgit v1.1