mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-15 05:01:13 +08:00
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.
This commit is contained in:
@ -1,5 +1,12 @@
|
|||||||
2010-06-18 Stan Shebs <stan@codesourcery.com>
|
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.
|
||||||
|
|
||||||
* thread.c (thread_id_make_value): Make a value representing the
|
* thread.c (thread_id_make_value): Make a value representing the
|
||||||
current thread.
|
current thread.
|
||||||
(_initialize_thread): Create $_thread.
|
(_initialize_thread): Create $_thread.
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2010-06-18 Stan Shebs <stan@codesourcery.com>
|
2010-06-18 Stan Shebs <stan@codesourcery.com>
|
||||||
|
|
||||||
|
* gdb.texinfo (Operating System Auxiliary Information): Describe
|
||||||
|
"info os" when no arguments given.
|
||||||
|
|
||||||
* gdb.texinfo (Debugging Programs with Multiple Threads): Describe
|
* gdb.texinfo (Debugging Programs with Multiple Threads): Describe
|
||||||
$_thread.
|
$_thread.
|
||||||
|
|
||||||
|
@ -8519,6 +8519,12 @@ this functionality depends on the remote stub's support of the
|
|||||||
@samp{qXfer:osdata:read} packet, see @ref{qXfer osdata read}.
|
@samp{qXfer:osdata:read} packet, see @ref{qXfer osdata read}.
|
||||||
|
|
||||||
@table @code
|
@table @code
|
||||||
|
@kindex info os
|
||||||
|
@item info os
|
||||||
|
List the types of OS information available for the target. If the
|
||||||
|
target does not return a list of possible types, this command will
|
||||||
|
report an error.
|
||||||
|
|
||||||
@kindex info os processes
|
@kindex info os processes
|
||||||
@item info os processes
|
@item info os processes
|
||||||
Display the list of processes on the target. For each process,
|
Display the list of processes on the target. For each process,
|
||||||
|
@ -4948,6 +4948,45 @@ linux_nat_xfer_osdata (struct target_ops *ops, enum target_object object,
|
|||||||
|
|
||||||
gdb_assert (object == TARGET_OBJECT_OSDATA);
|
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)
|
if (strcmp (annex, "processes") != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
14
gdb/osdata.c
14
gdb/osdata.c
@ -256,7 +256,12 @@ get_osdata (const char *type)
|
|||||||
struct cleanup *old_chain = make_cleanup (xfree, xml);
|
struct cleanup *old_chain = make_cleanup (xfree, xml);
|
||||||
|
|
||||||
if (xml[0] == '\0')
|
if (xml[0] == '\0')
|
||||||
warning (_("Empty data returned by target. Wrong osdata type?"));
|
{
|
||||||
|
if (type)
|
||||||
|
warning (_("Empty data returned by target. Wrong osdata type?"));
|
||||||
|
else
|
||||||
|
warning (_("Empty type list returned by target. No type data?"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
osdata = osdata_parse (xml);
|
osdata = osdata_parse (xml);
|
||||||
|
|
||||||
@ -294,15 +299,14 @@ info_osdata_command (char *type, int from_tty)
|
|||||||
int ncols;
|
int ncols;
|
||||||
int nprocs;
|
int nprocs;
|
||||||
|
|
||||||
if (type == 0)
|
|
||||||
/* TODO: No type could mean "list availables types". */
|
|
||||||
error (_("Argument required."));
|
|
||||||
|
|
||||||
osdata = get_osdata (type);
|
osdata = get_osdata (type);
|
||||||
old_chain = make_cleanup_osdata_free (osdata);
|
old_chain = make_cleanup_osdata_free (osdata);
|
||||||
|
|
||||||
nprocs = VEC_length (osdata_item_s, osdata->items);
|
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);
|
last = VEC_last (osdata_item_s, osdata->items);
|
||||||
if (last && last->columns)
|
if (last && last->columns)
|
||||||
ncols = VEC_length (osdata_column_s, last->columns);
|
ncols = VEC_length (osdata_column_s, last->columns);
|
||||||
|
Reference in New Issue
Block a user