With GDB and Python I tried to get the char* value on x1 register
python
a= gdb.execute("x/s $x1", to_string=True)
print(a)
end
But I got
0xbb4aaa: "SomeString"
I want to get only the SomeString without the address
How can I do that directly with python GDB (without regex/split)
gdb.convenience_variable('x1').string().$x1is a register ,not a variable . that doesn't workgdb.selected_frame().read_register('x1').cast(gdb.lookup_type('char').pointer()).string().a = gdb.execute('printf "%s", $x1', to_string=True)