[28/34] Windows gdb: cygwin_set_dr => windows_set_dr, etc.

Message ID 20240507234233.371123-29-pedro@palves.net
State New
Headers
Series Windows non-stop mode |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Pedro Alves May 7, 2024, 11:42 p.m. UTC
  The Windows backend functions that manipulate the x86 debug registers
are called "cygwin_foo", which is outdated, because native MinGW gdb
also uses those functions, they are not Cygwin-specific.  Rename them
to "windows_foo" to avoid confusion.

Change-Id: I46df3b44f5272adadf960da398342a3cbdb98533
---
 gdb/windows-nat.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)
  

Comments

Tom Tromey May 8, 2024, 2:46 p.m. UTC | #1
>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:

Pedro> The Windows backend functions that manipulate the x86 debug registers
Pedro> are called "cygwin_foo", which is outdated, because native MinGW gdb
Pedro> also uses those functions, they are not Cygwin-specific.  Rename them
Pedro> to "windows_foo" to avoid confusion.

Thank you.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  

Patch

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 42d98badc4c..6e72f99c3f5 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -214,11 +214,11 @@  enum
   debug_prefixed_printf_cond (debug_exceptions, "windows except", fmt, \
 			      ## __VA_ARGS__)
 
-static void cygwin_set_dr (int i, CORE_ADDR addr);
-static void cygwin_set_dr7 (unsigned long val);
-static CORE_ADDR cygwin_get_dr (int i);
-static unsigned long cygwin_get_dr6 (void);
-static unsigned long cygwin_get_dr7 (void);
+static void windows_set_dr (int i, CORE_ADDR addr);
+static void windows_set_dr7 (unsigned long val);
+static CORE_ADDR windows_get_dr (int i);
+static unsigned long windows_get_dr6 (void);
+static unsigned long windows_get_dr7 (void);
 
 /* User options.  */
 static bool new_console = false;
@@ -3194,11 +3194,11 @@  void _initialize_windows_nat ();
 void
 _initialize_windows_nat ()
 {
-  x86_dr_low.set_control = cygwin_set_dr7;
-  x86_dr_low.set_addr = cygwin_set_dr;
-  x86_dr_low.get_addr = cygwin_get_dr;
-  x86_dr_low.get_status = cygwin_get_dr6;
-  x86_dr_low.get_control = cygwin_get_dr7;
+  x86_dr_low.set_control = windows_set_dr7;
+  x86_dr_low.set_addr = windows_set_dr;
+  x86_dr_low.get_addr = windows_get_dr;
+  x86_dr_low.get_status = windows_get_dr6;
+  x86_dr_low.get_control = windows_get_dr7;
 
   /* x86_dr_low.debug_register_length field is set by
      calling x86_set_debug_register_length function
@@ -3301,10 +3301,10 @@  Use \"file\" or \"dll\" command to load executable/libraries directly."));
    Here we just store the address in dr array, the registers will be
    actually set up when windows_continue is called.  */
 static void
-cygwin_set_dr (int i, CORE_ADDR addr)
+windows_set_dr (int i, CORE_ADDR addr)
 {
   if (i < 0 || i > 3)
-    internal_error (_("Invalid register %d in cygwin_set_dr.\n"), i);
+    internal_error (_("Invalid register %d in windows_set_dr.\n"), i);
 
   for (auto &th : windows_process.thread_list)
     th->debug_registers_changed = true;
@@ -3314,7 +3314,7 @@  cygwin_set_dr (int i, CORE_ADDR addr)
    register.  Here we just store the address in D_REGS, the watchpoint
    will be actually set up in windows_wait.  */
 static void
-cygwin_set_dr7 (unsigned long val)
+windows_set_dr7 (unsigned long val)
 {
   for (auto &th : windows_process.thread_list)
     th->debug_registers_changed = true;
@@ -3323,7 +3323,7 @@  cygwin_set_dr7 (unsigned long val)
 /* Get the value of debug register I from the inferior.  */
 
 static CORE_ADDR
-cygwin_get_dr (int i)
+windows_get_dr (int i)
 {
   windows_thread_info *th = windows_process.find_thread (inferior_ptid);
 
@@ -3375,18 +3375,18 @@  cygwin_get_dr (int i)
    inferior.  */
 
 static unsigned long
-cygwin_get_dr6 (void)
+windows_get_dr6 (void)
 {
-  return cygwin_get_dr (6);
+  return windows_get_dr (6);
 }
 
 /* Get the value of the DR7 debug status register from the
    inferior.  */
 
 static unsigned long
-cygwin_get_dr7 (void)
+windows_get_dr7 (void)
 {
-  return cygwin_get_dr (7);
+  return windows_get_dr (7);
 }
 
 /* Determine if the thread referenced by "ptid" is alive