1997-11-24 19:38:44 +00:00
|
|
|
/* Data structures associated with tracepoints in GDB.
|
|
|
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
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
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(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
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
#if !defined (TRACEPOINT_H)
|
|
|
|
#define TRACEPOINT_H 1
|
|
|
|
|
1997-11-24 19:47:05 +00:00
|
|
|
#if !defined (BREAKPOINT_H)
|
|
|
|
enum enable { disabled, enabled };
|
|
|
|
#endif
|
1997-11-24 19:38:44 +00:00
|
|
|
/* The data structure for an action: */
|
|
|
|
struct action_line
|
|
|
|
{
|
|
|
|
struct action_line *next;
|
|
|
|
char *action;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* The data structure for a tracepoint: */
|
|
|
|
|
|
|
|
struct tracepoint
|
|
|
|
{
|
|
|
|
struct tracepoint *next;
|
|
|
|
|
1997-11-24 19:47:05 +00:00
|
|
|
enum enable enabled;
|
1997-11-24 19:38:44 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* Type of tracepoint (MVS FIXME: needed?). */
|
|
|
|
enum tptype type;
|
|
|
|
|
|
|
|
/* What to do with this tracepoint after we hit it MVS FIXME: needed?). */
|
|
|
|
enum tpdisp disposition;
|
|
|
|
#endif
|
|
|
|
/* Number assigned to distinguish tracepoints. */
|
|
|
|
int number;
|
|
|
|
|
|
|
|
/* Address to trace at, or NULL if not an instruction tracepoint (MVS ?). */
|
|
|
|
CORE_ADDR address;
|
|
|
|
|
|
|
|
/* Line number of this address. Only matters if address is non-NULL. */
|
|
|
|
int line_number;
|
|
|
|
|
|
|
|
/* Source file name of this address. Only matters if address is non-NULL. */
|
|
|
|
char *source_file;
|
|
|
|
|
|
|
|
/* Number of times this tracepoint should single-step
|
|
|
|
and collect additional data */
|
|
|
|
long step_count;
|
|
|
|
|
|
|
|
/* Number of times this tracepoint should be hit before disabling/ending. */
|
|
|
|
int pass_count;
|
|
|
|
|
|
|
|
/* Chain of action lines to execute when this tracepoint is hit. */
|
|
|
|
struct action_line *actions;
|
|
|
|
|
|
|
|
/* Conditional (MVS ?). */
|
|
|
|
struct expression *cond;
|
|
|
|
|
|
|
|
/* String we used to set the tracepoint (malloc'd). Only matters if
|
|
|
|
address is non-NULL. */
|
|
|
|
char *addr_string;
|
|
|
|
|
|
|
|
/* Language we used to set the tracepoint. */
|
|
|
|
enum language language;
|
|
|
|
|
|
|
|
/* Input radix we used to set the tracepoint. */
|
|
|
|
int input_radix;
|
|
|
|
|
|
|
|
/* Count of the number of times this tracepoint was taken, dumped
|
|
|
|
with the info, but not used for anything else. Useful for
|
|
|
|
seeing how many times you hit a tracepoint prior to the program
|
|
|
|
aborting, so you can back up to just before the abort. */
|
|
|
|
int hit_count;
|
|
|
|
|
1998-10-29 18:07:01 +00:00
|
|
|
/* Thread number for thread-specific tracepoint, or -1 if don't care */
|
1997-11-24 19:38:44 +00:00
|
|
|
int thread;
|
1998-10-29 18:07:01 +00:00
|
|
|
|
|
|
|
/* BFD section, in case of overlays:
|
|
|
|
no, I don't know if tracepoints are really gonna work with overlays. */
|
|
|
|
asection *section;
|
1997-11-24 19:38:44 +00:00
|
|
|
};
|
|
|
|
|
1998-06-03 20:14:26 +00:00
|
|
|
enum actionline_type
|
|
|
|
{
|
|
|
|
BADLINE = -1,
|
|
|
|
GENERIC = 0,
|
|
|
|
END = 1,
|
|
|
|
STEPPING = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1997-11-24 19:47:05 +00:00
|
|
|
/* The tracepont chain of all tracepoints */
|
|
|
|
|
|
|
|
extern struct tracepoint *tracepoint_chain;
|
|
|
|
|
1998-03-27 03:36:27 +00:00
|
|
|
extern unsigned long trace_running_p;
|
|
|
|
|
1997-11-24 19:47:05 +00:00
|
|
|
/* A hook used to notify the UI of tracepoint operations */
|
|
|
|
|
|
|
|
void (*create_tracepoint_hook) PARAMS ((struct tracepoint *));
|
|
|
|
void (*delete_tracepoint_hook) PARAMS ((struct tracepoint *));
|
1998-02-11 02:33:22 +00:00
|
|
|
void (*modify_tracepoint_hook) PARAMS ((struct tracepoint *));
|
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.
1998-11-05 18:12:23 +00:00
|
|
|
void (*trace_find_hook) PARAMS ((char *arg, int from_tty));
|
1997-11-24 19:47:05 +00:00
|
|
|
|
|
|
|
struct tracepoint *get_tracepoint_by_number PARAMS ((char **));
|
1998-06-03 20:14:26 +00:00
|
|
|
int get_traceframe_number PARAMS ((void));
|
1998-02-11 02:33:22 +00:00
|
|
|
void free_actions PARAMS((struct tracepoint *));
|
1998-06-03 20:14:26 +00:00
|
|
|
enum actionline_type validate_actionline PARAMS((char **,
|
|
|
|
struct tracepoint *));
|
|
|
|
|
1997-11-24 19:47:05 +00:00
|
|
|
|
|
|
|
/* Walk the following statement or block through all tracepoints.
|
|
|
|
ALL_TRACEPOINTS_SAFE does so even if the statment deletes the current
|
|
|
|
breakpoint. */
|
|
|
|
|
|
|
|
#define ALL_TRACEPOINTS(t) for (t = tracepoint_chain; t; t = t->next)
|
1997-11-24 19:38:44 +00:00
|
|
|
|
1997-11-24 19:47:05 +00:00
|
|
|
#define ALL_TRACEPOINTS_SAFE(t,tmp) \
|
|
|
|
for (t = tracepoint_chain; \
|
|
|
|
t ? (tmp = t->next, 1) : 0;\
|
|
|
|
t = tmp)
|
1997-11-24 19:38:44 +00:00
|
|
|
#endif /* TRACEPOINT_H */
|