Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Remove deprecated_command_loop_hook
@ 2013-09-05 16:04 Andrew Burgess
  2013-09-05 16:31 ` Pedro Alves
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Burgess @ 2013-09-05 16:04 UTC (permalink / raw)
  To: gdb-patches

With these two patches having been committed:
  https://sourceware.org/ml/gdb-patches/2013-08/msg00872.html
  https://sourceware.org/ml/insight/2013-q3/msg00029.html

deprecated_command_loop_hook is no longer used.

This patch removes it.

OK to apply?

Thanks,
Andrew

2013-09-05  Andrew Burgess  <aburgess@broadcom.com>

	* gdb/defs.h (deprecated_command_loop_hook): Remove, including
	references in comments.
	* gdb/interps.c (current_interp_command_loop): No longer use
	deprecated_command_loop_hook.
	(clear_interpreter_hooks): Remove deprecated_command_loop_hook
	setup.
	* gdb/top.c (deprecated_command_loop_hook): Remove.


diff --git a/gdb/defs.h b/gdb/defs.h
index 1e5521f..50b9bfe 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -703,10 +703,8 @@ extern int watchdog;
 extern char *interpreter_p;
 
 /* If a given interpreter matches INTERPRETER_P then it should update
-   deprecated_command_loop_hook and deprecated_init_ui_hook with the
-   per-interpreter implementation.  */
-/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook
-   should be moved here.  */
+   deprecated_init_ui_hook with the per-interpreter implementation.  */
+/* FIXME: deprecated_init_ui_hook should be moved here.  */
 
 struct target_waitstatus;
 struct cmd_list_element;
@@ -716,7 +714,6 @@ extern void (*deprecated_post_add_symbol_hook) (void);
 extern void (*selected_frame_level_changed_hook) (int);
 extern int (*deprecated_ui_loop_hook) (int signo);
 extern void (*deprecated_init_ui_hook) (char *argv0);
-extern void (*deprecated_command_loop_hook) (void);
 extern void (*deprecated_show_load_progress) (const char *section,
 					      unsigned long section_sent, 
 					      unsigned long section_size, 
diff --git a/gdb/interps.c b/gdb/interps.c
index 25500d6..33e0f72 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -320,12 +320,9 @@ void
 current_interp_command_loop (void)
 {
   /* Somewhat messy.  For the moment prop up all the old ways of
-     selecting the command loop.  `deprecated_command_loop_hook'
-     should be deprecated.  */
-  if (deprecated_command_loop_hook != NULL)
-    deprecated_command_loop_hook ();
-  else if (current_interpreter != NULL
-	   && current_interpreter->procs->command_loop_proc != NULL)
+     selecting the command loop.  */
+  if (current_interpreter != NULL
+      && current_interpreter->procs->command_loop_proc != NULL)
     current_interpreter->procs->command_loop_proc (current_interpreter->data);
   else
     cli_command_loop ();
@@ -386,7 +383,6 @@ clear_interpreter_hooks (void)
   deprecated_target_wait_hook = 0;
   deprecated_call_command_hook = 0;
   deprecated_error_begin_hook = 0;
-  deprecated_command_loop_hook = 0;
 }
 
 /* This is a lazy init routine, called the first time the interpreter
diff --git a/gdb/top.c b/gdb/top.c
index bb71263..b3e7d37 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -199,11 +199,6 @@ void (*deprecated_init_ui_hook) (char *argv0);
 
 int (*deprecated_ui_loop_hook) (int);
 
-/* Called instead of command_loop at top level.  Can be invoked via
-   throw_exception().  */
-
-void (*deprecated_command_loop_hook) (void);
-
 
 /* Called from print_frame_info to list the line we stopped in.  */
 


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

* Re: [PATCH] Remove deprecated_command_loop_hook
  2013-09-05 16:04 [PATCH] Remove deprecated_command_loop_hook Andrew Burgess
@ 2013-09-05 16:31 ` Pedro Alves
  2013-09-05 17:01   ` Andrew Burgess
  0 siblings, 1 reply; 7+ messages in thread
From: Pedro Alves @ 2013-09-05 16:31 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

On 09/05/2013 05:04 PM, Andrew Burgess wrote:

> 2013-09-05  Andrew Burgess  <aburgess@broadcom.com>
> 
> 	* gdb/defs.h (deprecated_command_loop_hook): Remove, including
> 	references in comments.
> 	* gdb/interps.c (current_interp_command_loop): No longer use
> 	deprecated_command_loop_hook.
> 	(clear_interpreter_hooks): Remove deprecated_command_loop_hook
> 	setup.
> 	* gdb/top.c (deprecated_command_loop_hook): Remove.

OK.

Thanks!

-- 
Pedro Alves


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

* Re: [PATCH] Remove deprecated_command_loop_hook
  2013-09-05 16:31 ` Pedro Alves
@ 2013-09-05 17:01   ` Andrew Burgess
  2013-09-06  8:28     ` Andrew Burgess
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Burgess @ 2013-09-05 17:01 UTC (permalink / raw)
  To: gdb-patches

On 05/09/2013 5:31 PM, Pedro Alves wrote:
> On 09/05/2013 05:04 PM, Andrew Burgess wrote:
> 
>> 2013-09-05  Andrew Burgess  <aburgess@broadcom.com>
>>
>> 	* gdb/defs.h (deprecated_command_loop_hook): Remove, including
>> 	references in comments.
>> 	* gdb/interps.c (current_interp_command_loop): No longer use
>> 	deprecated_command_loop_hook.
>> 	(clear_interpreter_hooks): Remove deprecated_command_loop_hook
>> 	setup.
>> 	* gdb/top.c (deprecated_command_loop_hook): Remove.
> 
> OK.

Committed.

Thanks,
Andrew



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

* Re: [PATCH] Remove deprecated_command_loop_hook
  2013-09-05 17:01   ` Andrew Burgess
@ 2013-09-06  8:28     ` Andrew Burgess
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2013-09-06  8:28 UTC (permalink / raw)
  To: gdb-patches

On 05/09/2013 6:00 PM, Andrew Burgess wrote:
> On 05/09/2013 5:31 PM, Pedro Alves wrote:
>> On 09/05/2013 05:04 PM, Andrew Burgess wrote:
>>
>>> 2013-09-05  Andrew Burgess  <aburgess@broadcom.com>
>>>
>>> 	* gdb/defs.h (deprecated_command_loop_hook): Remove, including
>>> 	references in comments.
>>> 	* gdb/interps.c (current_interp_command_loop): No longer use
>>> 	deprecated_command_loop_hook.
>>> 	(clear_interpreter_hooks): Remove deprecated_command_loop_hook
>>> 	setup.
>>> 	* gdb/top.c (deprecated_command_loop_hook): Remove.
>>
>> OK.
> 
> Committed.

Apologies, I got the filenames wrong in the above changelog entry.  I've
committed the following patch to fix them.

Once again, sorry for the mistake.
Andrew

Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.15982
diff -u -p -r1.15982 ChangeLog
--- gdb/ChangeLog	6 Sep 2013 08:23:46 -0000	1.15982
+++ gdb/ChangeLog	6 Sep 2013 08:25:09 -0000
@@ -11,13 +11,13 @@

 2013-09-05  Andrew Burgess  <aburgess@broadcom.com>

-	* gdb/defs.h (deprecated_command_loop_hook): Remove, including
+	* defs.h (deprecated_command_loop_hook): Remove, including
 	references in comments.
-	* gdb/interps.c (current_interp_command_loop): No longer use
+	* interps.c (current_interp_command_loop): No longer use
 	deprecated_command_loop_hook.
 	(clear_interpreter_hooks): Remove deprecated_command_loop_hook
 	setup.
-	* gdb/top.c (deprecated_command_loop_hook): Remove.
+	* top.c (deprecated_command_loop_hook): Remove.

 2013-09-05  Pedro Alves  <palves@redhat.com>




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

* Re: [PATCH] Remove deprecated_command_loop_hook
  2013-08-21 18:56 ` Stan Shebs
@ 2013-08-22  0:18   ` Andrew Burgess
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Burgess @ 2013-08-22  0:18 UTC (permalink / raw)
  To: gdb-patches

On 21/08/2013 7:56 PM, Stan Shebs wrote:
> On 8/21/13 11:09 AM, Andrew Burgess wrote:
>> Small patch to remove deprecated_command_loop_hook.
>>
>> OK to apply?
> 
> FYI, this hook is essential to gdbtk, which uses it to connect into its
> main command loop.  It's not obvious to me whether it would be easy or
> hard to rewrite gdbtk to not need it.

It looks like deprecated_command_loop_hook is used in gdbtk just like
it's used in the MI code.  I've submitted a patch to gdbtk that removes
the use:
  http://sourceware.org/ml/insight/2013-q3/msg00029.html

Thanks,
Andrew


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

* Re: [PATCH] Remove deprecated_command_loop_hook
  2013-08-21 18:09 Andrew Burgess
@ 2013-08-21 18:56 ` Stan Shebs
  2013-08-22  0:18   ` Andrew Burgess
  0 siblings, 1 reply; 7+ messages in thread
From: Stan Shebs @ 2013-08-21 18:56 UTC (permalink / raw)
  To: gdb-patches

On 8/21/13 11:09 AM, Andrew Burgess wrote:
> Small patch to remove deprecated_command_loop_hook.
> 
> OK to apply?

FYI, this hook is essential to gdbtk, which uses it to connect into its
main command loop.  It's not obvious to me whether it would be easy or
hard to rewrite gdbtk to not need it.

Stan
stan@codesourcery.com


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

* [PATCH] Remove deprecated_command_loop_hook
@ 2013-08-21 18:09 Andrew Burgess
  2013-08-21 18:56 ` Stan Shebs
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Burgess @ 2013-08-21 18:09 UTC (permalink / raw)
  To: gdb-patches

Small patch to remove deprecated_command_loop_hook.

OK to apply?

Thanks,
Andrew

gdb/ChangeLog

2013-08-21  Andrew Burgess  <aburgess@broadcom.com>

	* defs.h (deprecated_command_loop_hook): Remove, and remove
	reference in comment.
	* interps.c (current_interp_command_loop): Remove use of
	deprecated_command_loop_hook.
	(clear_interpreter_hooks): Same.
	* mi/mi-common.h (struct mi_interp): Add mi version number.
	* mi/mi-interp.c (mi_command_loop): Change signature, pull
	version number from cookie.
	(mi1_command_loop): Delete.
	(mi2_command_loop): Delete.
	(mi3_command_loop): Delete.
	(mi_interpreter_init): Add the mi version to the data cookie.
	(mi_interoreter_resume): Remove use of
	deprecated_command_loop_hook.
	(_initialize_mi_interp): Add mi_command_loop to interpreter procs.
	* top.c (deprecated_command_loop_hook): Remove.


diff --git a/gdb/defs.h b/gdb/defs.h
index 014d7d4..6117b00 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -702,10 +702,8 @@ extern int watchdog;
 extern char *interpreter_p;
 
 /* If a given interpreter matches INTERPRETER_P then it should update
-   deprecated_command_loop_hook and deprecated_init_ui_hook with the
-   per-interpreter implementation.  */
-/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook
-   should be moved here.  */
+   deprecated_init_ui_hook with the per-interpreter implementation.  */
+/* FIXME: deprecated_init_ui_hook should be moved here.  */
 
 struct target_waitstatus;
 struct cmd_list_element;
@@ -715,7 +713,6 @@ extern void (*deprecated_post_add_symbol_hook) (void);
 extern void (*selected_frame_level_changed_hook) (int);
 extern int (*deprecated_ui_loop_hook) (int signo);
 extern void (*deprecated_init_ui_hook) (char *argv0);
-extern void (*deprecated_command_loop_hook) (void);
 extern void (*deprecated_show_load_progress) (const char *section,
 					      unsigned long section_sent, 
 					      unsigned long section_size, 
diff --git a/gdb/interps.c b/gdb/interps.c
index 25500d6..33e0f72 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -320,12 +320,9 @@ void
 current_interp_command_loop (void)
 {
   /* Somewhat messy.  For the moment prop up all the old ways of
-     selecting the command loop.  `deprecated_command_loop_hook'
-     should be deprecated.  */
-  if (deprecated_command_loop_hook != NULL)
-    deprecated_command_loop_hook ();
-  else if (current_interpreter != NULL
-	   && current_interpreter->procs->command_loop_proc != NULL)
+     selecting the command loop.  */
+  if (current_interpreter != NULL
+      && current_interpreter->procs->command_loop_proc != NULL)
     current_interpreter->procs->command_loop_proc (current_interpreter->data);
   else
     cli_command_loop ();
@@ -386,7 +383,6 @@ clear_interpreter_hooks (void)
   deprecated_target_wait_hook = 0;
   deprecated_call_command_hook = 0;
   deprecated_error_begin_hook = 0;
-  deprecated_command_loop_hook = 0;
 }
 
 /* This is a lazy init routine, called the first time the interpreter
diff --git a/gdb/mi/mi-common.h b/gdb/mi/mi-common.h
index 3590897..a3b48bc 100644
--- a/gdb/mi/mi-common.h
+++ b/gdb/mi/mi-common.h
@@ -60,6 +60,9 @@ struct mi_interp
   /* MI's builder.  */
   struct ui_out *uiout;
 
+  /* The version of the mi we're running.  */
+  int version;
+
   /* This is the interpreter for the mi... */
   struct interp *mi2_interp;
   struct interp *mi1_interp;
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index e370a57..aaf2869 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -43,7 +43,7 @@
 
 static void mi_execute_command_wrapper (const char *cmd);
 static void mi_execute_command_input_handler (char *cmd);
-static void mi_command_loop (int mi_version);
+static void mi_command_loop (void *data);
 
 /* These are hooks that we put in place while doing interpreter_exec
    so we can report interesting things that happened "behind the MI's
@@ -52,10 +52,6 @@ static void mi_command_loop (int mi_version);
 static int mi_interp_query_hook (const char *ctlstr, va_list ap)
   ATTRIBUTE_PRINTF (1, 0);
 
-static void mi3_command_loop (void);
-static void mi2_command_loop (void);
-static void mi1_command_loop (void);
-
 static void mi_insert_notify_hooks (void);
 static void mi_remove_notify_hooks (void);
 static void mi_on_normal_stop (struct bpstats *bs, int print_frame);
@@ -89,7 +85,6 @@ mi_interpreter_init (struct interp *interp, int top_level)
 {
   struct mi_interp *mi = XMALLOC (struct mi_interp);
   const char *name;
-  int mi_version;
 
   /* Assign the output channel created at startup to its own global,
      so that we can create a console channel that encapsulates and
@@ -110,17 +105,17 @@ mi_interpreter_init (struct interp *interp, int top_level)
   /* INTERP_MI selects the most recent released version.  "mi2" was
      released as part of GDB 6.0.  */
   if (strcmp (name, INTERP_MI) == 0)
-    mi_version = 2;
+    mi->version = 2;
   else if (strcmp (name, INTERP_MI1) == 0)
-    mi_version = 1;
+    mi->version = 1;
   else if (strcmp (name, INTERP_MI2) == 0)
-    mi_version = 2;
+    mi->version = 2;
   else if (strcmp (name, INTERP_MI3) == 0)
-    mi_version = 3;
+    mi->version = 3;
   else
     gdb_assert_not_reached ("unhandled MI version");
 
-  mi->uiout = mi_out_new (mi_version);
+  mi->uiout = mi_out_new (mi->version);
 
   if (top_level)
     {
@@ -193,16 +188,6 @@ mi_interpreter_resume (void *data)
 
   deprecated_show_load_progress = mi_load_progress;
 
-  /* If we're _the_ interpreter, take control.  */
-  if (current_interp_named_p (INTERP_MI1))
-    deprecated_command_loop_hook = mi1_command_loop;
-  else if (current_interp_named_p (INTERP_MI2))
-    deprecated_command_loop_hook = mi2_command_loop;
-  else if (current_interp_named_p (INTERP_MI3))
-    deprecated_command_loop_hook = mi3_command_loop;
-  else
-    deprecated_command_loop_hook = mi2_command_loop;
-
   return 1;
 }
 
@@ -322,26 +307,11 @@ mi_execute_command_input_handler (char *cmd)
 }
 
 static void
-mi1_command_loop (void)
-{
-  mi_command_loop (1);
-}
-
-static void
-mi2_command_loop (void)
+mi_command_loop (void *data)
 {
-  mi_command_loop (2);
-}
-
-static void
-mi3_command_loop (void)
-{
-  mi_command_loop (3);
-}
+  struct mi_interp *mi = data;
+  int mi_version = mi->version;
 
-static void
-mi_command_loop (int mi_version)
-{
   /* Turn off 8 bit strings in quoted output.  Any character with the
      high bit set is printed using C's octal format.  */
   sevenbit_strings = 1;
@@ -996,7 +966,8 @@ _initialize_mi_interp (void)
       mi_interpreter_exec,	/* exec_proc */
       mi_interpreter_prompt_p,	/* prompt_proc_p */
       mi_ui_out, 		/* ui_out_proc */
-      mi_set_logging		/* set_logging_proc */
+      mi_set_logging,		/* set_logging_proc */
+      mi_command_loop		/* command_loop_proc */
     };
 
   /* The various interpreter levels.  */
diff --git a/gdb/top.c b/gdb/top.c
index 516ffb9..95ee462 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -199,12 +199,6 @@ void (*deprecated_init_ui_hook) (char *argv0);
 
 int (*deprecated_ui_loop_hook) (int);
 
-/* Called instead of command_loop at top level.  Can be invoked via
-   throw_exception().  */
-
-void (*deprecated_command_loop_hook) (void);
-
-
 /* Called from print_frame_info to list the line we stopped in.  */
 
 void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, 


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

end of thread, other threads:[~2013-09-06  8:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05 16:04 [PATCH] Remove deprecated_command_loop_hook Andrew Burgess
2013-09-05 16:31 ` Pedro Alves
2013-09-05 17:01   ` Andrew Burgess
2013-09-06  8:28     ` Andrew Burgess
  -- strict thread matches above, loose matches on Subject: below --
2013-08-21 18:09 Andrew Burgess
2013-08-21 18:56 ` Stan Shebs
2013-08-22  0:18   ` Andrew Burgess

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