From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2372 invoked by alias); 31 Oct 2014 11:47:17 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 2360 invoked by uid 89); 31 Oct 2014 11:47:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 31 Oct 2014 11:47:15 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9VBl95h014206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Oct 2014 07:47:09 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9VBl6m9026166; Fri, 31 Oct 2014 07:47:07 -0400 Message-ID: <545376B9.9000307@redhat.com> Date: Fri, 31 Oct 2014 11:47:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: joaoandreferro@sapo.pt, gdb@sourceware.org Subject: Re: Doubt using "set" command with registers References: <20141028160156.Horde.uvcacyDQQ900l0BFN1Pemw5@mail.sapo.pt> <545219FB.7030303@redhat.com> <20141031112111.Horde.qLeRlTVuIYKD4o9N1-bX4A1@mail.sapo.pt> In-Reply-To: <20141031112111.Horde.qLeRlTVuIYKD4o9N1-bX4A1@mail.sapo.pt> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg00140.txt.bz2 On 10/31/2014 11:21 AM, joaoandreferro@sapo.pt wrote: > Citando Pedro Alves : >> 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