aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>1998-11-05 18:12:23 +0000
committerJim Ingham <jingham@apple.com>1998-11-05 18:12:23 +0000
commit63d138d980e5697589b510369daa51c620a23409 (patch)
tree5afee639bb9dee6bc503fa143fcc97fedb6f74e2 /gdb
parent025ce5c6d84a93bdb48aa276c2c27d6c40c01909 (diff)
downloadgdb-63d138d980e5697589b510369daa51c620a23409.zip
gdb-63d138d980e5697589b510369daa51c620a23409.tar.gz
gdb-63d138d980e5697589b510369daa51c620a23409.tar.bz2
Merging the Tracepoint changes back into the Trunk:
Wed Nov 4 12:41:42 1998 Jim Ingham <jingham@cygnus.com> * actiondlg.tcl: Get the stack collect string from an instance variable. Need to implement some way to get this from the target settings... * global_pref.tcl (toggle_tracing_mode): Add & remove hooks when you go in and out of tracing mode. Also reset the B1 behavior when you leave tracing mode * interface.tcl (gdbtk_tcl_trace_find_hook): Added the trace find hook, so you can switch the GUI state when the tfind command is used to enter & leave browse mode. * srcbar.tcl (constructor, destructor trace_find_hook): Added the trace_find_hook to the source toolbar, and added the necessary hooks to handle it. * srctextwin.tcl (trace_find_hook): Added a trace find hook to the sourcebar as well. * stack.tcl (update): protect against errors in gdb_stack. Just return "NO STACK" if we couldn't get it. * src_pref.tcl (constructor, cancel): Put all the saved prefs in an array, on cancel, see if any have changed and only rebuild the window if there have been changes. Mon Nov 2 13:24:10 1998 Jim Ingham <jingham@cygnus.com> * bp.tcl (update): The hook function was passing more arguments than this function expected. Mon Nov 2 11:16:10 1998 Jim Ingham <jingham@cygnus.com> * toolbar.tcl: Added Tdump image. Fri Oct 30 17:36:05 1998 Jim Ingham <jingham@cygnus.com> * src.tcl (set_execution_status): Changed status messages, tracing is not the same as async debugging... Fri Oct 30 17:06:31 1998 Jim Ingham <jingham@cygnus.com> * bp.tcl (bp_all): Only remove tracepoints in the tracepoint window, and breakpoints in the breakpoint window. Fri Oct 30 11:22:23 1998 Jim Ingham <jingham@cygnus.com> * actiondlg.tcl: Added special tag "Collect Stack". This still needs to get hooked into the target database to deal with targets that need to do something special to collect the stack. Also moved some repeated code into loops. * main.tcl (source_file): Source in a file of gdb commands. * srcbar.tcl (constructor): Added source file menu entry, and made stack buttons belong to both the Trace & Control classes. * srctextwin.tcl (constructor): One too many separators in the trace trace popup menu. * tclIndex: regenerated. * tfind_args.tcl: Added "tfind frame" * toolbar.tcl (create_button): Allow a button to belong to more than one class. * toolbar.tcl (enable_ui): Eliminate redundant code, and allow a button to belong to more than one class. * toolbar.tcl (create_trace_menu): Added save tracepoints & Tfind frame menu items. * tracedlg.tcl: Added deletion of actions, and fixed a the whiile-stepping combobox callback for the new combobox. * util.tcl (save_trace_commands): new proc. 1998-10-29 Michael Snyder <msnyder@demo-laptop2.cygnus.com> * target.tcl: add /dev/cua0 for Linux. Tue Oct 27 13:46:03 1998 Jim Ingham <jingham@cygnus.com> * Many little bug fixes all over in order to get tracing to work along with normal program control. * toolbar.tcl: Rewrote much of the code here to put commonly used code into functions, and clean up adding menus and buttons. Added the ability to disable particular menu items, not just whole menus. Added the ability to delete and insert buttons on the fly. * srcbar.tcl: Pushed the changes to toolbar.tcl into this file. * srctextwin.tcl: Changed the code dealing with breakpoints and tracepoints to use the text tags more consistently. Use only one set of menus for the whole widget, rather than having a separate set for the SRC+ASM case. Rewrote a lot of the code to separate out the tracing & program control functions. * interface.tcl (gdbtk_tcl_breakpoint): pass more information to the scrtextwin when a breakpoint changes state, so it can do the right thing without having to guess... * tracedlg.tcl (build_win): get the packing right so the window expands correctly. * main.tcl: do_tstop -> tstop, do_tstart -> tstart to avoid confusion with the methods in ScrBar.tcl. * prefs.tcl: Added two new preferences B1_Behavior to control whether B1 sets breakpoints or tracepoints. * src_prefs.tcl: Put in support for the B1_Behavior. * global_prefs.tcl: Put back tracing checkbox. * tdump.tcl: Fixed an incorrect (1 rather than 1.0) text widget line specification. * tfind_args.tcl (build_win): Bind return in the entry to the OK button. Clear the entry field if the Type has changed. * utils.tcl: Added comments for the debug commands. * watch.tcl (build_win): Flash the OK button before invoking it. Wed Nov 4 12:41:42 1998 Jim Ingham <jingham@cygnus.com> * gdbtk-cmds.c (gdb_set_bp_addr): Pass the type, enable & thread to gdbtk_tcl_breakpoint. * gdbtk-hooks.c (gdbtk_trace_find): Added this function. It is the hook function for tfind commands. * tracepoint.c (trace_find_command): Added the trace_find_hook, run when you do trace_find_command. * tracepoint.h: Define the trace_find_hook. Mon Nov 2 11:16:10 1998 Jim Ingham <jingham@cygnus.com> * gdbtk-cmds (gdb_get_tracepoint_info): Demangle C++ function names. Fri Oct 30 11:22:23 1998 Jim Ingham <jingham@cygnus.com> * gdbtk-cmds (gdb_get_tracepoint_info): Fixed typo. Wed Oct 28 10:14:33 1998 Jim Ingham <jingham@cygnus.com> * gdbtk-cmds.c: Made the bdtypes & bpdisp arrays shared so they could be used in gdbtk-hooks.c (breakpoint_notify). Also fixed a few error messages to actually print the bp number rather that #%d... * gdbtk-hooks.c (breakpoint_notify): pass more of the information about the breakpoint into the Tcl command, so it does not have to try and guess about information we have on the C side. * gdbtk.h: Export the bptypes & pbdisp arrays.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog-gdbtk29
-rw-r--r--gdb/gdbtk-cmds.c59
-rw-r--r--gdb/gdbtk-hooks.c34
-rw-r--r--gdb/gdbtk.h6
-rw-r--r--gdb/tracepoint.c3
-rw-r--r--gdb/tracepoint.h1
6 files changed, 116 insertions, 16 deletions
diff --git a/gdb/ChangeLog-gdbtk b/gdb/ChangeLog-gdbtk
index d34f3d2..fede2f3 100644
--- a/gdb/ChangeLog-gdbtk
+++ b/gdb/ChangeLog-gdbtk
@@ -1,3 +1,13 @@
+Wed Nov 4 12:41:42 1998 Jim Ingham <jingham@cygnus.com>
+
+ * gdbtk-cmds.c (gdb_set_bp_addr): Pass the type, enable & thread
+ to gdbtk_tcl_breakpoint.
+ * gdbtk-hooks.c (gdbtk_trace_find): Added this function. It is
+ the hook function for tfind commands.
+ * tracepoint.c (trace_find_command): Added the trace_find_hook,
+ run when you do trace_find_command.
+ * tracepoint.h: Define the trace_find_hook.
+
1998-11-03 Keith Seitz <keiths@cygnus.com>
* v850ice.c (do_gdb): New function.
@@ -5,11 +15,30 @@
(ice_nexti): Use do_gdb to step properly.
(view_source): Correct call to src window's location for new version.
+Mon Nov 2 11:16:10 1998 Jim Ingham <jingham@cygnus.com>
+
+ * gdbtk-cmds (gdb_get_tracepoint_info): Demangle C++ function names.
+
+Fri Oct 30 11:22:23 1998 Jim Ingham <jingham@cygnus.com>
+
+ * gdbtk-cmds (gdb_get_tracepoint_info): Fixed typo.
+
Wed Oct 28 16:19:02 1998 Martin M. Hunt <hunt@cygnus.com>
* gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full
pathname instead of just basename.
+Wed Oct 28 10:14:33 1998 Jim Ingham <jingham@cygnus.com>
+
+ * gdbtk-cmds.c: Made the bdtypes & bpdisp arrays shared so they
+ could be used in gdbtk-hooks.c (breakpoint_notify).
+ Also fixed a few error messages to actually print the bp number
+ rather that #%d...
+ * gdbtk-hooks.c (breakpoint_notify): pass more of the information
+ about the breakpoint into the Tcl command, so it does not have to
+ try and guess about information we have on the C side.
+ * gdbtk.h: Export the bptypes & pbdisp arrays.
+
1998-10-08 Keith Seitz <keiths@cygnus.com>
* gdbtk-hooks.c (gdbtk_add_hooks): Install a hook for
diff --git a/gdb/gdbtk-cmds.c b/gdb/gdbtk-cmds.c
index 53e027d..4197426 100644
--- a/gdb/gdbtk-cmds.c
+++ b/gdb/gdbtk-cmds.c
@@ -131,6 +131,18 @@ struct my_line_entry {
static char old_regs[REGISTER_BYTES];
+/* These two lookup tables are used to translate the type & disposition fields
+ of the breakpoint structure (respectively) into something gdbtk understands.
+ They are also used in gdbtk-hooks.c */
+
+char *bptypes[] = {"breakpoint", "hardware breakpoint", "until",
+ "finish", "watchpoint", "hardware watchpoint",
+ "read watchpoint", "access watchpoint",
+ "longjmp", "longjmp resume", "step resume",
+ "through sigtramp", "watchpoint scope",
+ "call dummy" };
+char *bpdisp[] = {"delete", "delstop", "disable", "donttouch"};
+
/*
* These are routines we need from breakpoint.c.
* at some point make these static in breakpoint.c and move GUI code there
@@ -1820,7 +1832,7 @@ gdb_get_tracepoint_info (clientData, interp, objc, objv)
struct tracepoint *tp;
struct action_line *al;
Tcl_Obj *action_list;
- char *filename, *funcname;
+ char *filename, *funcname, *fname;
char tmp[19];
if (objc != 2)
@@ -1841,7 +1853,9 @@ gdb_get_tracepoint_info (clientData, interp, objc, objv)
if (tp == NULL)
{
- Tcl_SetStringObj (result_ptr->obj_ptr, "Tracepoint #%d does not exist", -1);
+ char buff[64];
+ sprintf (buff, "Tracepoint #%d does not exist", tpnum);
+ Tcl_SetStringObj (result_ptr->obj_ptr, buff, -1);
return TCL_ERROR;
}
@@ -1852,8 +1866,19 @@ gdb_get_tracepoint_info (clientData, interp, objc, objv)
filename = "N/A";
Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
Tcl_NewStringObj (filename, -1));
+
find_pc_partial_function (tp->address, &funcname, NULL, NULL);
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewStringObj (funcname, -1));
+ fname = cplus_demangle (funcname, 0);
+ if (fname)
+ {
+ Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewStringObj
+ (fname, -1));
+ free (fname);
+ }
+ else
+ Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewStringObj
+ (funcname, -1));
+
Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewIntObj (sal.line));
sprintf (tmp, "0x%lx", tp->address);
Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewStringObj (tmp, -1));
@@ -2688,7 +2713,7 @@ gdb_loadfile (clientData, interp, objc, objv)
cur_cmd = &text_cmd_1;
cur_prefix_len = prefix_len_1;
Tcl_DStringAppend (cur_cmd, line_num_buf, -1);
- Tcl_DStringAppend (cur_cmd, "} break_tag", 11);
+ Tcl_DStringAppend (cur_cmd, "} break_rgn_tag", 15);
}
else
{
@@ -2708,7 +2733,7 @@ gdb_loadfile (clientData, interp, objc, objv)
}
else
{
- Tcl_DStringAppend (&text_cmd_1, " insert end {- } break_tag", -1);
+ Tcl_DStringAppend (&text_cmd_1, " insert end {- } break_rgn_tag", -1);
prefix_len_1 = Tcl_DStringLength(&text_cmd_1);
Tcl_DStringAppend (&text_cmd_2, " insert end { } \"\"", -1);
prefix_len_2 = Tcl_DStringLength(&text_cmd_2);
@@ -2853,6 +2878,12 @@ gdb_set_bp (clientData, interp, objc, objv)
Tcl_DStringAppendElement (&cmd, buf);
Tcl_DStringAppendElement (&cmd, Tcl_GetStringFromObj (objv[2], NULL));
Tcl_DStringAppendElement (&cmd, Tcl_GetStringFromObj (objv[1], NULL));
+ Tcl_DStringAppendElement (&cmd, bpdisp[b->disposition]);
+ sprintf (buf, "%d", b->enable);
+ Tcl_DStringAppendElement (&cmd, buf);
+ sprintf (buf, "%d", b->thread);
+ Tcl_DStringAppendElement (&cmd, buf);
+
ret = Tcl_Eval (interp, Tcl_DStringValue (&cmd));
Tcl_DStringFree (&cmd);
@@ -2889,7 +2920,7 @@ gdb_set_bp_addr (clientData, interp, objc, objv)
if (objc != 4 && objc != 3)
{
- Tcl_WrongNumArgs(interp, 1, objv, "addr type [thread]");
+ Tcl_WrongNumArgs(interp, 1, objv, "addr type ?thread?");
return TCL_ERROR;
}
@@ -2942,6 +2973,11 @@ gdb_set_bp_addr (clientData, interp, objc, objv)
if (filename == NULL)
filename = "";
Tcl_DStringAppendElement (&cmd, filename);
+ Tcl_DStringAppendElement (&cmd, bpdisp[b->disposition]);
+ sprintf (buf, "%d", b->enable);
+ Tcl_DStringAppendElement (&cmd, buf);
+ sprintf (buf, "%d", b->thread);
+ Tcl_DStringAppendElement (&cmd, buf);
ret = Tcl_Eval (interp, Tcl_DStringValue (&cmd));
Tcl_DStringFree (&cmd);
@@ -3055,13 +3091,6 @@ gdb_get_breakpoint_info (clientData, interp, objc, objv)
Tcl_Obj *CONST objv[];
{
struct symtab_and_line sal;
- static char *bptypes[] = {"breakpoint", "hardware breakpoint", "until",
- "finish", "watchpoint", "hardware watchpoint",
- "read watchpoint", "access watchpoint",
- "longjmp", "longjmp resume", "step resume",
- "through sigtramp", "watchpoint scope",
- "call dummy" };
- static char *bpdisp[] = {"delete", "delstop", "disable", "donttouch"};
struct command_line *cmd;
int bpnum;
struct breakpoint *b;
@@ -3087,7 +3116,9 @@ gdb_get_breakpoint_info (clientData, interp, objc, objv)
if (!b || b->type != bp_breakpoint)
{
- Tcl_SetStringObj (result_ptr->obj_ptr, "Breakpoint #%d does not exist", -1);
+ char err_buf[64];
+ sprintf(err_buf, "Breakpoint #%d does not exist.", bpnum);
+ Tcl_SetStringObj (result_ptr->obj_ptr, err_buf, -1);
return TCL_ERROR;
}
diff --git a/gdb/gdbtk-hooks.c b/gdb/gdbtk-hooks.c
index 4b4a04e..09f9ca0 100644
--- a/gdb/gdbtk-hooks.c
+++ b/gdb/gdbtk-hooks.c
@@ -84,6 +84,7 @@ extern void (*ui_loop_hook) PARAMS ((int));
static void gdbtk_create_tracepoint PARAMS ((struct tracepoint *));
static void gdbtk_delete_tracepoint PARAMS ((struct tracepoint *));
static void gdbtk_modify_tracepoint PARAMS ((struct tracepoint *));
+static void gdbtk_trace_find PARAMS ((char *arg, int from_tty));
static void gdbtk_create_breakpoint PARAMS ((struct breakpoint *));
static void gdbtk_delete_breakpoint PARAMS ((struct breakpoint *));
static void gdbtk_modify_breakpoint PARAMS ((struct breakpoint *));
@@ -160,6 +161,7 @@ gdbtk_add_hooks(void)
create_tracepoint_hook = gdbtk_create_tracepoint;
delete_tracepoint_hook = gdbtk_delete_tracepoint;
modify_tracepoint_hook = gdbtk_modify_tracepoint;
+ trace_find_hook = gdbtk_trace_find;
pc_changed_hook = pc_changed;
selected_frame_level_changed_hook = gdbtk_selected_frame_changed;
@@ -548,8 +550,9 @@ breakpoint_notify(b, action)
if (filename == NULL)
filename = "";
- sprintf (buf, "gdbtk_tcl_breakpoint %s %d 0x%lx %d {%s}", action, b->number,
- (long)b->address, b->line_number, filename);
+ sprintf (buf, "gdbtk_tcl_breakpoint %s %d 0x%lx %d {%s} {%s} %d %d",
+ action, b->number, (long)b->address, b->line_number, filename,
+ bpdisp[b->disposition], b->enable, b->thread);
v = Tcl_Eval (gdbtk_interp, buf);
@@ -692,6 +695,33 @@ tracepoint_notify(tp, action)
}
}
+/*
+ * gdbtk_trace_find
+ *
+ * This is run by the trace_find_command. arg is the argument that was passed
+ * to that command, from_tty is 1 if the command was run from a tty, 0 if it
+ * was run from a script. It runs gdbtk_tcl_tfind_hook passing on these two
+ * arguments.
+ *
+ */
+
+static void
+gdbtk_trace_find (arg, from_tty)
+ char *arg;
+ int from_tty;
+{
+ Tcl_Obj *cmdObj;
+
+ Tcl_GlobalEval (gdbtk_interp, "debug {***In gdbtk_trace_find...}");
+ cmdObj = Tcl_NewListObj (0, NULL);
+ Tcl_ListObjAppendElement (gdbtk_interp, cmdObj,
+ Tcl_NewStringObj ("gdbtk_tcl_trace_find_hook", -1));
+ Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewStringObj (arg, -1));
+ Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewIntObj(from_tty));
+ Tcl_GlobalEvalObj (gdbtk_interp, cmdObj);
+
+}
+
static void
gdbtk_selected_frame_changed (level)
int level;
diff --git a/gdb/gdbtk.h b/gdb/gdbtk.h
index a138a33..89aa19f 100644
--- a/gdb/gdbtk.h
+++ b/gdb/gdbtk.h
@@ -78,6 +78,12 @@ extern int load_in_progress;
extern Tcl_Interp *gdbtk_interp;
+/* These two are lookup tables for elements of the breakpoint structure that
+ gdbtk knows by string name. They are defined in gdbtk-cmds.c */
+
+extern char *bptypes[];
+extern char *bpdisp[];
+
/*
* This structure controls how the gdb output is fed into call_wrapper invoked
* commands. See the explanation of gdbtk_fputs in gdbtk_hooks.c for more details.
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index e19485f..b0b2d33 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1928,6 +1928,9 @@ trace_find_command (args, from_tty)
if (target_is_remote ())
{
+ if (trace_find_hook)
+ trace_find_hook (args, from_tty);
+
if (args == 0 || *args == 0)
{ /* TFIND with no args means find NEXT trace frame. */
if (traceframe_number == -1)
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
index 2ffe3bd..2dc13bd 100644
--- a/gdb/tracepoint.h
+++ b/gdb/tracepoint.h
@@ -114,6 +114,7 @@ extern unsigned long trace_running_p;
void (*create_tracepoint_hook) PARAMS ((struct tracepoint *));
void (*delete_tracepoint_hook) PARAMS ((struct tracepoint *));
void (*modify_tracepoint_hook) PARAMS ((struct tracepoint *));
+void (*trace_find_hook) PARAMS ((char *arg, int from_tty));
struct tracepoint *get_tracepoint_by_number PARAMS ((char **));
int get_traceframe_number PARAMS ((void));