Add ui_out parameter to libgdb functions.

This commit is contained in:
Andrew Cagney 2001-09-18 05:00:51 +00:00
parent fed9891d87
commit 2b65245ef4
7 changed files with 46 additions and 19 deletions

View File

@ -1,3 +1,18 @@
2001-09-18 Andrew Cagney <ac131313@redhat.com>
* thread.c (do_captured_thread_select): Add uiout parameter.
(do_captured_list_thread_ids): Ditto.
* breakpoint.c (do_captured_breakpoint_query): Ditto.
* breakpoint.c (gdb_breakpoint_query): Update. Use
catch_exceptions.
* thread.c (gdb_list_thread_ids): Ditto.
(gdb_thread_select): Ditto.
(thread_command): Pass uiout to gdb_thread_select.
* gdb.h (gdb_breakpoint_query): Add parameter ui_out.
(gdb_thread_select, gdb_list_thread_ids): Ditto.
2001-09-13 Kevin Buettner <kevinb@redhat.com>
From Ilya Golubev <gin@mo.msk.ru>:

View File

@ -3526,7 +3526,7 @@ struct captured_breakpoint_query_args
};
static int
do_captured_breakpoint_query (void *data)
do_captured_breakpoint_query (struct ui_out *uiout, void *data)
{
struct captured_breakpoint_query_args *args = data;
register struct breakpoint *b;
@ -3543,14 +3543,14 @@ do_captured_breakpoint_query (void *data)
}
enum gdb_rc
gdb_breakpoint_query (/* output object, */ int bnum)
gdb_breakpoint_query (struct ui_out *uiout, int bnum)
{
struct captured_breakpoint_query_args args;
args.bnum = bnum;
/* For the moment we don't trust print_one_breakpoint() to not throw
an error. */
return catch_errors (do_captured_breakpoint_query, &args,
NULL, RETURN_MASK_ALL);
return catch_exceptions (uiout, do_captured_breakpoint_query, &args,
NULL, RETURN_MASK_ALL);
}
/* Return non-zero if B is user settable (breakpoints, watchpoints,

View File

@ -44,7 +44,7 @@ enum gdb_rc {
/* Print the specified breakpoint on GDB_STDOUT. (Eventually this
function will ``print'' the object on ``output''). */
enum gdb_rc gdb_breakpoint_query (/* struct {ui,gdb}_out *output, */ int bnum);
enum gdb_rc gdb_breakpoint_query (struct ui_out *uiout, int bnum);
/* Create a breakpoint at ADDRESS (a GDB source and line). */
enum gdb_rc gdb_breakpoint (char *address, char *condition,
@ -52,9 +52,9 @@ enum gdb_rc gdb_breakpoint (char *address, char *condition,
int thread, int ignore_count);
/* Switch thread and print notification. */
enum gdb_rc gdb_thread_select (/* output object */ char *tidstr);
enum gdb_rc gdb_thread_select (struct ui_out *uiout, char *tidstr);
/* Print a list of known thread ids. */
enum gdb_rc gdb_list_thread_ids (/* output object */);
enum gdb_rc gdb_list_thread_ids (struct ui_out *uiout);
#endif

View File

@ -1,3 +1,12 @@
2001-09-18 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (mi_cmd_thread_select): Pass uiout to
gdb_thread_select.
(mi_cmd_thread_list_ids): Pass uiout to gdb_list_thread_ids.
* mi-cmd-break.c (breakpoint_notify): Pass uiout to
gdb_breakpoint_query.
2001-08-17 Keith Seitz <keiths@redhat.com>
* mi-cmd-var.c (varobj_update_one): Update call to

View File

@ -44,7 +44,7 @@ enum
static void
breakpoint_notify (int b)
{
gdb_breakpoint_query (b);
gdb_breakpoint_query (uiout, b);
}

View File

@ -230,7 +230,7 @@ mi_cmd_thread_select (char *command, char **argv, int argc)
return MI_CMD_ERROR;
}
else
rc = gdb_thread_select (argv[0]);
rc = gdb_thread_select (uiout, argv[0]);
if (rc == GDB_RC_FAIL)
return MI_CMD_CAUGHT_ERROR;
@ -251,7 +251,7 @@ mi_cmd_thread_list_ids (char *command, char **argv, int argc)
}
else
#ifdef UI_OUT
rc = gdb_list_thread_ids ();
rc = gdb_list_thread_ids (uiout);
#endif
if (rc == GDB_RC_FAIL)

View File

@ -257,7 +257,8 @@ in_thread_list (ptid_t ptid)
/* Print a list of thread ids currently known, and the total number of
threads. To be used from within catch_errors. */
static int
do_captured_list_thread_ids (void *arg)
do_captured_list_thread_ids (struct ui_out *uiout,
void *arg)
{
struct thread_info *tp;
int num = 0;
@ -278,10 +279,10 @@ do_captured_list_thread_ids (void *arg)
/* Official gdblib interface function to get a list of thread ids and
the total number. */
enum gdb_rc
gdb_list_thread_ids (/* output object */)
gdb_list_thread_ids (struct ui_out *uiout)
{
return catch_errors (do_captured_list_thread_ids, NULL,
NULL, RETURN_MASK_ALL);
return catch_exceptions (uiout, do_captured_list_thread_ids, NULL,
NULL, RETURN_MASK_ALL);
}
#endif
@ -683,11 +684,12 @@ thread_command (char *tidstr, int from_tty)
return;
}
gdb_thread_select (tidstr);
gdb_thread_select (uiout, tidstr);
}
static int
do_captured_thread_select (void *tidstr)
do_captured_thread_select (struct ui_out *uiout,
void *tidstr)
{
int num;
struct thread_info *tp;
@ -736,10 +738,11 @@ see the IDs of currently known threads.", num);
}
enum gdb_rc
gdb_thread_select (char *tidstr)
gdb_thread_select (struct ui_out *uiout,
char *tidstr)
{
return catch_errors (do_captured_thread_select, tidstr,
NULL, RETURN_MASK_ALL);
return catch_exceptions (uiout, do_captured_thread_select, tidstr,
NULL, RETURN_MASK_ALL);
}
/* Commands with a prefix of `thread'. */