Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/doco/commit] Make the "info dll" command available on all platform.
@ 2015-05-05 18:02 Joel Brobecker
  2015-05-05 18:35 ` Eli Zaretskii
  2015-05-06 11:53 ` Pedro Alves
  0 siblings, 2 replies; 5+ messages in thread
From: Joel Brobecker @ 2015-05-05 18:02 UTC (permalink / raw)
  To: gdb-patches

Hello,

A follow-up on a discussion we had a while back:
https://www.sourceware.org/ml/gdb-patches/2015-01/msg00050.html

The "info dll", an alias of the "info sharedlibrary" command, is
currently only defined in windows native versions. This patch makes
it universally available by moving the alias declaration to solib.c,
and adjusts the documentation accordingly.

Making it universally available has two benefits:
  - Windows users moving to a Unix platforms are still able to use
    the same command for getting the list of shared libraries;
  - Unix to Windows cross debuggers now provide that command also.

gdb/ChangeLog:

        * solib.c (_initialize_solib): Add "info dll" alias creation.
        * windows-nat.c (set_windows_aliases): Delete.
        (_initialize_windows_nat): Remove deprecated_init_ui_hook
        assignment.
        * NEWS: Add news entry about "info dll" now being available
        on all platforms.

gdb/doc/ChangeLog:

        * gdb.texinfo (Files): Add "info dll" documentation.
        (Cygwin Native): Remove "info dll" documentation.

Tested on x86_64-linux, no regression (obviously).

I'll push the patch once documentation is reviewed.
Note that I looked at getting rid of deprecated_init_ui_hook,
but I found that insight might still be needing it :-( (to be
confirmed, though, as my sources are fairly old).

Thanks,
-- 
Joel

---
 gdb/NEWS            | 3 +++
 gdb/doc/gdb.texinfo | 8 ++++----
 gdb/solib.c         | 1 +
 gdb/windows-nat.c   | 7 -------
 4 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/gdb/NEWS b/gdb/NEWS
index 651401d..0c7084a 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -23,6 +23,9 @@
   present in the debug info.  This typically includes the compiler version
   and may include things like its command line arguments.
 
+* The "info dll", an alias of the "info sharedlibrary" command,
+  is now available on all platforms.
+
 * Directory names supplied to the "set sysroot" commands may be
   prefixed with "target:" to tell GDB to access shared libraries from
   the target system, be it local or remote.  This replaces the prefix
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 9e2787d..19d8bb3 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -17854,6 +17854,10 @@ Print the names of the shared libraries which are currently loaded
 that match @var{regex}.  If @var{regex} is omitted then print
 all shared libraries that are loaded.
 
+@kindex info dll
+@item info dll @var{regex}
+This is an alias of @code{info sharedlibrary}.
+
 @kindex sharedlibrary
 @kindex share
 @item sharedlibrary @var{regex}
@@ -20701,10 +20705,6 @@ This command displays thread specific information stored in the
 Thread Information Block (readable on the X86 CPU family using @code{$fs}
 selector for 32-bit programs and @code{$gs} for 64-bit programs).
 
-@kindex info dll
-@item info dll
-This is a Cygwin-specific alias of @code{info shared}.
-
 @kindex set cygwin-exceptions
 @cindex debugging the Cygwin DLL
 @cindex Cygwin DLL, debugging
diff --git a/gdb/solib.c b/gdb/solib.c
index 358a0a2..0010c2f 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1675,6 +1675,7 @@ _initialize_solib (void)
 	   _("Load shared object library symbols for files matching REGEXP."));
   add_info ("sharedlibrary", info_sharedlibrary_command,
 	    _("Status of loaded shared object libraries."));
+  add_info_alias ("dll", "sharedlibrary", 1);
   add_com ("nosharedlibrary", class_files, no_shared_libraries,
 	   _("Unload all shared object library symbols."));
 
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index be5d7e8..701d2c5 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2502,12 +2502,6 @@ windows_target (void)
   return t;
 }
 
-static void
-set_windows_aliases (char *argv0)
-{
-  add_info_alias ("dll", "sharedlibrary", 1);
-}
-
 /* -Wmissing-prototypes */
 extern initialize_file_ftype _initialize_windows_nat;
 
@@ -2601,7 +2595,6 @@ Show whether to display kernel exceptions in child process."), NULL,
   add_cmd ("selector", class_info, display_selectors,
 	   _("Display selectors infos."),
 	   &info_w32_cmdlist);
-  deprecated_init_ui_hook = set_windows_aliases;
 }
 
 /* Hardware watchpoint support, adapted from go32-nat.c code.  */
-- 
1.9.1


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

* Re: [RFA/doco/commit] Make the "info dll" command available on all platform.
  2015-05-05 18:02 [RFA/doco/commit] Make the "info dll" command available on all platform Joel Brobecker
@ 2015-05-05 18:35 ` Eli Zaretskii
  2015-05-06 17:50   ` Joel Brobecker
  2015-05-06 11:53 ` Pedro Alves
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2015-05-05 18:35 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

> From: Joel Brobecker <brobecker@adacore.com>
> Date: Tue,  5 May 2015 11:02:49 -0700
> 
> A follow-up on a discussion we had a while back:
> https://www.sourceware.org/ml/gdb-patches/2015-01/msg00050.html
> 
> The "info dll", an alias of the "info sharedlibrary" command, is
> currently only defined in windows native versions. This patch makes
> it universally available by moving the alias declaration to solib.c,
> and adjusts the documentation accordingly.
> 
> Making it universally available has two benefits:
>   - Windows users moving to a Unix platforms are still able to use
>     the same command for getting the list of shared libraries;
>   - Unix to Windows cross debuggers now provide that command also.
> 
> gdb/ChangeLog:
> 
>         * solib.c (_initialize_solib): Add "info dll" alias creation.
>         * windows-nat.c (set_windows_aliases): Delete.
>         (_initialize_windows_nat): Remove deprecated_init_ui_hook
>         assignment.
>         * NEWS: Add news entry about "info dll" now being available
>         on all platforms.
> 
> gdb/doc/ChangeLog:
> 
>         * gdb.texinfo (Files): Add "info dll" documentation.
>         (Cygwin Native): Remove "info dll" documentation.

The documentation parts are OK.

Thanks.


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

* Re: [RFA/doco/commit] Make the "info dll" command available on all platform.
  2015-05-05 18:02 [RFA/doco/commit] Make the "info dll" command available on all platform Joel Brobecker
  2015-05-05 18:35 ` Eli Zaretskii
@ 2015-05-06 11:53 ` Pedro Alves
  2015-05-06 17:52   ` [pushed] Get rid of deprecated_init_ui_hook Joel Brobecker
  1 sibling, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2015-05-06 11:53 UTC (permalink / raw)
  To: Joel Brobecker, gdb-patches

On 05/05/2015 07:02 PM, Joel Brobecker wrote:

> Note that I looked at getting rid of deprecated_init_ui_hook,
> but I found that insight might still be needing it :-( (to be
> confirmed, though, as my sources are fairly old).
> 

From current insight git:

$ grep -rn deprecated_init_ui_hook
binutils-gdb/gdb/windows-nat.c:2604:  deprecated_init_ui_hook = set_windows_aliases;
binutils-gdb/gdb/ChangeLog-2004:9403:   (deprecated_memory_changed_hook, deprecated_init_ui_hook)
binutils-gdb/gdb/ChangeLog-2013:3969:   * top.c (quit_confirm): Remove use of deprecated_init_ui_hook.
binutils-gdb/gdb/ChangeLog-2013:4011:   to deprecated_init_ui_hook.
binutils-gdb/gdb/defs.h:637:   deprecated_init_ui_hook with the per-interpreter implementation.  */
binutils-gdb/gdb/defs.h:638:/* FIXME: deprecated_init_ui_hook should be moved here.  */
binutils-gdb/gdb/defs.h:647:extern void (*deprecated_init_ui_hook) (char *argv0);
binutils-gdb/gdb/interps.c:365:  deprecated_init_ui_hook = 0;
binutils-gdb/gdb/top.c:181:void (*deprecated_init_ui_hook) (char *argv0);
binutils-gdb/gdb/top.c:1975:     deprecated_init_ui_hook.  */
binutils-gdb/gdb/top.c:1976:  if (deprecated_init_ui_hook)
binutils-gdb/gdb/top.c:1977:    deprecated_init_ui_hook (argv0);
binutils-gdb/gdb/ChangeLog-2005:1299:   deprecated_init_ui_hook to allow late setting of "info dll" alias.
binutils-gdb/gdb/main.c:863:     control of the console via the deprecated_init_ui_hook ().  */
gdbtk/ChangeLog:227:    (_initialize_gdbtk): No longer set deprecated_init_ui_hook.

gdbtk/ChangeLog:
...
2013-09-20  Andrew Burgess  <aburgess@broadcom.com>

        * generic/gdbtk.c: Add include of "main.h".
        (gdbtk_init_1): Remove.
        (argv0): Remove.
        (_initialize_gdbtk): No longer set deprecated_init_ui_hook.
        (gdbtk_init): Use get_gdb_program_name function from main.h.
...

https://www.sourceware.org/ml/insight/2013-q3/msg00042.html

Thanks,
Pedro Alves


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

* Re: [RFA/doco/commit] Make the "info dll" command available on all platform.
  2015-05-05 18:35 ` Eli Zaretskii
@ 2015-05-06 17:50   ` Joel Brobecker
  0 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2015-05-06 17:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

> > gdb/ChangeLog:
> > 
> >         * solib.c (_initialize_solib): Add "info dll" alias creation.
> >         * windows-nat.c (set_windows_aliases): Delete.
> >         (_initialize_windows_nat): Remove deprecated_init_ui_hook
> >         assignment.
> >         * NEWS: Add news entry about "info dll" now being available
> >         on all platforms.
> > 
> > gdb/doc/ChangeLog:
> > 
> >         * gdb.texinfo (Files): Add "info dll" documentation.
> >         (Cygwin Native): Remove "info dll" documentation.
> 
> The documentation parts are OK.

Thank you, Eli. I've now pushed that patch to master.

-- 
Joel


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

* [pushed] Get rid of deprecated_init_ui_hook
  2015-05-06 11:53 ` Pedro Alves
@ 2015-05-06 17:52   ` Joel Brobecker
  0 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2015-05-06 17:52 UTC (permalink / raw)
  To: gdb-patches; +Cc: Pedro Alves

As demonstrated by Pedro in:
https://www.sourceware.org/ml/gdb-patches/2015-05/msg00095.html

This hook is no longer used, and can therefore be eliminated.

gdb/ChangeLog:

        * defs.h (deprecated_init_ui_hook): Delete.  Remove associated
        comment.
        * top.c (deprecated_init_ui_hook): Delete.
        (gdb_init): Remove handling of deprecated_init_ui_hook.
        * interps.c (clear_interpreter_hooks): Remove handling of
        deprecated_init_ui_hook.
        * main.c (captured_main): Update comment.

Tested on x86_64-linux and pushed.

Thanks!
-- 
Joel

---
 gdb/ChangeLog | 10 ++++++++++
 gdb/defs.h    |  5 -----
 gdb/interps.c |  1 -
 gdb/main.c    |  3 +--
 gdb/top.c     | 14 --------------
 5 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dd4bcad..8184af9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
 2015-05-06  Joel Brobecker  <brobecker@adacore.com>
 
+	* defs.h (deprecated_init_ui_hook): Delete.  Remove associated
+	comment.
+	* top.c (deprecated_init_ui_hook): Delete.
+	(gdb_init): Remove handling of deprecated_init_ui_hook.
+	* interps.c (clear_interpreter_hooks): Remove handling of
+	deprecated_init_ui_hook.
+	* main.c (captured_main): Update comment.
+
+2015-05-06  Joel Brobecker  <brobecker@adacore.com>
+
 	* solib.c (_initialize_solib): Add "info dll" alias creation.
 	* windows-nat.c (set_windows_aliases): Delete.
 	(_initialize_windows_nat): Remove deprecated_init_ui_hook
diff --git a/gdb/defs.h b/gdb/defs.h
index eda6741..29bb8c4 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -633,10 +633,6 @@ extern int watchdog;
 /* * The name of the interpreter if specified on the command line.  */
 extern char *interpreter_p;
 
-/* If a given interpreter matches INTERPRETER_P then it should update
-   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;
 
@@ -644,7 +640,6 @@ extern void (*deprecated_pre_add_symbol_hook) (const char *);
 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_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 90b5b2d..4c1e6cc 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -362,7 +362,6 @@ interp_exec (struct interp *interp, const char *command_str)
 void
 clear_interpreter_hooks (void)
 {
-  deprecated_init_ui_hook = 0;
   deprecated_print_frame_info_listing_hook = 0;
   /*print_frame_more_info_hook = 0; */
   deprecated_query_hook = 0;
diff --git a/gdb/main.c b/gdb/main.c
index 477fd68..aecd60a 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -859,8 +859,7 @@ captured_main (void *data)
   /* Try to set up an alternate signal stack for SIGSEGV handlers.  */
   setup_alternate_signal_stack ();
 
-  /* Initialize all files.  Give the interpreter a chance to take
-     control of the console via the deprecated_init_ui_hook ().  */
+  /* Initialize all files.  */
   gdb_init (gdb_program_name);
 
   /* Now that gdb_init has created the initial inferior, we're in
diff --git a/gdb/top.c b/gdb/top.c
index ddf5415..deb4108 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -172,14 +172,6 @@ char *lim_at_start;
 
 /* Hooks for alternate command interfaces.  */
 
-/* Called after most modules have been initialized, but before taking
-   users command file.
-
-   If the UI fails to initialize and it wants GDB to continue using
-   the default UI, then it should clear this hook before returning.  */
-
-void (*deprecated_init_ui_hook) (char *argv0);
-
 /* This hook is called from within gdb's many mini-event loops which
    could steal control from a real user interface's event loop.  It
    returns non-zero if the user is requesting a detach, zero
@@ -1970,12 +1962,6 @@ gdb_init (char *argv0)
   set_language (language_c);
   expected_language = current_language;	/* Don't warn about the change.  */
 
-  /* Allow another UI to initialize.  If the UI fails to initialize,
-     and it wants GDB to revert to the CLI, it should clear
-     deprecated_init_ui_hook.  */
-  if (deprecated_init_ui_hook)
-    deprecated_init_ui_hook (argv0);
-
   /* Python initialization, for example, can require various commands to be
      installed.  For example "info pretty-printer" needs the "info"
      prefix to be installed.  Keep things simple and just do final
-- 
1.9.1


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

end of thread, other threads:[~2015-05-06 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-05 18:02 [RFA/doco/commit] Make the "info dll" command available on all platform Joel Brobecker
2015-05-05 18:35 ` Eli Zaretskii
2015-05-06 17:50   ` Joel Brobecker
2015-05-06 11:53 ` Pedro Alves
2015-05-06 17:52   ` [pushed] Get rid of deprecated_init_ui_hook Joel Brobecker

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