mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
* gdb.python/lib-types.cc (struct A): New structure.
* gdb.python/lib-types.exp (deepitems): New tests.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2011-10-26 Paul Koning <paul_koning@dell.com>
|
||||||
|
|
||||||
|
* gdb.python/lib-types.cc (struct A): New structure.
|
||||||
|
* gdb.python/lib-types.exp (deepitems): New tests.
|
||||||
|
|
||||||
2011-10-25 Paul Koning <paul_koning@dell.com>
|
2011-10-25 Paul Koning <paul_koning@dell.com>
|
||||||
|
|
||||||
PR python/13327
|
PR python/13327
|
||||||
|
@ -54,6 +54,34 @@ enum enum1 { A, B, C };
|
|||||||
|
|
||||||
enum1 enum1_obj (A);
|
enum1 enum1_obj (A);
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
int a;
|
||||||
|
union {
|
||||||
|
int b0;
|
||||||
|
int b1;
|
||||||
|
union {
|
||||||
|
int bb0;
|
||||||
|
int bb1;
|
||||||
|
union {
|
||||||
|
int bbb0;
|
||||||
|
int bbb1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
int c;
|
||||||
|
union {
|
||||||
|
union {
|
||||||
|
int dd0;
|
||||||
|
int dd1;
|
||||||
|
};
|
||||||
|
int d2;
|
||||||
|
int d3;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct A a = {1,20,3,40};
|
||||||
|
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
|
@ -138,3 +138,8 @@ gdb_test_no_output "python enum1_dict = gdb.types.make_enum_dict (enum1_obj.type
|
|||||||
gdb_test_no_output "python enum1_list = enum1_dict.items ()"
|
gdb_test_no_output "python enum1_list = enum1_dict.items ()"
|
||||||
gdb_test_no_output "python enum1_list.sort ()"
|
gdb_test_no_output "python enum1_list.sort ()"
|
||||||
gdb_test "python print enum1_list" {\[\('A', 0L\), \('B', 1L\), \('C', 2L\)\]}
|
gdb_test "python print enum1_list" {\[\('A', 0L\), \('B', 1L\), \('C', 2L\)\]}
|
||||||
|
|
||||||
|
# test deepitems
|
||||||
|
gdb_test_no_output "python struct_a = gdb.lookup_type ('struct A')"
|
||||||
|
gdb_test "python print struct_a.keys ()" {\['a', '', 'c', ''\]}
|
||||||
|
gdb_test "python print \[k for k,v in gdb.types.deepitems(struct_a)\]" {\['a', 'b0', 'b1', 'bb0', 'bb1', 'bbb0', 'bbb1', 'c', 'dd0', 'dd1', 'd2', 'd3'\]}
|
||||||
|
Reference in New Issue
Block a user