* target.h (enum trace_find_type): New enum.
(struct target_ops): New fields to_trace_init,
to_download_tracepoint, to_download_trace_state_variable,
to_trace_set_readonly_regions, to_trace_start, to_get_trace_status,
to_trace_stop, to_trace_find, to_get_trace_state_variable_value,
to_set_disconnected_tracing.
(target_trace_init): New macro.
(target_download_tracepoint): New macro.
(target_download_trace_state_variable): New macro.
(target_trace_start): New macro.
(target_trace_set_readonly_regions): New macro.
(target_get_trace_status): New macro.
(target_trace_stop): New macro.
(target_trace_find): New macro.
(target_get_trace_state_variable_value): New macro.
(target_set_disconnected_tracing): New macro.
* target.c (update_current_target): Inherit and set defaults for
tracepoint operations.
* tracepoint.c (default_collect): Make globally visible.
(target_is_remote): Remove, along with all calls.
(tvariables_info): Call target_get_trace_state_variable_value.
(remote_set_transparent_ranges): Remove.
(trace_start_command): Call target_trace_init,
target_download_tracepoint, etc.
(download_tracepoint): Remove.
(trace_stop_command): Simplify.
(stop_tracing): Call target_trace_stop.
(get_trace_status): Call target_get_trace_status.
(trace_status_command): Add case for targets that cannot trace.
(finish_tfind_command): Change to take numerical arguments, call
target_trace_find.
(trace_find_command): Update call to finish_tfind_command.
(trace_find_pc_command): Ditto.
(trace_find_tracepoint_command): Ditto.
(trace_find_line_command): Ditto.
(trace_find_range_command): Ditto.
(trace_find_outside_command): Ditto.
(set_disconnected_tracing_value): Call
target_set_disconnected_tracing.
* remote.c: Add protocol encoding bits from tracepoint.c.
(trace_error): Move from tracepoint.c.
(remote_get_noisy_reply): Ditto.
(free_actions_list_cleanup_wrapper): Ditto.
(free_actions_list): Ditto.
(remote_trace_init): New function.
(remote_download_tracepoint): New function.
(remote_download_trace_state_variable): New function.
(remote_trace_set_readonly_regions): New function.
(remote_trace_start): New function.
(remote_get_trace_status): New function.
(remote_trace_stop): New function.
(remote_trace_find): New function.
(remote_download_trace_state_variable): New function.
(remote_set_disconnected_tracing): New function.
(init_remote_ops): Add tracepoint operations.
Add trace state variables.
* ax.h (enum agent_op): Add getv, setv, and tracev.
(ax_tsv): Declare.
* ax-gdb.c: Include tracepoint.h.
(gen_expr): Handle BINOP_ASSIGN, BINOP_ASSIGN_MODIFY, and
OP_INTERNALVAR.
(gen_expr_binop_rest): New function, split from gen_expr.
* ax-general.c (ax_tsv): New function.
(aop_map): Add new bytecodes.
* tracepoint.h (struct trace_state_variable): New struct.
(tsv_s): New typedef.
(find_trace_state_variable): Declare.
* tracepoint.c (tvariables): New global.
(next_tsv_number): New global.
(create_trace_state_variable): New function.
(find_trace_state_variable): New function.
(delete_trace_state_variable): New function.
(trace_variable_command): New function.
(delete_trace_variable_command): New function.
(tvariables_info): New function.
(trace_start_command): Download tsvs with initial values.
(_initialize_tracepoint): Add new commands.
* NEWS: Mention the addition of trace state variables.
==> doc/ChangeLog <==
2009-12-28 Stan Shebs <stan@codesourcery.com>
* gdb.texinfo (Trace State Variables): New section.
(Tracepoint Packets): Describe trace state variable packets.
* agentexpr.texi (Bytecode Descriptions): Describe trace state
variable bytecodes.
==> testsuite/ChangeLog <==
2009-12-28 Stan Shebs <stan@codesourcery.com>
* gdb.trace/tsv.exp: New file.
* gdb.base/completion.exp: Update ambiguous info output.
`enable' and `disable' identifiers, because some platforms define
in their system headers symbols with global scope that go by those
names.
* breakpoint.h (enum enable_state): Rename from `enum enable'.
Also rename all the enum members to have the "bp_" prefix.
(struct breakpoint): Rename the `enable' member to `enable_state'.
(enum bpdisp): Rename all members to have the "disp_" prefix.
* breakpoint.c: All users of `enum enable' and `enum bpdisp'
changed.
(args_for_catchpoint_enable): Rename the `enable' member to
`enable_p'. All users changed.
* tracepoint.h (enum enable): Remove.
(struct tracepoint): The member `enabled' is now `int enabled_p'.
* tracepoint.c: All users of the `enabled' member changed.
* printcmd.c (struct display): The `status' member is now an int.
* memattr.h (struct mem_region): Rename the `status' member to
`enabled_p'.
(enum enable): Remove.
* memattr.c: Change all users of the `status' member of struct
mem_region to use `enabled_p' instead.
* infcmd.c (run_stack_dummy): Use disp_del instead of del.
* go32-nat.c: Remove the kludgey work-around for conflicts between
<dos.h> and "breakpoint.h".
* tui/tuiSourceWin.c: Use disp_del instead of del.
* tui/tuiSource.c: Use disp_del instead of del.
* tui/tuiDisassem.c: Use disp_del instead of del.
* console.tcl (complete): I added the ability to pass from_tty
from gdb_cmd to the underlying commands. Pass 1 when the
command is invoked from the console.
* interface.tcl (gdbtk_tcl_tstart, gdbtk_tcl_tstop): Run the
src window's do_tstop method rather than manipulating the
widgets by hand.
* src.tcl (build_win): Redo the packing so that the function
combobox doesn't push all the other combo-boxes off the screen
if it has a very long function name in it.
* srcbar.tcl (do_tstop): Added a mode that just changes the
GUI, which can be called from console hooks.
* srctextwin.tcl: Fixed some bugs I introduced in setting
breakpoints in the assembly & mixed mode windows. Dropped
the notion of joint breakpoint images for lines that have
breakpoints of two separate types. Too fragile.
Also added the "dont_change_appearance" flag, used in the
continue_to_here method to tell the GUI not to reflect the
temporary disabling of all the breakpoints.
* toolbar.tcl (insert_buttons): Added a little more error-checking.
Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com>
* gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the
gdb_cmd, which is from_tty. This is passed to the gdb command
parser. It is 0 by default, and the console window passes 1.
* gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c
with all the other link-var'ed variables
* gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if
we are called from_tty.
* gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons
from a trace_start_command callback rather than doing it as a
special case in gdb_cmd.
* tracepoint.c (tstart_command, tstop_command): Add call to
trace_start_stop_hook here.
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.
[Support for trace debugging: registers that were not collected.]
* remote.c (remote_fetch_registers): accept 'xxxx' in the register
packet, with the meaning "register value is not available".
Set register_valid to -1, which will connote "no value available".
* findvar.c (read_relative_register_raw_bytes): return failure if
register_valid == -1. (value_of_register): return failure if
register_valid == -1. (read_var_value): return error if
value_of_register fails for a register variable.
(value_from_register): return failure if register_valid == -1.
* eval.c (evaluate_subexp_standard): return error if
value_of_register fails for a register used in an expression.
* infcmd.c (do_registers_info): display "value not available"
for registers for which register_valid == -1.
* tracepoint.c (set_raw_tracepoint): just save the filename as is
from the symbol table, rather than trying to prepend the dir name.
Also save the bfd section. (tracepoints_info): use the section
when looking up the function name.
* tracepoint.h: add section field to tracepoint struct.
* 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
if it exists.
Remove static declaration of free_actions.
* tracepoint.h: Add declaration of free_actions.
* gdbtk.c (gdbtk_modify_tracepoint): Define new tracepoint modification
hook.
(gdbtk_print_frame_info): Define this hook so that current_source_symtab
is set properly.
(gdb_actions_command): Use free_actions () from tracepoint.c/h.
not yet ready for public release, so no changelog entry yet (and I'm
sanitizing the files out). Just want to get them into the repository
for now, so I can begin keeping their history. Not checking in the
Makefile change that would cause them to be built and linked.