mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 18:39:34 +08:00
gdb
* varobj.c (value_get_print_value): Rearrange. Pass stream to apply_varobj_pretty_printer. * c-lang.c: Include exceptions.h. (c_get_string): Throw MEMORY_ERROR when appropriate. * python/py-prettyprint.c (enum string_repr_result): New. (print_stack_unless_memory_error): New function. (print_string_repr): Change return type. Use print_stack_unless_memory_error. (print_children): Use print_stack_unless_memory_error. (apply_val_pretty_printer): Update. Don't print children if string representation threw an exception. (apply_varobj_pretty_printer): Add 'stream' argument. Use print_stack_unless_memory_error. * python/python.c (gdbpy_gdb_error, gdbpy_gdb_memory_error): New globals. (_initialize_python): Initialize them. * python/python-internal.h (GDB_PY_HANDLE_EXCEPTION): Use gdbpy_convert_exception. (GDB_PY_SET_HANDLE_EXCEPTION): Likewise. (gdbpy_gdb_error, gdbpy_gdb_memory_error): Declare. (gdbpy_convert_exception): Declare. (apply_varobj_pretty_printer): Update. * python/py-utils.c (gdbpy_convert_exception): New function. gdb/doc * gdb.texinfo (Basic Python): Update. Add xref. (Exception Handling): Document new exception classes. (Types In Python): Update. (Frames In Python): Update. gdb/testsuite * gdb.python/py-prettyprint.c (main): Add new 'ns2' local. * gdb.python/py-prettyprint.exp (run_lang_tests): Add test for MemoryError. * gdb.python/python.exp (gdb_py_test_multiple): Update exception type. * gdb.python/py-value.exp (test_value_in_inferior): Add test for MemoryError. (test_subscript_regression): Update exception type.
This commit is contained in:
@ -160,7 +160,7 @@ runto [gdb_get_line_number "Break to end."]
|
||||
|
||||
# Test gdb.decode_line.
|
||||
gdb_test "python gdb.decode_line(\"main.c:43\")" \
|
||||
"RuntimeError: No source file named main.c.*" "test decode_line no source named main"
|
||||
"gdb.error: No source file named main.c.*" "test decode_line no source named main"
|
||||
|
||||
gdb_py_test_silent_cmd "python symtab = gdb.decode_line()" "test decode_line current location" 1
|
||||
gdb_test "python print len(symtab)" "2" "Test decode_line current location"
|
||||
@ -177,7 +177,7 @@ gdb_test "python print symtab\[1\]\[0\].symtab" "gdb/testsuite/gdb.python/python
|
||||
gdb_test "python print symtab\[1\]\[0\].line" "26" "Test decode_line python.c:26 line number"
|
||||
|
||||
gdb_test "python gdb.decode_line(\"randomfunc\")" \
|
||||
"RuntimeError: Function \"randomfunc\" not defined.*" "test decode_line randomfunc"
|
||||
"gdb.error: Function \"randomfunc\" not defined.*" "test decode_line randomfunc"
|
||||
gdb_py_test_silent_cmd "python symtab = gdb.decode_line(\"func1\")" "test decode_line func1()" 1
|
||||
gdb_test "python print len(symtab)" "2" "Test decode_line func1 length"
|
||||
gdb_test "python print len(symtab\[1\])" "1" "Test decode_line func1 length"
|
||||
|
Reference in New Issue
Block a user