]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: add "essential" command class
authorGuinevere Larsen <guinevere@redhat.com>
Fri, 19 Sep 2025 11:44:35 +0000 (08:44 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Wed, 5 Nov 2025 21:17:23 +0000 (18:17 -0300)
commit1518f2e087d31997711fc7f4472ab382c24fa903
tree3d67deb380260b11c020fac11461db6b6aeda94e
parent7028626eff3af25eb28a8cc16598b3ddb7186ea3
gdb: add "essential" command class

Currently, there is no way for a new user to have an idea of common
useful commands  and behaviors from the GDB interface itself, without
checking the example session in the documentation.  This command class
aims to close that gap by providing a set of quickstart commands that
allows for any simple debug session to happen without anything too
egregious missing.

The set of commands was chosen somewhat arbitrarily, based on what I
used or missed the most.  The one overarching important thing, however,
is that the list is kept short, so as to not overwhelm new users.  This
is confirmed by the newly introduced selftest, essential_command_count,
which ensures there are 20 or fewer essential commands.

Here's the reasoning for some of the choices:
* The command "start" was picked over "run" because combining it with
"continue" achieves the same effect, and I prefer it over needing to set
a breakpoint on main to stop at the start of the inferior.
* The command "ptype" is chosen because I believe it is important to
provide a way for the user to check a variable's type from inside GDB,
and ptype is a more complete command than the alternative, "whatis".

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
14 files changed:
gdb/NEWS
gdb/breakpoint.c
gdb/cli/cli-cmds.c
gdb/cli/cli-decode.c
gdb/cli/cli-decode.h
gdb/command.h
gdb/guile/scm-cmd.c
gdb/infcmd.c
gdb/printcmd.c
gdb/python/py-cmd.c
gdb/stack.c
gdb/testsuite/gdb.base/page.exp
gdb/typeprint.c
gdb/unittests/command-def-selftests.c