Architectures In Python (Debugging with GDB)
From Get docs
22.214.171.124 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 has the following methods:
- Architecture.name ()
- Return the name (string value) of the architecture.
- Architecture.disassemble (start_pc [, end_pc [, count]])
- Return a list of disassembled instructions starting from the memory address
start_pc. The optional arguments
countdetermine the number of instructions in the returned list. If both the optional arguments
countare specified, then a list of at most
countdisassembled instructions whose start address falls in the closed memory address interval from
end_pcare returned. If
end_pcis not specified, but
countis specified, then
countnumber of instructions starting from the address
start_pcare returned. If
countis not specified but
end_pcis specified, then all instructions whose start address falls in the closed memory address interval from
end_pcare returned. If neither
countare specified, then a single instruction at
start_pcis returned. For all of these cases, each element of the returned list is a Python
dictwith the following string keys:
- The value corresponding to this key is a Python long integer capturing the memory address of the instruction.
- 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.
- The value corresponding to this key is the length (integer value) of the instruction in bytes.
- Architecture.registers ([ reggroup ])
- Return a
gdb.RegisterDescriptorIterator(see Registers In Python) for all of the registers in
reggroup, a string that is the name of a register group. If
reggroupis omitted, or is the empty string, then the register group ‘
all’ is assumed.
- Architecture.register_groups ()
- Return a
gdb.RegisterGroupsIterator(see Registers In Python) for all of the register groups available for the