From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31846 invoked by alias); 30 Jul 2010 22:16:48 -0000 Received: (qmail 31829 invoked by uid 22791); 30 Jul 2010 22:16:46 -0000 X-SWARE-Spam-Status: No, hits=1.0 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE,TW_CX,TW_DX X-Spam-Check-By: sourceware.org Received: from mailrelay006.isp.belgacom.be (HELO mailrelay006.isp.belgacom.be) (195.238.6.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Jul 2010 22:16:42 +0000 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvEGAJbqUkxtgAqb/2dsb2JhbACIbopgjFdywVUNgnYIgi4E Received: from 155.10-128-109.adsl-dyn.isp.belgacom.be (HELO soleil) ([109.128.10.155]) by relay.skynet.be with SMTP; 31 Jul 2010 00:16:40 +0200 Message-ID: <626075219D624850B89B9E0A39D09734@soleil> From: "Philippe Waroquiers" To: Subject: gdbserver target description: info reg displays or not according to group presence ??? Date: Fri, 30 Jul 2010 22:16:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2010-07/txt/msg00131.txt.bz2 Hello, I am busy integrating a gdbserver within valgrind. Valgrind has shadow registers (indicating if a register contains "uninitialized" data). To have gdb be able to display and modify these registers, I am defining a target description that includes the normal register set and the 2 valgrind shadow register sets. I would like that these registers are not shown in "info regs" but only shown in "info all-reg". According to the manual (gdb gdb-7.2.50.20100730), it is enough to *not* specify a group and then these are not displayed: GROUP The register group to which this register belongs. GROUP must be either `general', `float', or `vector'. If no GROUP is specified, GDB will not display the register in `info registers'. However, that does not seem to match what I observe. The file gdb/features/i386/32bit-core.xml defines e.g. eax as: This register is shown in info reg. According to the manual above, it should not. I have defined another file for valgrind, called 32bit-core-valgrind-s1.xml where I have a.o. the following two lines: When I am doing info regs, gdb shows both eaxs1 and ecxs1 (and all others shadow registers). Looking at the trace, I see that the correct description is returned to gdb. I see that gdb properly has understood the target description as it shows the normal and shadow registers. However, it does always shows all the shadow registers, not taking into account the presence or not of a group. Trying to understand what is happening, I am using maint print to look at what gdb has understood: (gdb) maint print c-tdesc The current target description did not come from an XML file. -- this looks normal as the target description arrives from gdbserver. (gdb) maint print register-groups ... (removed some) '' 47 47 308 0 int0_t general '' 48 48 308 0 int0_t general orig_eax 49 49 308 4 long save,restore,system eaxs1 50 50 312 4 int32_t general,all,save,restore ecxs1 51 51 316 4 int32_t general,all,save,restore edxs1 52 52 320 4 int32_t general,all,save,restore ... (removed some) -- this looks strange: the s1 group is not theree for eaxs1, it rather has general/all/save/restore indication. (gdb) maint print raw-registers ... (removed some) '' 47 47 308 0 int0_t '' 48 48 308 0 int0_t orig_eax 49 49 308 4 long 0x00000000 eaxs1 50 50 312 4 int32_t 0x00000000 ecxs1 51 51 316 4 int32_t 0x00000000 edxs1 52 52 320 4 int32_t 0x00000000 ... (removed some) So, there is something that looks wrong. Any hint/idea ?