This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Improve handling of OS information data
- From: Kwok Cheung Yeung <kcy at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 13 Oct 2011 01:19:41 +0100
- Subject: [PATCH] Improve handling of OS information data
This patch tidies up some issues with the way OS information data is processed.
nprocs is renamed to nrows since it is now handling more types of information
than just processes.
At the moment, if no rows are returned for an info type, an assertion fires due
to calling VEC_last on an empty list. This is fixed by explicitly checking for
this condition with VEC_empty. We make sure to return an empty table properly in
this case.
The internal names of data columns are renamed to the form "col<number>" for
safety, since they are used as keys in data items. Suppose for some reason we
had a table with a column named "A,B}". When listing members of this column, an
entry might become: item={A,B}="data"} which is malformed. The header names
remain the same, so the user does not see anything different.
Kwok Cheung Yeung
ChangeLog:
gdb/
* osdata.c (info_osdata_command): Rename nprocs to nrows. Handle
the case where osdata->items is empty. Rename column names to a
canonical form to avoid problems with unusual column names.
Attachment:
osdata.patch
Description: Text document