aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/guile')
-rw-r--r--gdb/guile/guile-internal.h11
-rw-r--r--gdb/guile/guile.c6
-rw-r--r--gdb/guile/guile.h2
-rw-r--r--gdb/guile/lib/gdb.scm2
-rw-r--r--gdb/guile/lib/gdb/boot.scm2
-rw-r--r--gdb/guile/lib/gdb/experimental.scm2
-rw-r--r--gdb/guile/lib/gdb/init.scm2
-rw-r--r--gdb/guile/lib/gdb/iterator.scm2
-rw-r--r--gdb/guile/lib/gdb/printing.scm2
-rw-r--r--gdb/guile/lib/gdb/support.scm2
-rw-r--r--gdb/guile/lib/gdb/types.scm2
-rw-r--r--gdb/guile/scm-arch.c2
-rw-r--r--gdb/guile/scm-auto-load.c2
-rw-r--r--gdb/guile/scm-block.c2
-rw-r--r--gdb/guile/scm-breakpoint.c2
-rw-r--r--gdb/guile/scm-cmd.c85
-rw-r--r--gdb/guile/scm-color.c13
-rw-r--r--gdb/guile/scm-disasm.c2
-rw-r--r--gdb/guile/scm-exception.c2
-rw-r--r--gdb/guile/scm-frame.c2
-rw-r--r--gdb/guile/scm-gsmob.c2
-rw-r--r--gdb/guile/scm-iterator.c2
-rw-r--r--gdb/guile/scm-lazy-string.c2
-rw-r--r--gdb/guile/scm-math.c2
-rw-r--r--gdb/guile/scm-objfile.c2
-rw-r--r--gdb/guile/scm-param.c43
-rw-r--r--gdb/guile/scm-ports.c12
-rw-r--r--gdb/guile/scm-pretty-print.c2
-rw-r--r--gdb/guile/scm-progspace.c2
-rw-r--r--gdb/guile/scm-safe-call.c2
-rw-r--r--gdb/guile/scm-string.c2
-rw-r--r--gdb/guile/scm-symbol.c2
-rw-r--r--gdb/guile/scm-symtab.c2
-rw-r--r--gdb/guile/scm-type.c2
-rw-r--r--gdb/guile/scm-utils.c2
-rw-r--r--gdb/guile/scm-value.c4
36 files changed, 159 insertions, 73 deletions
diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h
index 090badd..60a8bf3 100644
--- a/gdb/guile/guile-internal.h
+++ b/gdb/guile/guile-internal.h
@@ -1,6 +1,6 @@
/* Internal header for GDB/Scheme code.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -449,10 +449,11 @@ extern const struct block *bkscm_scm_to_block
/* scm-cmd.c */
-extern char *gdbscm_parse_command_name (const char *name,
- const char *func_name, int arg_pos,
- struct cmd_list_element ***base_list,
- struct cmd_list_element **start_list);
+extern char *gdbscm_parse_command_name
+ (const char *name, const char *func_name, int arg_pos,
+ struct cmd_list_element ***base_list,
+ struct cmd_list_element **start_list,
+ struct cmd_list_element **prefix_cmd = nullptr);
extern int gdbscm_valid_command_class_p (int command_class);
diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c
index 5358b83..66a74b3 100644
--- a/gdb/guile/guile.c
+++ b/gdb/guile/guile.c
@@ -1,6 +1,6 @@
/* General GDB/Guile code.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -827,9 +827,7 @@ message == an error message without a stack will be printed."),
&set_guile_list, &show_guile_list);
}
-void _initialize_guile ();
-void
-_initialize_guile ()
+INIT_GDB_FILE (guile)
{
install_gdb_commands ();
}
diff --git a/gdb/guile/guile.h b/gdb/guile/guile.h
index 6ce4864..b90a306 100644
--- a/gdb/guile/guile.h
+++ b/gdb/guile/guile.h
@@ -1,6 +1,6 @@
/* General GDB/Scheme code.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/lib/gdb.scm b/gdb/guile/lib/gdb.scm
index afa6aa3..d0272970 100644
--- a/gdb/guile/lib/gdb.scm
+++ b/gdb/guile/lib/gdb.scm
@@ -1,6 +1,6 @@
;; Scheme side of the gdb module.
;;
-;; Copyright (C) 2014-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2025 Free Software Foundation, Inc.
;;
;; This file is part of GDB.
;;
diff --git a/gdb/guile/lib/gdb/boot.scm b/gdb/guile/lib/gdb/boot.scm
index 31a47d0..b41551b 100644
--- a/gdb/guile/lib/gdb/boot.scm
+++ b/gdb/guile/lib/gdb/boot.scm
@@ -1,6 +1,6 @@
;; Bootstrap the Scheme side of the gdb module.
;;
-;; Copyright (C) 2014-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2025 Free Software Foundation, Inc.
;;
;; This file is part of GDB.
;;
diff --git a/gdb/guile/lib/gdb/experimental.scm b/gdb/guile/lib/gdb/experimental.scm
index 0c79d18..df56f05 100644
--- a/gdb/guile/lib/gdb/experimental.scm
+++ b/gdb/guile/lib/gdb/experimental.scm
@@ -1,7 +1,7 @@
;; Various experimental utilities.
;; Anything in this file can change or disappear.
;;
-;; Copyright (C) 2014-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2025 Free Software Foundation, Inc.
;;
;; This file is part of GDB.
;;
diff --git a/gdb/guile/lib/gdb/init.scm b/gdb/guile/lib/gdb/init.scm
index a675c6c..81a16e5 100644
--- a/gdb/guile/lib/gdb/init.scm
+++ b/gdb/guile/lib/gdb/init.scm
@@ -1,6 +1,6 @@
;; Scheme side of the gdb module.
;;
-;; Copyright (C) 2014-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2025 Free Software Foundation, Inc.
;;
;; This file is part of GDB.
;;
diff --git a/gdb/guile/lib/gdb/iterator.scm b/gdb/guile/lib/gdb/iterator.scm
index 7ef15be..14a957b 100644
--- a/gdb/guile/lib/gdb/iterator.scm
+++ b/gdb/guile/lib/gdb/iterator.scm
@@ -1,7 +1,7 @@
;; Iteration utilities.
;; Anything in this file can change or disappear.
;;
-;; Copyright (C) 2014-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2025 Free Software Foundation, Inc.
;;
;; This file is part of GDB.
;;
diff --git a/gdb/guile/lib/gdb/printing.scm b/gdb/guile/lib/gdb/printing.scm
index 19daddd..3116c7c 100644
--- a/gdb/guile/lib/gdb/printing.scm
+++ b/gdb/guile/lib/gdb/printing.scm
@@ -1,6 +1,6 @@
;; Additional pretty-printer support.
;;
-;; Copyright (C) 2014-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2025 Free Software Foundation, Inc.
;;
;; This file is part of GDB.
;;
diff --git a/gdb/guile/lib/gdb/support.scm b/gdb/guile/lib/gdb/support.scm
index 8b575ef..f508f16 100644
--- a/gdb/guile/lib/gdb/support.scm
+++ b/gdb/guile/lib/gdb/support.scm
@@ -1,6 +1,6 @@
;; Internal support routines.
;;
-;; Copyright (C) 2014-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2025 Free Software Foundation, Inc.
;;
;; This file is part of GDB.
;;
diff --git a/gdb/guile/lib/gdb/types.scm b/gdb/guile/lib/gdb/types.scm
index 7d8d3c6..a7b168c 100644
--- a/gdb/guile/lib/gdb/types.scm
+++ b/gdb/guile/lib/gdb/types.scm
@@ -1,5 +1,5 @@
;; Type utilities.
-;; Copyright (C) 2010-2024 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2025 Free Software Foundation, Inc.
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
diff --git a/gdb/guile/scm-arch.c b/gdb/guile/scm-arch.c
index 02adad0..8704d16 100644
--- a/gdb/guile/scm-arch.c
+++ b/gdb/guile/scm-arch.c
@@ -1,6 +1,6 @@
/* Scheme interface to architecture.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-auto-load.c b/gdb/guile/scm-auto-load.c
index ea87ab7..4413744 100644
--- a/gdb/guile/scm-auto-load.c
+++ b/gdb/guile/scm-auto-load.c
@@ -1,6 +1,6 @@
/* GDB routines for supporting auto-loaded Guile scripts.
- Copyright (C) 2010-2024 Free Software Foundation, Inc.
+ Copyright (C) 2010-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c
index 4ca4311..a4e692b 100644
--- a/gdb/guile/scm-block.c
+++ b/gdb/guile/scm-block.c
@@ -1,6 +1,6 @@
/* Scheme interface to blocks.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c
index b8a5d82..7765b1e 100644
--- a/gdb/guile/scm-breakpoint.c
+++ b/gdb/guile/scm-breakpoint.c
@@ -1,6 +1,6 @@
/* Scheme interface to breakpoints.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c
index 8255529..19fb742 100644
--- a/gdb/guile/scm-cmd.c
+++ b/gdb/guile/scm-cmd.c
@@ -1,6 +1,6 @@
/* GDB commands implemented in Scheme.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -457,11 +457,13 @@ cmdscm_completer (struct cmd_list_element *command,
name of the new command. All earlier words must be existing prefix
commands.
- *BASE_LIST is set to the final prefix command's list of
- *sub-commands.
+ *BASE_LIST is set to the final prefix command's list of sub-commands.
START_LIST is the list in which the search starts.
+ When PREFIX_CMD is not NULL then *PREFIX_CMD is set to the prefix
+ command itself, or NULL, if there is no prefix command.
+
This function returns the xmalloc()d name of the new command.
On error a Scheme exception is thrown. */
@@ -469,13 +471,17 @@ char *
gdbscm_parse_command_name (const char *name,
const char *func_name, int arg_pos,
struct cmd_list_element ***base_list,
- struct cmd_list_element **start_list)
+ struct cmd_list_element **start_list,
+ struct cmd_list_element **prefix_cmd)
{
struct cmd_list_element *elt;
int len = strlen (name);
int i, lastchar;
char *msg;
+ if (prefix_cmd != nullptr)
+ *prefix_cmd = nullptr;
+
/* Skip trailing whitespace. */
for (i = len - 1; i >= 0 && (name[i] == ' ' || name[i] == '\t'); --i)
;
@@ -490,9 +496,9 @@ gdbscm_parse_command_name (const char *name,
/* Find first character of the final word. */
for (; i > 0 && valid_cmd_char_p (name[i - 1]); --i)
;
- gdb::unique_xmalloc_ptr<char> result ((char *) xmalloc (lastchar - i + 2));
- memcpy (result.get (), &name[i], lastchar - i + 1);
- result.get ()[lastchar - i + 1] = '\0';
+
+ gdb::unique_xmalloc_ptr<char> result
+ = make_unique_xstrndup (&name[i], lastchar - i + 1);
/* Skip whitespace again. */
for (--i; i >= 0 && (name[i] == ' ' || name[i] == '\t'); --i)
@@ -503,18 +509,21 @@ gdbscm_parse_command_name (const char *name,
return result.release ();
}
- gdb::unique_xmalloc_ptr<char> prefix_text ((char *) xmalloc (i + 2));
- memcpy (prefix_text.get (), name, i + 1);
- prefix_text.get ()[i + 1] = '\0';
+ gdb::unique_xmalloc_ptr<char> prefix_text
+ = make_unique_xstrndup (name, i + 1);
const char *prefix_text2 = prefix_text.get ();
elt = lookup_cmd_1 (&prefix_text2, *start_list, NULL, NULL, 1);
- if (elt == NULL || elt == CMD_LIST_AMBIGUOUS)
+ if (elt == nullptr || elt == CMD_LIST_AMBIGUOUS || *prefix_text2 != '\0')
{
msg = xstrprintf (_("could not find command prefix '%s'"),
prefix_text.get ()).release ();
scm_dynwind_begin ((scm_t_dynwind_flags) 0);
gdbscm_dynwind_xfree (msg);
+ /* Release memory now as the destructors will not be run when the
+ guile exception is thrown. */
+ result = nullptr;
+ prefix_text = nullptr;
gdbscm_out_of_range_error (func_name, arg_pos,
gdbscm_scm_from_c_string (name), msg);
}
@@ -522,6 +531,8 @@ gdbscm_parse_command_name (const char *name,
if (elt->is_prefix ())
{
*base_list = elt->subcommands;
+ if (prefix_cmd != nullptr)
+ *prefix_cmd = elt;
return result.release ();
}
@@ -529,6 +540,10 @@ gdbscm_parse_command_name (const char *name,
prefix_text.get ()).release ();
scm_dynwind_begin ((scm_t_dynwind_flags) 0);
gdbscm_dynwind_xfree (msg);
+ /* Release memory now as the destructors will not be run when the guile
+ exception is thrown. */
+ result = nullptr;
+ prefix_text = nullptr;
gdbscm_out_of_range_error (func_name, arg_pos,
gdbscm_scm_from_c_string (name), msg);
/* NOTREACHED */
@@ -743,8 +758,9 @@ gdbscm_register_command_x (SCM self)
if (cmdscm_is_valid (c_smob))
scm_misc_error (FUNC_NAME, _("command is already registered"), SCM_EOL);
+ struct cmd_list_element *prefix_cmd = nullptr;
cmd_name = gdbscm_parse_command_name (c_smob->name, FUNC_NAME, SCM_ARG1,
- &cmd_list, &cmdlist);
+ &cmd_list, &cmdlist, &prefix_cmd);
c_smob->cmd_name = gdbscm_gc_xstrdup (cmd_name);
xfree (cmd_name);
@@ -753,18 +769,50 @@ gdbscm_register_command_x (SCM self)
{
if (c_smob->is_prefix)
{
- /* If we have our own "invoke" method, then allow unknown
- sub-commands. */
- int allow_unknown = gdbscm_is_true (c_smob->invoke);
+ bool has_invoke = gdbscm_is_true (c_smob->invoke) == 1;
- cmd = add_prefix_cmd (c_smob->cmd_name, c_smob->cmd_class,
- NULL, c_smob->doc, &c_smob->sub_list,
- allow_unknown, cmd_list);
+ if (has_invoke)
+ {
+ cmd = add_prefix_cmd (c_smob->cmd_name, c_smob->cmd_class,
+ NULL, c_smob->doc, &c_smob->sub_list,
+ 1 /* allow_unknown */, cmd_list);
+ cmd->func = cmdscm_function;
+ }
+ else
+ {
+ /* If there is no 'invoke' method, then create the prefix
+ using the standard prefix callbacks. This means that for
+ 'set prefix' the user will get the help text listing all
+ of the sub-commands, and for 'show prefix', the user will
+ see all of the sub-command values. */
+ if (prefix_cmd != nullptr)
+ {
+ while (prefix_cmd->prefix != nullptr)
+ prefix_cmd = prefix_cmd->prefix;
+ }
+
+ bool is_show = (prefix_cmd != nullptr
+ && prefix_cmd->subcommands == &showlist);
+
+ if (is_show)
+ cmd = add_show_prefix_cmd (c_smob->cmd_name,
+ c_smob->cmd_class,
+ c_smob->doc,
+ &c_smob->sub_list,
+ 0 /* allow_unknown */, cmd_list);
+ else
+ cmd = add_basic_prefix_cmd (c_smob->cmd_name,
+ c_smob->cmd_class,
+ c_smob->doc,
+ &c_smob->sub_list,
+ 0 /* allow_unknown */, cmd_list);
+ }
}
else
{
cmd = add_cmd (c_smob->cmd_name, c_smob->cmd_class,
c_smob->doc, cmd_list);
+ cmd->func = cmdscm_function;
}
}
catch (const gdb_exception &except)
@@ -777,7 +825,6 @@ gdbscm_register_command_x (SCM self)
So no more errors after this point. */
/* There appears to be no API to set this. */
- cmd->func = cmdscm_function;
cmd->destroyer = cmdscm_destroyer;
c_smob->command = cmd;
diff --git a/gdb/guile/scm-color.c b/gdb/guile/scm-color.c
index 6ebe252..cde22e5 100644
--- a/gdb/guile/scm-color.c
+++ b/gdb/guile/scm-color.c
@@ -1,6 +1,6 @@
/* GDB parameters implemented in Guile.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -24,6 +24,7 @@
#include "language.h"
#include "arch-utils.h"
#include "guile-internal.h"
+#include "cli/cli-style.h"
/* A GDB color. */
@@ -354,8 +355,14 @@ gdbscm_color_escape_sequence (SCM self, SCM is_fg_scm)
const ui_file_style::color &color = coscm_get_color (self);
SCM_ASSERT_TYPE (gdbscm_is_bool (is_fg_scm), is_fg_scm, SCM_ARG2, FUNC_NAME,
_("boolean"));
- bool is_fg = gdbscm_is_true (is_fg_scm);
- std::string s = color.to_ansi (is_fg);
+
+ std::string s;
+ if (term_cli_styling ())
+ {
+ bool is_fg = gdbscm_is_true (is_fg_scm);
+ s = color.to_ansi (is_fg);
+ }
+
return gdbscm_scm_from_host_string (s.c_str (), s.size ());
}
diff --git a/gdb/guile/scm-disasm.c b/gdb/guile/scm-disasm.c
index 0c7c4ec..1c8fc2d 100644
--- a/gdb/guile/scm-disasm.c
+++ b/gdb/guile/scm-disasm.c
@@ -1,6 +1,6 @@
/* Scheme interface to architecture.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-exception.c b/gdb/guile/scm-exception.c
index 61007de..2861c88 100644
--- a/gdb/guile/scm-exception.c
+++ b/gdb/guile/scm-exception.c
@@ -1,6 +1,6 @@
/* GDB/Scheme exception support.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c
index c94fcfe..db35ae5 100644
--- a/gdb/guile/scm-frame.c
+++ b/gdb/guile/scm-frame.c
@@ -1,6 +1,6 @@
/* Scheme interface to stack frames.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-gsmob.c b/gdb/guile/scm-gsmob.c
index b3efad2..7a7a69d 100644
--- a/gdb/guile/scm-gsmob.c
+++ b/gdb/guile/scm-gsmob.c
@@ -1,6 +1,6 @@
/* GDB/Scheme smobs (gsmob is pronounced "jee smob")
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-iterator.c b/gdb/guile/scm-iterator.c
index f4d5344..9c2f0e8 100644
--- a/gdb/guile/scm-iterator.c
+++ b/gdb/guile/scm-iterator.c
@@ -1,6 +1,6 @@
/* Simple iterators for GDB/Scheme.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-lazy-string.c b/gdb/guile/scm-lazy-string.c
index 586c92c..0c5aa59 100644
--- a/gdb/guile/scm-lazy-string.c
+++ b/gdb/guile/scm-lazy-string.c
@@ -1,6 +1,6 @@
/* Scheme interface to lazy strings.
- Copyright (C) 2010-2024 Free Software Foundation, Inc.
+ Copyright (C) 2010-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c
index 7a4a703..6c4ee79 100644
--- a/gdb/guile/scm-math.c
+++ b/gdb/guile/scm-math.c
@@ -1,6 +1,6 @@
/* GDB/Scheme support for math operations on values.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-objfile.c b/gdb/guile/scm-objfile.c
index d6c0559..b15a4f9 100644
--- a/gdb/guile/scm-objfile.c
+++ b/gdb/guile/scm-objfile.c
@@ -1,6 +1,6 @@
/* Scheme interface to objfiles.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-param.c b/gdb/guile/scm-param.c
index 749c5ea..5137847 100644
--- a/gdb/guile/scm-param.c
+++ b/gdb/guile/scm-param.c
@@ -1,6 +1,6 @@
/* GDB parameters implemented in Guile.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -308,13 +308,37 @@ pascm_is_valid (param_smob *p_smob)
return p_smob->commands.set != nullptr;
}
-/* A helper function which return the default documentation string for
- a parameter (which is to say that it's undocumented). */
+
+/* The different types of documentation string. */
+
+enum doc_string_type
+{
+ doc_string_set,
+ doc_string_show,
+ doc_string_description
+};
+
+/* A helper function which returns the default documentation string for
+ a parameter CMD_NAME. The DOC_TYPE indicates which type of
+ documentation string is needed. The returned string is dynamically
+ allocated. */
static char *
-get_doc_string (void)
+get_doc_string (doc_string_type doc_type, const char *cmd_name)
{
- return xstrdup (_("This command is not documented."));
+ if (doc_type == doc_string_description)
+ return xstrdup (_("This command is not documented."));
+ else
+ {
+ gdb_assert (cmd_name != nullptr);
+
+ if (doc_type == doc_string_show)
+ return xstrprintf (_("Show the current value of '%s'."),
+ cmd_name).release ();
+ else
+ return xstrprintf (_("Set the current value of '%s'."),
+ cmd_name).release ();
+ }
}
/* Subroutine of pascm_set_func, pascm_show_func to simplify them.
@@ -990,11 +1014,14 @@ gdbscm_make_parameter (SCM name_scm, SCM rest)
&show_doc_arg_pos, &show_doc,
&initial_value_arg_pos, &initial_value_scm);
- /* If doc is NULL, leave it NULL. See add_setshow_cmd_full. */
+ if (doc == nullptr)
+ doc = get_doc_string (doc_string_description, nullptr);
+ else if (*doc == '\0')
+ doc = nullptr;
if (set_doc == NULL)
- set_doc = get_doc_string ();
+ set_doc = get_doc_string (doc_string_set, name);
if (show_doc == NULL)
- show_doc = get_doc_string ();
+ show_doc = get_doc_string (doc_string_show, name);
s = name;
name = gdbscm_canonicalize_command_name (s, 0);
diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c
index ab78b5c..f3e3ec8 100644
--- a/gdb/guile/scm-ports.c
+++ b/gdb/guile/scm-ports.c
@@ -1,7 +1,7 @@
/* Support for connecting Guile's stdio to GDB's.
as well as r/w memory via ports.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -336,9 +336,15 @@ ioscm_flush (SCM port)
return;
if (scm_is_eq (port, error_port_scm))
- gdb_flush (gdb_stderr);
+ {
+ if (gdb_stderr != nullptr)
+ gdb_flush (gdb_stderr);
+ }
else
- gdb_flush (gdb_stdout);
+ {
+ if (gdb_stdout != nullptr)
+ gdb_flush (gdb_stdout);
+ }
}
#else /* !USING_GUILE_BEFORE_2_2 */
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index 128c318..c4bb052 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -1,6 +1,6 @@
/* GDB/Scheme pretty-printing.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-progspace.c b/gdb/guile/scm-progspace.c
index fcdcca2..757d66d 100644
--- a/gdb/guile/scm-progspace.c
+++ b/gdb/guile/scm-progspace.c
@@ -1,6 +1,6 @@
/* Guile interface to program spaces.
- Copyright (C) 2010-2024 Free Software Foundation, Inc.
+ Copyright (C) 2010-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-safe-call.c b/gdb/guile/scm-safe-call.c
index bc0a1e6..95dcf3a 100644
--- a/gdb/guile/scm-safe-call.c
+++ b/gdb/guile/scm-safe-call.c
@@ -1,6 +1,6 @@
/* GDB/Scheme support for safe calls into the Guile interpreter.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-string.c b/gdb/guile/scm-string.c
index a249bcc..d99cf3d 100644
--- a/gdb/guile/scm-string.c
+++ b/gdb/guile/scm-string.c
@@ -1,6 +1,6 @@
/* GDB/Scheme charset interface.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c
index 368a598..8c2ae24 100644
--- a/gdb/guile/scm-symbol.c
+++ b/gdb/guile/scm-symbol.c
@@ -1,6 +1,6 @@
/* Scheme interface to symbols.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c
index 2fd4b03..e337a4b 100644
--- a/gdb/guile/scm-symtab.c
+++ b/gdb/guile/scm-symtab.c
@@ -1,6 +1,6 @@
/* Scheme interface to symbol tables.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index f228762..5114579 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -1,6 +1,6 @@
/* Scheme interface to types.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-utils.c b/gdb/guile/scm-utils.c
index 45f42ba..e782637 100644
--- a/gdb/guile/scm-utils.c
+++ b/gdb/guile/scm-utils.c
@@ -1,6 +1,6 @@
/* General utility routines for GDB/Scheme code.
- Copyright (C) 2014-2024 Free Software Foundation, Inc.
+ Copyright (C) 2014-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c
index 0f4a6a4..3207980 100644
--- a/gdb/guile/scm-value.c
+++ b/gdb/guile/scm-value.c
@@ -1,6 +1,6 @@
/* Scheme interface to values.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -604,7 +604,7 @@ gdbscm_value_dynamic_type (SCM self)
type = value_rtti_type (value, NULL, NULL, NULL);
else
{
- /* Re-use object's static type. */
+ /* Reuse object's static type. */
type = NULL;
}
}