[PATCH] Improve handling of OS information data

Kwok Cheung Yeung kcy@codesourcery.com
Thu Oct 13 00:20:00 GMT 2011


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.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: osdata.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20111013/95a58e94/attachment.ksh>


More information about the Gdb-patches mailing list