This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Doubt using "set" command with registers
- From: joaoandreferro at sapo dot pt
- To: gdb at sourceware dot org
- Date: Tue, 28 Oct 2014 16:01:56 +0000
- Subject: Doubt using "set" command with registers
- Authentication-results: sourceware.org; auth=none
Hello all,
I've been using GDB (in fact, conjuged with KGDB) lately to do some
kernel debugging. I've been testing some GDB commands, and a doubt
arised while using the "set" command, trying to change the value of
some registers. I've been able to successfully change the value of all
the registers provided by the "info registers" command (i. e., in my
case $eax, $ecx, $edx, $ebx, $esp, $ebp, $esi, $edi, $eip, $eflags,
$cs, $ss, $ds, $es, $fs and $gs) *except* for $esp, $ss, $fs and $gs.
Why is it so? I've been making these tests after hitting a hardware
breakpoint, then I set the values with e. g. "set $es = 0xf1c2007c",
and verifiy the assignemt with "info reg $es". As I've pointed out, it
works with the majority of the registers, except for that four (in
this particular case, the first command doesn't output any error, but
the second command shows me that the registers remain with the initial
value). By the way, I've started GDB with the -write option (checked
it inside GDb with the "show write" command). My GDB version is 7.2.
If someone knows something about this situation and can share it with
me, it would be great.
Best regards,
JoÃo