From 411589588ad4b9c31e68ca69378a9efcefe24321 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Fri, 27 Mar 1998 03:36:27 +0000 Subject: Thu Mar 26 22:29:28 1998 Elena Zannoni * gdbtk.c: (gdb_trace_status) new function. (gdbtk_init) added command "gdb_is_tracing". (tracepoint_notify) added passcount information. * tracepoint.c (trace_status_command): Recognize a boolean return value from the stub to indicate whether trace experiment is running. Export this value as a global state variable (trace_running_p) for use by the GUI. (from Michael Snyder) (trace_pass_command) added call to modify_tracepoint_hook. * tracepoint.h export trace_running_p --- gdb/gdbtk.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'gdb/gdbtk.c') diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index f1ee5fc..d9a0324 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -148,6 +148,7 @@ static int map_arg_registers PARAMS ((int, char *[], void (*) (int, void *), voi static void get_register_name PARAMS ((int, void *)); static int gdb_regnames PARAMS ((ClientData, Tcl_Interp *, int, char *[])); static void get_register PARAMS ((int, void *)); +static int gdb_trace_status PARAMS ((ClientData, Tcl_Interp *, int, char *argv[])); static int gdb_target_has_execution_command PARAMS ((ClientData, Tcl_Interp *, int, char *argv[])); static int gdb_load_info PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[])); void TclDebug PARAMS ((const char *fmt, ...)); @@ -2139,6 +2140,9 @@ gdbtk_init ( argv0 ) Tcl_CreateCommand (interp, "gdb_target_has_execution", gdb_target_has_execution_command, NULL, NULL); + Tcl_CreateCommand (interp, "gdb_is_tracing", + gdb_trace_status, + NULL, NULL); Tcl_CreateObjCommand (interp, "gdb_load_info", gdb_load_info, NULL, NULL); Tcl_CreateObjCommand (interp, "gdb_get_locals", gdb_get_vars_command, (ClientData) 0, NULL); @@ -2375,6 +2379,22 @@ gdb_target_has_execution_command (clientData, interp, argc, argv) return TCL_OK; } +static int +gdb_trace_status (clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; + char *argv[]; +{ + int result = 0; + + if (trace_running_p) + result = 1; + + Tcl_SetIntObj (Tcl_GetObjResult (interp), result); + return TCL_OK; +} + /* gdb_load_info - returns information about the file about to be downloaded */ static int @@ -2797,7 +2817,7 @@ tracepoint_notify(tp, action) if (filename == NULL) filename = "N/A"; sprintf (buf, "gdbtk_tcl_tracepoint %s %d 0x%lx %d {%s}", action, tp->number, - (long)tp->address, sal.line, filename); + (long)tp->address, sal.line, filename, tp->pass_count); v = Tcl_Eval (interp, buf); -- cgit v1.1