PR29262, memory leak in pr_function_type
[binutils-gdb.git] / gdbserver / win32-i386-low.cc
index 389ec4928478d61371d547940502f5f387eb99ef..856040801e81ce12710d29b26aa8ba547303a1cb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -85,7 +85,7 @@ win32_get_current_dr (int dr)
   case DR:                                     \
     return th->wow64_context.Dr ## DR
 
-  if (wow64_process)
+  if (windows_process.wow64_process)
     {
       switch (dr)
        {
@@ -162,6 +162,7 @@ i386_supports_z_point_type (char z_type)
 {
   switch (z_type)
     {
+    case Z_PACKET_HW_BP:
     case Z_PACKET_WRITE_WP:
     case Z_PACKET_ACCESS_WP:
       return 1;
@@ -176,6 +177,7 @@ i386_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
 {
   switch (type)
     {
+    case raw_bkpt_type_hw:
     case raw_bkpt_type_write_wp:
     case raw_bkpt_type_access_wp:
       {
@@ -197,6 +199,7 @@ i386_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
 {
   switch (type)
     {
+    case raw_bkpt_type_hw:
     case raw_bkpt_type_write_wp:
     case raw_bkpt_type_access_wp:
       {
@@ -242,7 +245,7 @@ i386_get_thread_context (windows_thread_info *th)
 
  again:
 #ifdef __x86_64__
-  if (wow64_process)
+  if (windows_process.wow64_process)
     th->wow64_context.ContextFlags = (CONTEXT_FULL
                                      | CONTEXT_FLOATING_POINT
                                      | CONTEXT_DEBUG_REGISTERS
@@ -256,8 +259,8 @@ i386_get_thread_context (windows_thread_info *th)
 
   BOOL ret;
 #ifdef __x86_64__
-  if (wow64_process)
-    ret = win32_Wow64GetThreadContext (th->h, &th->wow64_context);
+  if (windows_process.wow64_process)
+    ret = Wow64GetThreadContext (th->h, &th->wow64_context);
   else
 #endif
     ret = GetThreadContext (th->h, &th->context);
@@ -285,7 +288,7 @@ i386_prepare_to_resume (windows_thread_info *th)
       win32_require_context (th);
 
 #ifdef __x86_64__
-      if (wow64_process)
+      if (windows_process.wow64_process)
        {
          th->wow64_context.Dr0 = dr->dr_mirror[0];
          th->wow64_context.Dr1 = dr->dr_mirror[1];
@@ -321,7 +324,7 @@ static void
 i386_single_step (windows_thread_info *th)
 {
 #ifdef __x86_64__
-  if (wow64_process)
+  if (windows_process.wow64_process)
     th->wow64_context.EFlags |= FLAG_TRACE_BIT;
   else
 #endif
@@ -463,7 +466,7 @@ i386_fetch_inferior_register (struct regcache *regcache,
 {
   const int *mappings;
 #ifdef __x86_64__
-  if (!wow64_process)
+  if (!windows_process.wow64_process)
     mappings = amd64_mappings;
   else
 #endif
@@ -471,7 +474,7 @@ i386_fetch_inferior_register (struct regcache *regcache,
 
   char *context_offset;
 #ifdef __x86_64__
-  if (wow64_process)
+  if (windows_process.wow64_process)
     context_offset = (char *) &th->wow64_context + mappings[r];
   else
 #endif
@@ -499,7 +502,7 @@ i386_store_inferior_register (struct regcache *regcache,
 {
   const int *mappings;
 #ifdef __x86_64__
-  if (!wow64_process)
+  if (!windows_process.wow64_process)
     mappings = amd64_mappings;
   else
 #endif
@@ -507,7 +510,7 @@ i386_store_inferior_register (struct regcache *regcache,
 
   char *context_offset;
 #ifdef __x86_64__
-  if (wow64_process)
+  if (windows_process.wow64_process)
     context_offset = (char *) &th->wow64_context + mappings[r];
   else
 #endif
@@ -547,7 +550,7 @@ i386_win32_num_regs (void)
 {
   int num_regs;
 #ifdef __x86_64__
-  if (!wow64_process)
+  if (!windows_process.wow64_process)
     num_regs = sizeof (amd64_mappings) / sizeof (amd64_mappings[0]);
   else
 #endif