From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: muller@ics.u-strasbg.fr (Pierre Muller)
Cc: gdb-patches@sourceware.org,
pedro@codesourcery.com ('Pedro Alves'),
eliz@gnu.org ('Eli Zaretskii')
Subject: Re: [RFC] Remove i386 low level debug register function from nm- header file.
Date: Tue, 12 May 2009 13:02:00 -0000 [thread overview]
Message-ID: <200905121300.n4CD0vMQ003287@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <005001c9d17f$302199d0$9064cd70$@u-strasbg.fr> from "Pierre Muller" at May 10, 2009 04:54:13 PM
Pierre Muller wrote:
> Following my first RFC
> http://sourceware.org/ml/gdb-patches/2009-03/msg00197.html
>
> and the following answers, I resubmit
> a new version where all i386 low level debug register
> is contained in a single struct defined in the
> new i386-nat.h header (to comply with DOS file name restrictions
> as asked for by Eli).
This looks good to me. However, now that you've moved the
prototypes to i386-nat.h, there is no longer any need for
the config/i386/nm-i386.h file -- please get rid of that file
(by removing the places where it is included into other nm-
files).
Also, it seems to me that now there is no need any more for
the I386_USE_GENERIC_WATCHPOINTS define -- targets that use
watchpoints call the i386_use_watchpoints routines, those
that don't, do not.
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.
Note that in combination with removing nm-i386.h, this
actually makes several nm- files completely empty, so they
should be removed as well.
> 2009-05-10 Pierre Muller <muller.u-strasbg.fr>
>
> Remove all i386 debug register low level macros in config tm files.
Should read "nm" files, not tm.
> +/* Targets should define this to use the generic x86 watchpoint support.
> */
> +#ifdef I386_USE_GENERIC_WATCHPOINTS
As mentioned above, please get rid of this conditional ...
> +
> +/* Add watchpoint methods to the provided target_ops.
> + Targets defining I386_USE_GENERIC_WATCHPOINTS should call
> + this. */
... as well as the second sentence of the comment.
> /* Support for 8-byte wide hw watchpoints. */
> #ifndef TARGET_HAS_DR_LEN_8
> -#define TARGET_HAS_DR_LEN_8 0
> +#define TARGET_HAS_DR_LEN_8 (i386_dr_low.debug_register_length == 8)
> #endif
Nobody should be defining this any more, so please eliminate
the #ifndef ... conditional.
> Index: src/gdb/i386fbsd-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/i386fbsd-nat.c,v
> retrieving revision 1.18
> @@ -126,7 +127,19 @@ _initialize_i386fbsd_nat (void)
>
> /* Add some extra features to the common *BSD/i386 target. */
> t = i386bsd_target ();
> +
> +#ifdef I386_USE_GENERIC_WATCHPOINTS
> +
> i386_use_watchpoints (t);
> +
> + i386_dr_low.set_control = i386bsd_dr_set_control;
> + i386_dr_low.set_addr = i386bsd_dr_set_addr;
> + i386_dr_low.reset_addr = i386bsd_dr_reset_addr;
> + i386_dr_low.get_status = i386bsd_dr_get_status;
> + i386_set_debug_register_length (4);
> +#endif /* I386_USE_GENERIC_WATCHPOINTS */
In this case, because the header file currently conditionally defines
I386_USE_GENERIC_WATCHPOINTS:
#ifdef HAVE_PT_GETDBREGS
#define I386_USE_GENERIC_WATCHPOINTS
#endif
you should move that condition to the i386fbsd-nat.c file:
#ifdef HAVE_PT_GETDBREGS
i386_use_watchpoints (t);
...
#endif
> diff -u -p -r1.189 windows-nat.c
> --- windows-nat.c 17 Apr 2009 15:44:28 -0000 1.189
> +++ windows-nat.c 8 May 2009 14:02:25 -0000
> @@ -2166,8 +2171,22 @@ init_windows_ops (void)
> windows_ops.to_has_execution = 1;
> windows_ops.to_pid_to_exec_file = windows_pid_to_exec_file;
> windows_ops.to_get_ada_task_ptid = windows_get_ada_task_ptid;
> +
> +#ifdef I386_USE_GENERIC_WATCHPOINTS
> +
> i386_use_watchpoints (&windows_ops);
>
> + i386_dr_low.set_control = cygwin_set_dr7;
> + i386_dr_low.set_addr = cygwin_set_dr;
> + i386_dr_low.reset_addr = NULL;
> + i386_dr_low.get_status = cygwin_get_dr6;
Here, it seems every user of windows-nat.c unconditionally
defines I386_USE_GENERIC_WATCHPOINTS, so there's no point in
adding the #ifdef's to this file ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2009-05-12 13:02 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 [this message]
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
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=200905121300.n4CD0vMQ003287@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=muller@ics.u-strasbg.fr \
--cc=pedro@codesourcery.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