summaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>2010-06-18 23:06:29 +0000
committerStan Shebs <shebs@apple.com>2010-06-18 23:06:29 +0000
commit961f5648a33adba3941f5fdd843c06fe3e04619c (patch)
tree67cbb95076d98ab3dba7033832bc97a09eada0dc /gdb/linux-nat.c
parentd2328f2aa90d894baab7dda8ec2cf5dbab13233d (diff)
downloadgdb-961f5648a33adba3941f5fdd843c06fe3e04619c.tar.gz
2010-06-18 Stan Shebs <stan@codesourcery.com>
* 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.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 43370f0f80c..93ba8e23f8a 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, "<osdata type=\"types\">\n");
+
+ obstack_xml_printf (
+ &obstack,
+ "<item>"
+ "<column name=\"Type\">processes</column>"
+ "<column name=\"Description\">Listing of all processes</column>"
+ "</item>");
+
+ obstack_grow_str0 (&obstack, "</osdata>\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;