Assembly Language Debugging with gdb.
info signal SIGUSR1
handle SIGUSR1 noprint nostop
gdb -tui <program>
layout asm
layout split
set disassembly-flavor att/intel
set print asm-demangle
set disassemble-next-line on //ask gdb to show us the next instruction every time
start
x/10hb $rsp
x/Ni $pc
nexti,stepi
instead of next, step
which traverse the source linesinfo registers
info all-registers
info registers regname …
info registers eflags
(gdb) print $xmm1
$1 = {
v4_float = {0, 3.43859137e-038, 1.54142831e-044, 1.821688e-044},
v2_double = {9.92129282474342e-303, 2.7585945287983262e-313},
v16_int8 = "\000\000\000\000\3706;\001\v\000\000\000\r\000\000",
v8_int16 = {0, 0, 14072, 315, 11, 0, 13, 0},
v4_int32 = {0, 20657912, 11, 13},
v2_int64 = {88725056443645952, 55834574859},
uint128 = 0x0000000d0000000b013b36f800000000
}
To set values of such registers, you need to tell GDB which view of the register you wish to change, as if you were assigning value to a struct member:
(gdb) set $xmm1.uint128 = 0x000000000000000000000000FFFFFFFF