public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Change alias creation functions to accept target as cmd_list_element
@ 2021-05-18 20:23 Simon Marchi
  2021-05-18 20:23 ` [PATCH 1/8] gdb: make add_setshow commands return set_show_commands Simon Marchi
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Simon Marchi @ 2021-05-18 20:23 UTC (permalink / raw)
  To: gdb-patches

Following this patch:

    https://sourceware.org/pipermail/gdb-patches/2021-May/178881.html

I realized that we didn't support creating a command alias before the
command it aliases.  Although this doesn't happen normally, the fact
that alias creation functions accept the target command as a string (the
target command name) make it possible to happen.

I tried reversing the order of the calls of the initialize functions, to
see if there were any unintended dependencies between them.  For
example, a command created in a file and an alias for this command
created in another file.  This exposed one case where an alias is
created before a prefix of its target function, which made the alias
creation fail.

This fix this, this series changes all alias creation functions to take
the target command as a cmd_list_element.  This forces the target
command to be created before the alias.

Finally, it adds a runtime option (an environment variable) to reverse
the calls of the initialize functions, and a test is built using that.

Simon Marchi (8):
  gdb: make add_setshow commands return set_show_commands
  gdb: remove unnecessary lookup_cmd when deprecating commands
  gdb/python: use return values of add_setshow functions in
    add_setshow_generic
  gdb: make add_com_alias accept target as a cmd_list_element
  gdb: make add_info_alias accept target as a cmd_list_element
  gdb: remove add_alias_cmd overload that accepts a string
  gdb: add make-init-c script
  gdb: add option to reverse order of _initialize function calls

 gdb/Makefile.in                               |  51 ++--
 gdb/arch-utils.c                              |  16 +-
 gdb/bpf-tdep.c                                |   2 +-
 gdb/breakpoint.c                              |  78 +++---
 gdb/cli/cli-cmds.c                            |  67 ++---
 gdb/cli/cli-decode.c                          | 244 +++++++++---------
 gdb/command.h                                 | 229 ++++++----------
 gdb/compile/compile.c                         |   2 +-
 gdb/corefile.c                                |  14 +-
 gdb/cp-support.c                              |  12 +-
 gdb/disasm.c                                  |   9 +-
 gdb/gcore.c                                   |   5 +-
 gdb/gnu-nat.c                                 |  54 ++--
 gdb/guile/guile.c                             |  41 +--
 gdb/infcmd.c                                  |  60 +++--
 gdb/infrun.c                                  |   5 +-
 gdb/language.c                                |  24 +-
 gdb/macrocmd.c                                |  15 +-
 gdb/maint.c                                   |  19 +-
 gdb/make-init-c                               |  63 +++++
 gdb/mi/mi-main.c                              |  26 +-
 gdb/mips-tdep.c                               |  25 +-
 gdb/objc-lang.c                               |   7 +-
 gdb/printcmd.c                                |  16 +-
 gdb/python/py-auto-load.c                     |  29 +--
 gdb/python/py-param.c                         | 133 +++++-----
 gdb/python/python.c                           |   9 +-
 gdb/record-btrace.c                           |  30 ++-
 gdb/record-full.c                             |  69 ++---
 gdb/record.c                                  |  70 ++---
 gdb/regcache.c                                |   9 +-
 gdb/remote.c                                  |  37 ++-
 gdb/reverse.c                                 |  37 +--
 gdb/silent-rules.mk                           |   2 +-
 gdb/solib.c                                   |  22 +-
 gdb/source.c                                  |  21 +-
 gdb/sparc64-tdep.c                            |   7 +-
 gdb/stack.c                                   |  59 +++--
 gdb/symfile.c                                 |  11 +-
 gdb/symtab.c                                  |  11 +-
 .../gdb.base/reverse-init-functions.exp       |  29 +++
 gdb/thread.c                                  |   9 +-
 gdb/top.c                                     |   2 +-
 gdb/tracepoint.c                              |  12 +-
 gdb/tui/tui-win.c                             |  20 +-
 gdb/valprint.c                                |  24 +-
 gdb/value.c                                   |   5 +-
 gdb/windows-tdep.c                            |   9 +-
 48 files changed, 931 insertions(+), 819 deletions(-)
 create mode 100755 gdb/make-init-c
 create mode 100644 gdb/testsuite/gdb.base/reverse-init-functions.exp

-- 
2.31.1


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

end of thread, other threads:[~2021-05-27 18:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 20:23 [PATCH 0/8] Change alias creation functions to accept target as cmd_list_element Simon Marchi
2021-05-18 20:23 ` [PATCH 1/8] gdb: make add_setshow commands return set_show_commands Simon Marchi
2021-05-24 14:57   ` Tom Tromey
2021-05-18 20:23 ` [PATCH 2/8] gdb: remove unnecessary lookup_cmd when deprecating commands Simon Marchi
2021-05-18 20:23 ` [PATCH 3/8] gdb/python: use return values of add_setshow functions in add_setshow_generic Simon Marchi
2021-05-18 20:23 ` [PATCH 4/8] gdb: make add_com_alias accept target as a cmd_list_element Simon Marchi
2021-05-18 20:23 ` [PATCH 5/8] gdb: make add_info_alias " Simon Marchi
2021-05-18 20:23 ` [PATCH 6/8] gdb: remove add_alias_cmd overload that accepts a string Simon Marchi
2021-05-18 20:23 ` [PATCH 7/8] gdb: add make-init-c script Simon Marchi
2021-05-19 15:52   ` Simon Marchi
2021-05-24 15:15     ` Tom Tromey
2021-05-25 16:38       ` Simon Marchi
2021-05-26 12:39         ` Tom Tromey
2021-05-27 18:01           ` Simon Marchi
2021-05-18 20:23 ` [PATCH 8/8] gdb: add option to reverse order of _initialize function calls Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).