This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Doubt using "set" command with registers


On 10/31/2014 11:21 AM, joaoandreferro@sapo.pt wrote:
> Citando Pedro Alves <palves@redhat.com>:

>> I'd guess that it's kgdb itself that is blocking those writes.
>>
>> Try "set debug remote 1" before the "set $foo = " command.

> Thanks for your answer. I turned "set debug remote 1" on again, and  
> strangely, the output tells me that "set-register" is not supported,  
> but only when I'm able to change the register value (see the output  
> below). First, I've tried with a register which I can successfully  
> change the value, and then with another one where I wasn't able to do  
> it in the past. Do you know why this behaviour occurs? Meanwhile, I'll  
> ask the same in the KGDB mailing list. Like I've mentioned, output  
> below:
> 
> (gdb) info reg $es
> es             0x7b	123
> (gdb) set $es = 0x7c
> Sending packet: $Pd=7c000000#ab...Ack
> Packet received:
> Packet P (set-register) is NOT supported

If the P packet (write one register) is not supported, then ...

> Sending packet:  
> $G14000000ccb59cc00000000067000000089fcbf10c9fcbf1ac309dc00000000079154ac09600000060000000680000007b009dc07c000000ffff0000ffff0000#61...Ack
> Packet received: OK

... GDB tries the G packet (writes the whole set of registers in one block),
and doesn't try P again.  That's normal.

> Sending packet: $g#67...Ack
> Packet received:  
> 14000000ccb59cc00000000067000000089fcbf10c9fcbf1ac309dc00000000079154ac09600000060000000680000007b009dc07c000000ffff0000ffff0000
> (gdb) info reg $es
> es             0x7c	124
> (gdb) info reg $ss
> ss             0x68	104
> (gdb) set $ss = 0x69
> Sending packet:  
> $G14000000ccb59cc00000000067000000089fcbf10c9fcbf1ac309dc00000000079154ac09600000060000000690000007b009dc07c000000ffff0000ffff0000#62...Ack
> Packet received: OK

Here GDB went straight to the G packet, because it now knows P is
not supported.  The target accepted the write ...

> Sending packet: $g#67...Ack
> Packet received:  
> 14000000ccb59cc00000000067000000089fcbf10c9fcbf1ac309dc00000000079154ac09600000060000000680000007b009dc07c000000ffff0000ffff0000
> (gdb) info reg $ss
> ss             0x68	104

... but didn't make it really effective.
Note the "68" in the g packet (read registers) reply -- seems like kgdb is
simply ignoring the change to $ss.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]