off == no filename extension recognition (all sourced files are GDB scripts)\n\
soft == evaluate script according to filename extension, fallback to GDB script\n\
strict == evaluate script according to filename extension,\n\
- error if not supported"
+ error if not supported"
),
NULL,
show_script_ext_mode,
the false indicates to not output the (single) command name. */
fput_command_names_styled (*c, false, "\n", stream);
fput_aliases_definition_styled (*c, stream);
- gdb_puts (c->doc, stream);
+
+ /* Be sure to expand TABs in the documentation. */
+ tab_expansion_file expander (stream);
+ gdb_puts (c->doc, &expander);
}
else
{
gdb_printf (stream, "\n");
- /* If this is a prefix command, print it's subcommands. */
+ /* If this is a prefix command, print its subcommands. */
if (c->is_prefix ())
help_list (*c->subcommands, c->prefixname_no_space ().c_str (),
all_commands, stream);
re_clean = re.compile(
"(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$|NEWS)"
)
-re_clean_exclude = re.compile("^(gdb/symfile.c|gdb/cli/cli-cmds.c)$")
clean = []
other = []
for f in sys.argv[1:]:
m = re_clean.search(f)
- if m and re_clean_exclude.search(f):
- m = None
if m:
clean.append(f)
else:
c = add_cmd ("add-symbol-file", class_files, add_symbol_file_command, _("\
Load symbols from FILE, assuming FILE has been dynamically loaded.\n\
Usage: add-symbol-file FILE [-readnow|-readnever] [-o OFF] [ADDR]\n\
- [-s SECT-NAME SECT-ADDR]...\n\
+ [-s SECT-NAME SECT-ADDR]...\n\
ADDR is the starting address of the file's text.\n\
Each '-s' argument provides a section name and address, and\n\
should be specified if the data and bss segments are not contiguous\n\
"-interpreter-exec console \"list\" at basics.c:\$line_main_callme_2"
mi_gdb_test "-interpreter-exec console \"help set args\"" \
- {\~"Set argument list to give program being debugged when it is started\.\\nFollow this command with any number of args, to be passed to the program\.".*\^done} \
+ {~"Set argument list to give program being debugged when it is started\.\\n".*~"Follow this command with any number of args, to be passed to the program\.\\n".*\^done} \
"-interpreter-exec console \"help set args\""
# NOTE: cagney/2003-02-03: Not yet.
#include "gdb_curses.h"
-/* A subclass of string_file that expands tab characters. */
-class tab_expansion_file : public string_file
-{
-public:
-
- tab_expansion_file () = default;
-
- void write (const char *buf, long length_buf) override;
-
-private:
-
- int m_column = 0;
-};
-
-void
-tab_expansion_file::write (const char *buf, long length_buf)
-{
- for (long i = 0; i < length_buf; ++i)
- {
- if (buf[i] == '\t')
- {
- do
- {
- string_file::write (" ", 1);
- ++m_column;
- }
- while ((m_column % 8) != 0);
- }
- else
- {
- string_file::write (&buf[i], 1);
- if (buf[i] == '\n')
- m_column = 0;
- else
- ++m_column;
- }
- }
-}
-
/* Get the register from the frame and return a printable
representation of it. */
struct gdbarch *gdbarch = get_frame_arch (frame);
/* Expand tabs into spaces, since ncurses on MS-Windows doesn't. */
- tab_expansion_file stream;
- gdbarch_print_registers_info (gdbarch, &stream, frame, regnum, 1);
+ string_file stream;
+ tab_expansion_file expander (&stream);
+ gdbarch_print_registers_info (gdbarch, &expander, frame, regnum, 1);
/* Remove the possible \n. */
std::string str = stream.release ();
else
m_stream->write (buf, len);
}
+
+void
+tab_expansion_file::write (const char *buf, long length_buf)
+{
+ for (long i = 0; i < length_buf; ++i)
+ {
+ if (buf[i] == '\t')
+ {
+ do
+ {
+ m_stream->write (" ", 1);
+ ++m_column;
+ }
+ while ((m_column % 8) != 0);
+ }
+ else
+ {
+ m_stream->write (&buf[i], 1);
+ if (buf[i] == '\n')
+ m_column = 0;
+ else
+ ++m_column;
+ }
+ }
+}
bool m_needs_timestamp = true;
};
+/* A wrapped_file that expands TABs as it prints. A TAB character is
+ always processed and will expand to the number of spaces required
+ to move to the next tab stop.
+
+ Note that this only really handles ASCII output correctly. */
+
+class tab_expansion_file : public wrapped_file
+{
+public:
+
+ explicit tab_expansion_file (ui_file *stream)
+ : wrapped_file (stream)
+ {
+ }
+
+ void write (const char *buf, long length_buf) override;
+
+private:
+
+ /* The current column. */
+ int m_column = 0;
+};
+
#endif /* GDB_UI_FILE_H */