Skip to content
Snippets Groups Projects
  • Tom Tromey's avatar
    d1cab987
    Don't use gdb_py_long_from_ulongest · d1cab987
    Tom Tromey authored
    Remove the gdb_py_long_from_ulongest defines and change the Python
    layer to prefer gdb_py_object_from_ulongest.  While writing this I
    noticed that the error handling in archpy_disassemble was incorrect --
    it could call PyDict_SetItemString with a NULL value.  This patch also
    fixes this bug.
    
    gdb/ChangeLog
    2020-09-15  Tom Tromey  <tromey@adacore.com>
    
    	* python/python-internal.h (gdb_py_long_from_ulongest): Remove
    	defines.
    	* python/py-value.c (valpy_long): Use
    	gdb_py_object_from_ulongest.
    	* python/py-symtab.c (salpy_get_pc): Use
    	gdb_py_object_from_ulongest.
    	(salpy_get_last): Likewise.
    	* python/py-record-btrace.c (recpy_bt_insn_pc): Use
    	gdb_py_object_from_ulongest.
    	* python/py-lazy-string.c (stpy_get_address): Use
    	gdb_py_object_from_ulongest.
    	* python/py-frame.c (frapy_pc): Use gdb_py_object_from_ulongest.
    	* python/py-arch.c (archpy_disassemble): Use
    	gdb_py_object_from_ulongest and gdb_py_object_from_longest.  Fix
    	error handling.
    d1cab987
    History
    Don't use gdb_py_long_from_ulongest
    Tom Tromey authored
    Remove the gdb_py_long_from_ulongest defines and change the Python
    layer to prefer gdb_py_object_from_ulongest.  While writing this I
    noticed that the error handling in archpy_disassemble was incorrect --
    it could call PyDict_SetItemString with a NULL value.  This patch also
    fixes this bug.
    
    gdb/ChangeLog
    2020-09-15  Tom Tromey  <tromey@adacore.com>
    
    	* python/python-internal.h (gdb_py_long_from_ulongest): Remove
    	defines.
    	* python/py-value.c (valpy_long): Use
    	gdb_py_object_from_ulongest.
    	* python/py-symtab.c (salpy_get_pc): Use
    	gdb_py_object_from_ulongest.
    	(salpy_get_last): Likewise.
    	* python/py-record-btrace.c (recpy_bt_insn_pc): Use
    	gdb_py_object_from_ulongest.
    	* python/py-lazy-string.c (stpy_get_address): Use
    	gdb_py_object_from_ulongest.
    	* python/py-frame.c (frapy_pc): Use gdb_py_object_from_ulongest.
    	* python/py-arch.c (archpy_disassemble): Use
    	gdb_py_object_from_ulongest and gdb_py_object_from_longest.  Fix
    	error handling.