2012-06-26 Siva Chandra Reddy <sivachandra@google.com>
New attribute 'last' for gdb.Symtab_and_line. * NEWS (Python Scripting): Add entry about the new attribute. * python/py-symtab.c (salpy_get_last): New function which implements the get method for the 'last' attribute of gdb.Symtab_and_line. (sal_object_getset): Add entry for the 'last' attribute. doc/ * gdb.texinfo (Symbol Tables In Python): Add description about the new 'last' attribute of gdb.Symtab_and line. testsuite/ * gdb.python/py-symtab.exp: Add tests to test the new attribute 'last' of gdb.Symtab_and_line. * gdb.python/py-symbol.c: Move break point comment to enable testing of gdb.Symtab_and_line.last.
This commit is contained in:
parent
f7ccda615a
commit
ee0bf529c3
8 changed files with 52 additions and 2 deletions
|
@ -40,8 +40,8 @@ int qq = 72; /* line of qq */
|
|||
int func (int arg)
|
||||
{
|
||||
int i = 2;
|
||||
i = i * arg;
|
||||
return arg; /* Block break here. */
|
||||
i = i * arg; /* Block break here. */
|
||||
return arg;
|
||||
}
|
||||
|
||||
struct simple_struct
|
||||
|
|
|
@ -46,10 +46,13 @@ gdb_py_test_silent_cmd "python static_block = symtab.static_block()" "Get static
|
|||
gdb_py_test_silent_cmd "python global_symbols = \[\]; static_symbols = \[\]" "Set up symbol name lists" 0
|
||||
gdb_py_test_silent_cmd "python for sym in global_block: global_symbols.append(sym.name)" "Get global symbol names" 0
|
||||
gdb_py_test_silent_cmd "python for sym in static_block: static_symbols.append(sym.name)" "Get static symbol names" 0
|
||||
gdb_py_test_silent_cmd "step" "Step to the next line" 0
|
||||
gdb_py_test_silent_cmd "python new_pc = gdb.selected_frame().find_sal().pc" "Get new PC" 0
|
||||
|
||||
# Test sal.
|
||||
gdb_test "python print sal.symtab" ".*gdb.python/py-symbol.c.*" "Test symtab"
|
||||
gdb_test "python print sal.pc" "${decimal}" "Test sal.pc"
|
||||
gdb_test "python print sal.last == (new_pc - 1)" "True" "Test sal.last"
|
||||
gdb_test "python print sal.line" "$line_no" "Test sal.line"
|
||||
gdb_test "python print sal.is_valid()" "True" "Test sal.is_valid"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue