From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16066 invoked by alias); 12 May 2009 15:45:21 -0000 Received: (qmail 16018 invoked by uid 22791); 12 May 2009 15:45:19 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 May 2009 15:45:11 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n4CFj1mI023006 ; Tue, 12 May 2009 17:45:01 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n4CFj1ED028493 ; Tue, 12 May 2009 17:45:01 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (www-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n4CFj0hV003488 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Tue, 12 May 2009 17:45:00 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" , "'Ulrich Weigand'" Cc: , References: <200905121500.n4CF0Z1B016661@d12av02.megacenter.de.ibm.com> <83octyxsgb.fsf@gnu.org> In-Reply-To: <83octyxsgb.fsf@gnu.org> Subject: RE: [RFC] Remove i386 low level debug register function from nm- header file. Date: Tue, 12 May 2009 15:45:00 -0000 Message-ID: <004601c9d318$a13c4fd0$e3b4ef70$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00248.txt.bz2 What about something like this: (once my main patch is accepted) static void maint_show_debug_regs (char * args, int from_tty) { if (i386_dr_low.set_addr && i386_dr_low.get_status && i386_dr_low.set_control) { } else { error (_("x86 debug register cannot be used for that target")); } } void _initialize_i386_nat (void) { #ifdef I386_USE_GENERIC_WATCHPOINTS /* A maintenance command to enable printing the internal DRi mirror variables. */ add_cmd ("show-debug-regs", class_maintenance, maint_show_debug_regs, _("\ Set whether to show variables that mirror the x86 debug registers.\n\ Use \"on\" to enable, \"off\" to disable.\n\ If enabled, the debug registers values are shown when GDB inserts\n\ or removes a hardware breakpoint or watchpoint, and when the inferior\n\ triggers a breakpoint or watchpoint."), &maintenancelist); #endif This would also remove one of the ARI var_boolean warnings! The problem is that I don't know what to use for the parsing of args in the case where the command should be accepted, and I also don't know what I should use instead of error here. Can someone help me here? Eli, is it OK if we do that as a separate patch? Pierre > -----Message d'origine----- > De=A0: Eli Zaretskii [mailto:eliz@gnu.org] > Envoy=E9=A0: Tuesday, May 12, 2009 5:16 PM > =C0=A0: Ulrich Weigand > Cc=A0: muller@ics.u-strasbg.fr; gdb-patches@sourceware.org; > pedro@codesourcery.com > Objet=A0: Re: [RFC] Remove i386 low level debug register function from > nm- header file. >=20 > > Date: Tue, 12 May 2009 17:00:35 +0200 (CEST) > > From: "Ulrich Weigand" > > Cc: gdb-patches@sourceware.org, pedro@codesourcery.com ('Pedro > Alves'), > > eliz@gnu.org ('Eli Zaretskii') > > > > > > I think you should provide everything in i386-nat.c (and > > > > the new i386-nat.h) unconditionally, and eliminate the > > > > various definitions of I386_USE_GENERIC_WATCHPOINTS in the > > > > nm- header files. > > > > > > The only drawback is that "maint show-debug--regs" command > > > will then also appear on target that do not support > > > debug registers... Anyhow, it will just be a no-op in that case. > > > Is that a problem? > > > > I don't think so. The command simply says: "whenever the hardware > > debug registers are changed, display their contents". Being able > > to set that flag on a system that happens to never use hardware > > debug register should be fine, the condition just never occurs. >=20 > I'd rather we displayed an error message when this command is used on > platforms where it has no effect. Silently doing nothing is not a > good UI. But that's me.