public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 13/13] Remove arm_override_mode
Date: Wed, 31 Aug 2016 15:06:00 -0000	[thread overview]
Message-ID: <1472655965-12212-14-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1472655965-12212-1-git-send-email-yao.qi@linaro.org>

GDB can determine the kind of single step breakpoint by gdbarch
breakpoint_kind_from_current_state, so global variable
arm_override_mode is no longer needed.  This patch removes it.

gdb:

2016-08-30  Yao Qi  <yao.qi@linaro.org>

	* arm-tdep.c (arm_override_mode): Remove.
	(arm_pc_is_thumb): Update.
	(arm_insert_single_step_breakpoint): Update.
---
 gdb/arm-tdep.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 37b68ed..3e5a775 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -143,13 +143,6 @@ static const char *const arm_mode_strings[] =
 static const char *arm_fallback_mode_string = "auto";
 static const char *arm_force_mode_string = "auto";
 
-/* Internal override of the execution mode.  -1 means no override,
-   0 means override to ARM mode, 1 means override to Thumb mode.
-   The effect is the same as if arm_force_mode has been set by the
-   user (except the internal override has precedence over a user's
-   arm_force_mode override).  */
-static int arm_override_mode = -1;
-
 /* Number of different reg name sets (options).  */
 static int num_disassembly_options;
 
@@ -422,10 +415,6 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr)
   if (IS_THUMB_ADDR (memaddr))
     return 1;
 
-  /* Respect internal mode override if active.  */
-  if (arm_override_mode != -1)
-    return arm_override_mode;
-
   /* If the user wants to override the symbol table, let him.  */
   if (strcmp (arm_force_mode_string, "arm") == 0)
     return 0;
@@ -4204,15 +4193,9 @@ arm_insert_single_step_breakpoint (struct gdbarch *gdbarch,
 				   struct address_space *aspace,
 				   CORE_ADDR pc)
 {
-  struct cleanup *old_chain
-    = make_cleanup_restore_integer (&arm_override_mode);
-
-  arm_override_mode = IS_THUMB_ADDR (pc);
   pc = gdbarch_addr_bits_remove (gdbarch, pc);
 
   insert_single_step_breakpoint (gdbarch, aspace, pc);
-
-  do_cleanups (old_chain);
 }
 
 /* Given BUF, which is OLD_LEN bytes ending at ENDADDR, expand
-- 
1.9.1

  parent reply	other threads:[~2016-08-31 15:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 15:06 [PATCH 00/13] Split brekapoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind Yao Qi
2016-08-31 15:06 ` [PATCH 03/13] gdbarch_breakpoint_from_pc doesn't return NULL Yao Qi
2016-09-28 15:23   ` Michael Eager
2016-08-31 15:06 ` [PATCH 11/13] Add default_breakpoint_from_pc Yao Qi
2016-08-31 15:06 ` [PATCH 01/13] Remove v850_dbtrap_breakpoint_from_pc Yao Qi
2016-08-31 15:06 ` [PATCH 05/13] Share enum arm_breakpoint_kinds Yao Qi
2016-08-31 15:06 ` [PATCH 12/13] Determine the kind of single step breakpoint Yao Qi
2016-10-27 14:55   ` Pedro Alves
2016-08-31 15:06 ` [PATCH 06/13] Add enum for mips breakpoint kinds Yao Qi
2016-10-27 14:54   ` Pedro Alves
2016-10-28 19:39     ` Maciej W. Rozycki
2016-08-31 15:06 ` [PATCH 07/13] Split brekapoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind Yao Qi
2016-10-10 10:05   ` Yao Qi
2016-10-27 14:55   ` Pedro Alves
2016-10-28 19:44     ` Maciej W. Rozycki
2016-08-31 15:06 ` [PATCH 08/13] New gdbarch methods " Yao Qi
2016-08-31 15:06 ` [PATCH 02/13] Rename 'arch' by 'gdbarch' in m32c_gdbarch_init Yao Qi
2016-08-31 15:06 ` [PATCH 09/13] Rename placed_size to kind Yao Qi
2016-08-31 15:06 ` [PATCH 04/13] GDBARCH_BREAKPOINT_MANIPULATION and SET_GDBARCH_BREAKPOINT_MANIPULATION Yao Qi
2016-08-31 15:06 ` Yao Qi [this message]
2016-10-27 14:56   ` [PATCH 13/13] Remove arm_override_mode Pedro Alves
2016-08-31 15:06 ` [PATCH 10/13] Remove gdbarch_remote_breakpoint_from_pc Yao Qi
2016-10-27 14:55   ` Pedro Alves
2016-10-10 10:17 ` [PATCH 00/13] Split brekapoint_from_pc to breakpoint_kind_from_pc and sw_breakpoint_from_kind Yao Qi
2016-10-26 15:43   ` Yao Qi
2016-10-27 14:58     ` Pedro Alves
2016-10-27 15:41       ` Yao Qi
2016-10-27 17:55         ` Pedro Alves

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=1472655965-12212-14-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).