Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Eli Zaretskii'" <eliz@gnu.org>,
	"'Ulrich Weigand'" <uweigand@de.ibm.com>
Cc: <gdb-patches@sourceware.org>, <pedro@codesourcery.com>
Subject: RE: [RFC] Remove i386 low level debug register function from nm- header file.
Date: Tue, 12 May 2009 15:45:00 -0000	[thread overview]
Message-ID: <004601c9d318$a13c4fd0$e3b4ef70$@u-strasbg.fr> (raw)
In-Reply-To: <83octyxsgb.fsf@gnu.org>

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 : Eli Zaretskii [mailto:eliz@gnu.org]
> Envoyé : Tuesday, May 12, 2009 5:16 PM
> À : Ulrich Weigand
> Cc : muller@ics.u-strasbg.fr; gdb-patches@sourceware.org;
> pedro@codesourcery.com
> Objet : Re: [RFC] Remove i386 low level debug register function from
> nm- header file.
> 
> > Date: Tue, 12 May 2009 17:00:35 +0200 (CEST)
> > From: "Ulrich Weigand" <uweigand@de.ibm.com>
> > 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.
> 
> 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.


  reply	other threads:[~2009-05-12 15:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-10 14:54 Pierre Muller
2009-05-10 17:37 ` Eli Zaretskii
2009-05-12 13:02 ` Ulrich Weigand
2009-05-12 14:37   ` Pierre Muller
2009-05-12 15:00     ` Ulrich Weigand
2009-05-12 15:17       ` Eli Zaretskii
2009-05-12 15:45         ` Pierre Muller [this message]
2009-05-12 16:06           ` Ulrich Weigand
2009-05-12 16:19             ` Pedro Alves
2009-05-12 21:28     ` [RFC-v2] " Pierre Muller
2009-05-13 15:33       ` Ulrich Weigand
2009-05-13 18:09         ` Eli Zaretskii
2009-05-13 18:35           ` Ulrich Weigand
2009-05-13 18:25         ` Doug Evans
2009-05-13 18:38           ` Ulrich Weigand
2009-05-13 22:21           ` Pierre Muller
2009-05-13 23:16             ` Doug Evans
2009-05-13 23:39         ` [RFA-v3] " Pierre Muller
2009-05-14  9:06           ` Ulrich Weigand
2009-05-14  9:10             ` Joel Brobecker
2009-05-14  9:40             ` Pierre Muller
2009-05-14 15:32             ` Macros in config files Pierre Muller
2009-05-14 18:31               ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004601c9d318$a13c4fd0$e3b4ef70$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox