This is the mail archive of the gdb-patches@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: [RFC] Remove i386 low level debug register function from nm- header file.


Pierre Muller wrote:

> 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

Well, I guess a simpler way to have that effect would be to just
move installing the command into the i386_use_watchpoints routine;
on targets that do not use watchpoints the command then simply would
not be available, just as it is the case today.

> This would also remove one of the ARI var_boolean warnings!

You're right, but we should be using one of the new routines (probably
add_setshow_boolean_cmd) instead of the old deprecated_add_set_cmd.
That's a separate issue though.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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