Skip to content
Snippets Groups Projects
  • Tom Tromey's avatar
    d19ca0b3
    Accept gdb.Value in more Python APIs · d19ca0b3
    Tom Tromey authored
    PR python/27000 points out that gdb.block_for_pc will accept a Python
    integer, but not a gdb.Value.  This patch corrects this oversight.
    
    I looked at all uses of GDB_PY_LLU_ARG and fixed these up to use
    get_addr_from_python instead.  I also looked at uses of GDB_PY_LL_ARG,
    but those seemed relatively unlikely to be useful with a gdb.Value, so
    I didn't change them.  My thinking here is that a Value will typically
    come from inferior memory, and something like a line number is not too
    likely to be found this way.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27000
    d19ca0b3
    History
    Accept gdb.Value in more Python APIs
    Tom Tromey authored
    PR python/27000 points out that gdb.block_for_pc will accept a Python
    integer, but not a gdb.Value.  This patch corrects this oversight.
    
    I looked at all uses of GDB_PY_LLU_ARG and fixed these up to use
    get_addr_from_python instead.  I also looked at uses of GDB_PY_LL_ARG,
    but those seemed relatively unlikely to be useful with a gdb.Value, so
    I didn't change them.  My thinking here is that a Value will typically
    come from inferior memory, and something like a line number is not too
    likely to be found this way.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27000