Architectures In Python (Debugging with GDB)
From Get docs
Gdb/docs/latest/gdb/Architectures-In-Python
Next: Registers In Python, Previous: Lazy Strings In Python, Up: Python API [Contents][Index]
23.3.2.33 Python representation of architectures
GDB uses architecture specific parameters and artifacts in a number of its various computations. An architecture is represented by an instance of the gdb.Architecture class.
A gdb.Architecture class has the following methods:
- Function
- Architecture.name ()
- Return the name (string value) of the architecture.
- Function
- Architecture.disassemble (start_pc [, end_pc [, count]])
- Return a list of disassembled instructions starting from the memory address
start_pc. The optional argumentsend_pcandcountdetermine the number of instructions in the returned list. If both the optional argumentsend_pcandcountare specified, then a list of at mostcountdisassembled instructions whose start address falls in the closed memory address interval fromstart_pctoend_pcare returned. Ifend_pcis not specified, butcountis specified, thencountnumber of instructions starting from the addressstart_pcare returned. Ifcountis not specified butend_pcis specified, then all instructions whose start address falls in the closed memory address interval fromstart_pctoend_pcare returned. If neitherend_pcnorcountare specified, then a single instruction atstart_pcis returned. For all of these cases, each element of the returned list is a Pythondictwith the following string keys:
addr- The value corresponding to this key is a Python long integer capturing the memory address of the instruction.
asm- The value corresponding to this key is a string value which represents the instruction with assembly language mnemonics. The assembly language flavor used is the same as that specified by the current CLI variable
disassembly-flavor. See Machine Code. length- The value corresponding to this key is the length (integer value) of the instruction in bytes.
- Function
- Architecture.registers ([ reggroup ])
- Return a
gdb.RegisterDescriptorIterator(see Registers In Python) for all of the registers inreggroup, a string that is the name of a register group. Ifreggroupis omitted, or is the empty string, then the register group ‘all’ is assumed.
- Function
- Architecture.register_groups ()
- Return a
gdb.RegisterGroupsIterator(see Registers In Python) for all of the register groups available for thegdb.Architecture.
Next: Registers In Python, Previous: Lazy Strings In Python, Up: Python API [Contents][Index]