Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Simon Marchi <simon.marchi@ericsson.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Mostly trivial enum fixes
Date: Mon, 03 Aug 2015 09:40:00 -0000	[thread overview]
Message-ID: <86mvy8emmb.fsf@gmail.com> (raw)
In-Reply-To: <1438362504-6940-1-git-send-email-simon.marchi@ericsson.com>	(Simon Marchi's message of "Fri, 31 Jul 2015 13:08:24 -0400")

Simon Marchi <simon.marchi@ericsson.com> writes:

> -/* Get the ARM hardware breakpoint type from the RW value we're given when
> -   asked to set a watchpoint.  */
> +/* Get the ARM hardware breakpoint type from the type value we're
> +   given when asked to set a watchpoint.  */
>  static arm_hwbp_type 
> -arm_linux_get_hwbp_type (int rw)
> +arm_linux_get_hwbp_type (enum target_hw_bp_type type)
>  {
>    if (rw == hw_read)
>      return arm_hwbp_load;

Argument "rw" is updated to "type", but its uses inside function are not
updated.  This breaks GDB native build on arm-linux.  Patch below fixed
it.  Patch is pushed in.

-- 
Yao (齐尧)
From 8156fe7f47884390b7404af15903795bb607658b Mon Sep 17 00:00:00 2001
From: Yao Qi <yao.qi@linaro.org>
Date: Mon, 3 Aug 2015 10:37:23 +0100
Subject: [PATCH] Enum fix for arm-linux-nat.c

This patch fixes GDB build breakage on arm-linux.

gdb:

2015-08-03  Yao Qi  <yao.qi@linaro.org>

	* arm-linux-nat.c (arm_linux_get_hwbp_type): Capitalize "type"
	in comment.  Replace "rw" with "type".
	(arm_linux_remove_watchpoint): Change type of "rw" to
	"enum target_hw_bp_type".

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b8840fd..817610e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2015-08-03  Yao Qi  <yao.qi@linaro.org>
+
+	* arm-linux-nat.c (arm_linux_get_hwbp_type): Capitalize "type"
+	in comment.  Replace "rw" with "type".
+	(arm_linux_remove_watchpoint): Change type of "rw" to
+	"enum target_hw_bp_type".
+
 2015-08-02  Pierre-Marie de Rodat  <derodat@adacore.com>
 
 	* alpha-mdebug-tdep.c (find_proc_desc): Update call to
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index e2e43ac..825da4c 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -923,14 +923,14 @@ arm_linux_hw_breakpoint_initialize (struct gdbarch *gdbarch,
   p->control = arm_hwbp_control_initialize (mask, arm_hwbp_break, 1);
 }
 
-/* Get the ARM hardware breakpoint type from the type value we're
+/* Get the ARM hardware breakpoint type from the TYPE value we're
    given when asked to set a watchpoint.  */
 static arm_hwbp_type 
 arm_linux_get_hwbp_type (enum target_hw_bp_type type)
 {
-  if (rw == hw_read)
+  if (type == hw_read)
     return arm_hwbp_load;
-  else if (rw == hw_write)
+  else if (type == hw_write)
     return arm_hwbp_store;
   else
     return arm_hwbp_access;
@@ -1168,8 +1168,8 @@ arm_linux_insert_watchpoint (struct target_ops *self,
 
 /* Remove a hardware breakpoint.  */
 static int
-arm_linux_remove_watchpoint (struct target_ops *self,
-			     CORE_ADDR addr, int len, int rw,
+arm_linux_remove_watchpoint (struct target_ops *self, CORE_ADDR addr,
+			     int len, enum target_hw_bp_type rw,
 			     struct expression *cond)
 {
   struct lwp_info *lp;


      parent reply	other threads:[~2015-08-03  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 17:08 Simon Marchi
2015-07-31 17:18 ` Pedro Alves
2015-07-31 17:21   ` Simon Marchi
2015-08-03  9:40 ` Yao Qi [this message]

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=86mvy8emmb.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.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