Index: linux-nat.c =================================================================== RCS file: /cvs/src/src/gdb/linux-nat.c,v retrieving revision 1.170 diff -p -r1.170 linux-nat.c *** linux-nat.c 28 May 2010 18:23:15 -0000 1.170 --- linux-nat.c 14 Jun 2010 22:09:34 -0000 *************** linux_nat_xfer_osdata (struct target_ops *** 4948,4953 **** --- 4948,4992 ---- 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; Index: osdata.c =================================================================== RCS file: /cvs/src/src/gdb/osdata.c,v retrieving revision 1.6 diff -p -r1.6 osdata.c *** osdata.c 16 May 2010 00:46:46 -0000 1.6 --- osdata.c 14 Jun 2010 22:09:34 -0000 *************** get_osdata (const char *type) *** 256,262 **** struct cleanup *old_chain = make_cleanup (xfree, xml); if (xml[0] == '\0') ! warning (_("Empty data returned by target. Wrong osdata type?")); else osdata = osdata_parse (xml); --- 256,267 ---- struct cleanup *old_chain = make_cleanup (xfree, xml); if (xml[0] == '\0') ! { ! if (type) ! warning (_("Empty data returned by target. Wrong osdata type?")); ! else ! warning (_("Empty type list returned by target. No type data?")); ! } else osdata = osdata_parse (xml); *************** info_osdata_command (char *type, int fro *** 294,308 **** int ncols; int nprocs; - if (type == 0) - /* TODO: No type could mean "list availables types". */ - error (_("Argument required.")); - osdata = get_osdata (type); old_chain = make_cleanup_osdata_free (osdata); nprocs = VEC_length (osdata_item_s, osdata->items); last = VEC_last (osdata_item_s, osdata->items); if (last && last->columns) ncols = VEC_length (osdata_column_s, last->columns); --- 299,312 ---- int ncols; int nprocs; osdata = get_osdata (type); old_chain = make_cleanup_osdata_free (osdata); nprocs = VEC_length (osdata_item_s, osdata->items); + if (!type && nprocs == 0) + error (_("Available types of OS data not reported.")); + last = VEC_last (osdata_item_s, osdata->items); if (last && last->columns) ncols = VEC_length (osdata_column_s, last->columns);