2001-07-24 22:40:39 +02:00
|
|
|
/* Output generating routines for GDB CLI.
|
2002-03-19 03:51:09 +01:00
|
|
|
|
2008-01-01 23:53:26 +01:00
|
|
|
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 22:56:26 +02:00
|
|
|
Free Software Foundation, Inc.
|
2002-03-19 03:51:09 +01:00
|
|
|
|
2001-07-24 22:40:39 +02:00
|
|
|
Contributed by Cygnus Solutions.
|
|
|
|
Written by Fernando Nasser for Cygnus.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
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
|
2007-08-23 20:08:50 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2001-07-24 22:40:39 +02:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 20:08:50 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "ui-out.h"
|
|
|
|
#include "tui.h"
|
|
|
|
#include "gdb_string.h"
|
|
|
|
#include "gdb_assert.h"
|
|
|
|
|
|
|
|
struct ui_out_data
|
|
|
|
{
|
|
|
|
struct ui_file *stream;
|
|
|
|
int suppress_output;
|
|
|
|
int line;
|
|
|
|
int start_of_line;
|
|
|
|
};
|
2003-03-13 21:24:06 +01:00
|
|
|
typedef struct ui_out_data tui_out_data;
|
2001-07-24 22:40:39 +02:00
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* These are the CLI output functions. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
static void tui_table_begin (struct ui_out *uiout,
|
|
|
|
int nbrofcols, int nr_rows,
|
|
|
|
const char *tblid);
|
2001-07-24 22:40:39 +02:00
|
|
|
static void tui_table_body (struct ui_out *uiout);
|
|
|
|
static void tui_table_end (struct ui_out *uiout);
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
static void tui_table_header (struct ui_out *uiout,
|
|
|
|
int width, enum ui_align alig,
|
|
|
|
const char *col_name,
|
2001-07-24 22:40:39 +02:00
|
|
|
const char *colhdr);
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
static void tui_begin (struct ui_out *uiout,
|
|
|
|
enum ui_out_type type,
|
2001-07-24 22:40:39 +02:00
|
|
|
int level, const char *lstid);
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
static void tui_end (struct ui_out *uiout,
|
|
|
|
enum ui_out_type type, int level);
|
|
|
|
static void tui_field_int (struct ui_out *uiout,
|
|
|
|
int fldno, int width,
|
|
|
|
enum ui_align alig,
|
|
|
|
const char *fldname, int value);
|
|
|
|
static void tui_field_skip (struct ui_out *uiout,
|
|
|
|
int fldno, int width,
|
|
|
|
enum ui_align alig,
|
|
|
|
const char *fldname);
|
|
|
|
static void tui_field_string (struct ui_out *uiout,
|
|
|
|
int fldno, int width,
|
|
|
|
enum ui_align alig,
|
|
|
|
const char *fldname,
|
2001-07-24 22:40:39 +02:00
|
|
|
const char *string);
|
|
|
|
static void tui_field_fmt (struct ui_out *uiout, int fldno,
|
|
|
|
int width, enum ui_align align,
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
const char *fldname,
|
|
|
|
const char *format,
|
|
|
|
va_list args)
|
|
|
|
ATTR_FORMAT (printf, 6, 0);
|
2001-07-24 22:40:39 +02:00
|
|
|
static void tui_spaces (struct ui_out *uiout, int numspaces);
|
|
|
|
static void tui_text (struct ui_out *uiout, const char *string);
|
|
|
|
static void tui_message (struct ui_out *uiout, int verbosity,
|
From Kaveh R. Ghazi <ghazi@caip.rutgers.edu>:
gdb/
* cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
* complaints.c (vcomplaint): Likewise.
* defs.h (xvasprintf, xstrvprintf, verror, vfatal)
(internal_verror, internal_vwarning, vwarning)
(deprecated_query_hook, deprecated_warning_hook)
(deprecated_readline_begin_hook): Likewise.
* disasm.c (fprintf_disasm): Likewise.
* exceptions.c (throw_it): Likewise.
* exceptions.h (throw_verror, throw_vfatal): Likewise.
* mi/mi-interp.c (mi_interp_query_hook): Likewise.
* mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
* tui/tui-hooks.c (tui_query_hook): Likewise.
* tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
Likewise.
* ui-out.c (default_field_fmt, default_message, uo_field_fmt)
(uo_message): Likewise.
* ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
(message_ftype): Likewise.
* utils.c (vfprintf_maybe_filtered, internal_vproblem)
(defaulted_query, printchar): Likewise.
gdb/gdbserver/
* server.h (error, fatal, warning): Add ATTR_FORMAT.
2005-07-31 22:56:26 +02:00
|
|
|
const char *format, va_list args)
|
|
|
|
ATTR_FORMAT (printf, 3, 0);
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
static void tui_wrap_hint (struct ui_out *uiout,
|
|
|
|
char *identstring);
|
2001-07-24 22:40:39 +02:00
|
|
|
static void tui_flush (struct ui_out *uiout);
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* This is the CLI ui-out implementation functions vector. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
/* FIXME: This can be initialized dynamically after default is set to
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
handle initial output in main.c. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
static struct ui_out_impl tui_ui_out_impl = {
|
2001-07-24 22:40:39 +02:00
|
|
|
tui_table_begin,
|
|
|
|
tui_table_body,
|
|
|
|
tui_table_end,
|
|
|
|
tui_table_header,
|
|
|
|
tui_begin,
|
|
|
|
tui_end,
|
|
|
|
tui_field_int,
|
|
|
|
tui_field_skip,
|
|
|
|
tui_field_string,
|
|
|
|
tui_field_fmt,
|
|
|
|
tui_spaces,
|
|
|
|
tui_text,
|
|
|
|
tui_message,
|
|
|
|
tui_wrap_hint,
|
|
|
|
tui_flush,
|
2003-06-28 18:19:07 +02:00
|
|
|
NULL,
|
2001-07-24 22:40:39 +02:00
|
|
|
0, /* Does not need MI hacks (i.e. needs CLI hacks). */
|
|
|
|
};
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Prototypes for local functions. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
extern void _initialize_tui_out (void);
|
|
|
|
|
|
|
|
static void field_separator (void);
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
static void out_field_fmt (struct ui_out *uiout,
|
|
|
|
int fldno,
|
2001-07-24 22:40:39 +02:00
|
|
|
const char *fldname,
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
const char *format,...)
|
|
|
|
ATTR_FORMAT (printf, 4, 5);
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
/* local variables */
|
|
|
|
|
|
|
|
/* (none yet) */
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Mark beginning of a table. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
tui_table_begin (struct ui_out *uiout,
|
|
|
|
int nbrofcols,
|
2001-07-24 22:40:39 +02:00
|
|
|
int nr_rows,
|
|
|
|
const char *tblid)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (nr_rows == 0)
|
|
|
|
data->suppress_output = 1;
|
|
|
|
else
|
Index: mi/ChangeLog
2003-10-24 Andrew Cagney <cagney@redhat.com>
* tui-out.c: Fix "fortunatly"[sic].
Index: doc/ChangeLog
2003-10-24 Andrew Cagney <cagney@redhat.com>
* annotate.texinfo: Fix "fortunatly"[sic].
2003-10-24 Andrew Cagney <cagney@redhat.com>
* osabi.c (gdbarch_init_osabi): Fix typos, and "fortunatly"[sic].
* PROBLEMS, arch-utils.c, cli-out.c, command.h: Ditto.
* complaints.c, cris-tdep.c, disasm.c, dwarf2-frame.c: Ditto.
* frame.c, frame.h, infcall.c, infcmd.c, infrun.c: Ditto.
* kod.c, mips-tdep.c, regcache.c, regcache.h, remote.c: Ditto.
2003-10-24 19:37:04 +02:00
|
|
|
/* Only the table suppresses the output and, fortunately, a table
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
is not a recursive data structure. */
|
2001-07-24 22:40:39 +02:00
|
|
|
gdb_assert (data->suppress_output == 0);
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Mark beginning of a table body. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
tui_table_body (struct ui_out *uiout)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* First, close the table header line. */
|
2001-07-24 22:40:39 +02:00
|
|
|
tui_text (uiout, "\n");
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Mark end of a table. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
tui_table_end (struct ui_out *uiout)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
data->suppress_output = 0;
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Specify table header. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
tui_table_header (struct ui_out *uiout,
|
|
|
|
int width,
|
|
|
|
enum ui_align alignment,
|
2001-07-24 22:40:39 +02:00
|
|
|
const char *col_name,
|
|
|
|
const char *colhdr)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
tui_field_string (uiout, 0, width, alignment, 0, colhdr);
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Mark beginning of a list. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
tui_begin (struct ui_out *uiout,
|
|
|
|
enum ui_out_type type,
|
|
|
|
int level,
|
|
|
|
const char *id)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Mark end of a list. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
tui_end (struct ui_out *uiout,
|
|
|
|
enum ui_out_type type,
|
|
|
|
int level)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Output an int field. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
tui_field_int (struct ui_out *uiout,
|
|
|
|
int fldno, int width,
|
2001-07-24 22:40:39 +02:00
|
|
|
enum ui_align alignment,
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
const char *fldname,
|
|
|
|
int value)
|
2001-07-24 22:40:39 +02:00
|
|
|
{
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
char buffer[20]; /* FIXME: how many chars long a %d can become? */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Don't print line number, keep it for later. */
|
|
|
|
if (data->start_of_line == 0 && strcmp (fldname, "line") == 0)
|
|
|
|
{
|
|
|
|
data->start_of_line ++;
|
|
|
|
data->line = value;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
data->start_of_line ++;
|
|
|
|
sprintf (buffer, "%d", value);
|
|
|
|
tui_field_string (uiout, fldno, width, alignment, fldname, buffer);
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Used to ommit a field. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
tui_field_skip (struct ui_out *uiout,
|
|
|
|
int fldno, int width,
|
2001-07-24 22:40:39 +02:00
|
|
|
enum ui_align alignment,
|
|
|
|
const char *fldname)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
tui_field_string (uiout, fldno, width, alignment, fldname, "");
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Other specific tui_field_* end up here so alignment and field
|
|
|
|
separators are both handled by tui_field_string. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
tui_field_string (struct ui_out *uiout,
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
int fldno, int width,
|
2001-07-24 22:40:39 +02:00
|
|
|
enum ui_align align,
|
|
|
|
const char *fldname,
|
|
|
|
const char *string)
|
|
|
|
{
|
|
|
|
int before = 0;
|
|
|
|
int after = 0;
|
|
|
|
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (fldname && data->line > 0 && strcmp (fldname, "file") == 0)
|
|
|
|
{
|
|
|
|
data->start_of_line ++;
|
|
|
|
if (data->line > 0)
|
|
|
|
{
|
|
|
|
tui_show_source (string, data->line);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
data->start_of_line ++;
|
|
|
|
if ((align != ui_noalign) && string)
|
|
|
|
{
|
|
|
|
before = width - strlen (string);
|
|
|
|
if (before <= 0)
|
|
|
|
before = 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (align == ui_right)
|
|
|
|
after = 0;
|
|
|
|
else if (align == ui_left)
|
|
|
|
{
|
|
|
|
after = before;
|
|
|
|
before = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
/* ui_center */
|
|
|
|
{
|
|
|
|
after = before / 2;
|
|
|
|
before -= after;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (before)
|
|
|
|
ui_out_spaces (uiout, before);
|
|
|
|
if (string)
|
|
|
|
out_field_fmt (uiout, fldno, fldname, "%s", string);
|
|
|
|
if (after)
|
|
|
|
ui_out_spaces (uiout, after);
|
|
|
|
|
|
|
|
if (align != ui_noalign)
|
|
|
|
field_separator ();
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* This is the only field function that does not align. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
tui_field_fmt (struct ui_out *uiout, int fldno,
|
|
|
|
int width, enum ui_align align,
|
|
|
|
const char *fldname,
|
|
|
|
const char *format,
|
|
|
|
va_list args)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
|
|
|
|
data->start_of_line ++;
|
|
|
|
vfprintf_filtered (data->stream, format, args);
|
|
|
|
|
|
|
|
if (align != ui_noalign)
|
|
|
|
field_separator ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tui_spaces (struct ui_out *uiout, int numspaces)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
print_spaces_filtered (numspaces, data->stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tui_text (struct ui_out *uiout, const char *string)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
data->start_of_line ++;
|
|
|
|
if (data->line > 0)
|
|
|
|
{
|
|
|
|
if (strchr (string, '\n') != 0)
|
|
|
|
{
|
|
|
|
data->line = -1;
|
|
|
|
data->start_of_line = 0;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (strchr (string, '\n'))
|
|
|
|
data->start_of_line = 0;
|
|
|
|
fputs_filtered (string, data->stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
tui_message (struct ui_out *uiout,
|
|
|
|
int verbosity,
|
|
|
|
const char *format,
|
|
|
|
va_list args)
|
2001-07-24 22:40:39 +02:00
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
if (ui_out_get_verblvl (uiout) >= verbosity)
|
|
|
|
vfprintf_unfiltered (data->stream, format, args);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tui_wrap_hint (struct ui_out *uiout, char *identstring)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
if (data->suppress_output)
|
|
|
|
return;
|
|
|
|
wrap_here (identstring);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tui_flush (struct ui_out *uiout)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
gdb_flush (data->stream);
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Local functions. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Like tui_field_fmt, but takes a variable number of args and makes a
|
|
|
|
va_list and does not insert a separator. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
/* VARARGS */
|
|
|
|
static void
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-data.c, tui-data.h, tui-disasm.c, tui-disasm.h, tui-hooks.c,
tui-io.c, tui-layout.c, tui-layout.h, tui-out.c, tui-regs.c,
tui-source.c, tui-source.h, tui-stack.c, tui-win.c, tui-win.h,
tui-windata.c, tui-windata.h, tui-wingeneral.c, tui-winsource.c,
tui-winsource.h, tui.c, tui.h: Function declarations and
definitions, wrap long lines.
2007-08-15 01:50:39 +02:00
|
|
|
out_field_fmt (struct ui_out *uiout,
|
|
|
|
int fldno,
|
2001-07-24 22:40:39 +02:00
|
|
|
const char *fldname,
|
|
|
|
const char *format,...)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start (args, format);
|
|
|
|
vfprintf_filtered (data->stream, format, args);
|
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Access to ui_out format private members. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
static void
|
|
|
|
field_separator (void)
|
|
|
|
{
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = ui_out_data (uiout);
|
2001-07-24 22:40:39 +02:00
|
|
|
fputc_filtered (' ', data->stream);
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Initalize private members at startup. */
|
2001-07-24 22:40:39 +02:00
|
|
|
|
|
|
|
struct ui_out *
|
|
|
|
tui_out_new (struct ui_file *stream)
|
|
|
|
{
|
|
|
|
int flags = 0;
|
|
|
|
|
2003-03-08 21:04:27 +01:00
|
|
|
tui_out_data *data = XMALLOC (tui_out_data);
|
2001-07-24 22:40:39 +02:00
|
|
|
data->stream = stream;
|
|
|
|
data->suppress_output = 0;
|
|
|
|
data->line = -1;
|
2002-09-01 18:12:52 +02:00
|
|
|
data->start_of_line = 0;
|
2001-07-24 22:40:39 +02:00
|
|
|
return ui_out_new (&tui_ui_out_impl, data, flags);
|
|
|
|
}
|
|
|
|
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Standard gdb initialization hook. */
|
2001-07-24 22:40:39 +02:00
|
|
|
void
|
|
|
|
_initialize_tui_out (void)
|
|
|
|
{
|
2007-08-14 Michael Snyder <msnyder@access-company.com>
* tui-command.c, tui-data.c, tui-data.h, tui-disasm.c, tui-file.c,
tui-hooks.c, tui-interp.c, tui-io.c, tui-layout.c, tui-out.c,
tui-regs.c, tui-regs.h, tui-source.c, tui-stack.c, tui-win.c,
tui-windata.c, tui-wingeneral.c, tui-winsource.c, tui-winsource.h,
tui.c, tui.h: Comment reformatting to coding standard (capitals,
spaces after periods, etc).
2007-08-14 23:20:09 +02:00
|
|
|
/* Nothing needs to be done. */
|
2001-07-24 22:40:39 +02:00
|
|
|
}
|