Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed] Restore some windows-tdep.c code
@ 2020-04-19  1:41 Tom Tromey
  2020-04-19  1:43 ` Christian Biesinger
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2020-04-19  1:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

When I removed init_w32_command_list, I weirdly neglected to see if it
was called anywhere else.  This patch restores the function, which is
called from windows-nat.c.  Sorry about the breakage.

Is it possible to have a windows-native gdb that isn't also using
windows-tdep?

Anyway, I'm checking this in.

gdb/ChangeLog
2020-04-18  Tom Tromey  <tom@tromey.com>

	* windows-tdep.c (init_w32_command_list)
	(w32_prefix_command_valid): Restore.
	(_initialize_windows_tdep): Call init_w32_command_list.
---
 gdb/ChangeLog      |  6 ++++++
 gdb/windows-tdep.c | 20 ++++++++++++++++----
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 4af797f9469..e2b7960829f 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -602,6 +602,21 @@ show_maint_show_all_tib (struct ui_file *file, int from_tty,
 			    "Thread Information Block is %s.\n"), value);
 }
 
+
+static int w32_prefix_command_valid = 0;
+void
+init_w32_command_list (void)
+{
+  if (!w32_prefix_command_valid)
+    {
+      add_basic_prefix_cmd
+	("w32", class_info,
+	 _("Print information specific to Win32 debugging."),
+	 &info_w32_cmdlist, "info w32 ", 0, &infolist);
+      w32_prefix_command_valid = 1;
+    }
+}
+
 /* Implementation of `gdbarch_gdb_signal_to_target' for Windows.  */
 
 static int
@@ -1077,10 +1092,7 @@ _initialize_windows_tdep ()
   windows_gdbarch_data_handle
     = gdbarch_data_register_post_init (init_windows_gdbarch_data);
 
-  add_basic_prefix_cmd ("w32", class_info,
-			_("Print information specific to Win32 debugging."),
-			&info_w32_cmdlist, "info w32 ", 0, &infolist);
-
+  init_w32_command_list ();
   add_cmd ("thread-information-block", class_info, display_tib,
 	   _("Display thread information block."),
 	   &info_w32_cmdlist);
-- 
2.17.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pushed] Restore some windows-tdep.c code
  2020-04-19  1:41 [pushed] Restore some windows-tdep.c code Tom Tromey
@ 2020-04-19  1:43 ` Christian Biesinger
  2020-04-19 15:28   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Biesinger @ 2020-04-19  1:43 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Sat, Apr 18, 2020, 20:41 Tom Tromey <tom@tromey.com> wrote:

> When I removed init_w32_command_list, I weirdly neglected to see if it
> was called anywhere else.  This patch restores the function, which is
> called from windows-nat.c.  Sorry about the breakage.
>
> Is it possible to have a windows-native gdb that isn't also using
> windows-tdep?
>
> Anyway, I'm checking this in.
>
> gdb/ChangeLog
> 2020-04-18  Tom Tromey  <tom@tromey.com>
>
>         * windows-tdep.c (init_w32_command_list)
>         (w32_prefix_command_valid): Restore.
>         (_initialize_windows_tdep): Call init_w32_command_list.
> ---
>  gdb/ChangeLog      |  6 ++++++
>  gdb/windows-tdep.c | 20 ++++++++++++++++----
>  2 files changed, 22 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
> index 4af797f9469..e2b7960829f 100644
> --- a/gdb/windows-tdep.c
> +++ b/gdb/windows-tdep.c
> @@ -602,6 +602,21 @@ show_maint_show_all_tib (struct ui_file *file, int
> from_tty,
>                             "Thread Information Block is %s.\n"), value);
>  }
>
> +
> +static int w32_prefix_command_valid = 0;
> +void
> +init_w32_command_list (void)
> +{
> +  if (!w32_prefix_command_valid)
> +    {
> +      add_basic_prefix_cmd
> +       ("w32", class_info,
> +        _("Print information specific to Win32 debugging."),
> +        &info_w32_cmdlist, "info w32 ", 0, &infolist);
> +      w32_prefix_command_valid = 1;
>

Seems like this could be made a bool.

+    }
> +}
> +
>  /* Implementation of `gdbarch_gdb_signal_to_target' for Windows.  */
>
>  static int
> @@ -1077,10 +1092,7 @@ _initialize_windows_tdep ()
>    windows_gdbarch_data_handle
>      = gdbarch_data_register_post_init (init_windows_gdbarch_data);
>
> -  add_basic_prefix_cmd ("w32", class_info,
> -                       _("Print information specific to Win32
> debugging."),
> -                       &info_w32_cmdlist, "info w32 ", 0, &infolist);
> -
> +  init_w32_command_list ();
>    add_cmd ("thread-information-block", class_info, display_tib,
>            _("Display thread information block."),
>            &info_w32_cmdlist);
> --
> 2.17.2
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pushed] Restore some windows-tdep.c code
  2020-04-19  1:43 ` Christian Biesinger
@ 2020-04-19 15:28   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2020-04-19 15:28 UTC (permalink / raw)
  To: Christian Biesinger; +Cc: Tom Tromey, gdb-patches

>>>>> "Christian" == Christian Biesinger <cbiesinger@google.com> writes:

>  Is it possible to have a windows-native gdb that isn't also using
>  windows-tdep?

Christian>  +      w32_prefix_command_valid = 1;

Christian> Seems like this could be made a bool.

Yeah.  I just wanted to revert this bit to as close as possible to the
earlier code.

I guess I was thinking this flag could be removed, but I see now that
both windows-nat and windows-tdep install variables here.  So, I guess
it's needed.

Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-19 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-19  1:41 [pushed] Restore some windows-tdep.c code Tom Tromey
2020-04-19  1:43 ` Christian Biesinger
2020-04-19 15:28   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox