This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Doubt using "set" command with registers
- From: Pedro Alves <palves at redhat dot com>
- To: joaoandreferro at sapo dot pt, gdb at sourceware dot org
- Date: Thu, 30 Oct 2014 10:59:07 +0000
- Subject: Re: Doubt using "set" command with registers
- Authentication-results: sourceware.org; auth=none
- References: <20141028160156 dot Horde dot uvcacyDQQ900l0BFN1Pemw5 at mail dot sapo dot pt>
Hi JoÃo,
On 10/28/2014 04:01 PM, joaoandreferro@sapo.pt wrote:
> 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.
I'd guess that it's kgdb itself that is blocking those writes.
Try "set debug remote 1" before the "set $foo = " command.
Thanks,
Pedro Alves