diff options
author | Stan Shebs <shebs@codesourcery.com> | 2010-06-18 23:06:30 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 2010-06-18 23:06:30 +0000 |
commit | a61408f8aa07c0b9df31474eb4b1277fc63d34ff (patch) | |
tree | fb5a28e9b7889a87eb4f72c13c93d3a5daf3ea95 /gdb/linux-nat.c | |
parent | 38bd8d09ffe9e298c29172609b358c34cfd7e11b (diff) | |
download | gdb-a61408f8aa07c0b9df31474eb4b1277fc63d34ff.zip gdb-a61408f8aa07c0b9df31474eb4b1277fc63d34ff.tar.gz gdb-a61408f8aa07c0b9df31474eb4b1277fc63d34ff.tar.bz2 |
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.c | 39 |
1 files changed, 39 insertions, 0 deletions
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, "<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; |