#include "remote.h"
#include "linespec.h"
#include "regcache.h"
+#include "completer.h"
+#include "gdb-events.h"
#include "ax.h"
#include "ax-gdb.h"
t->language = current_language->la_language;
t->input_radix = input_radix;
t->line_number = sal.line;
- t->enabled = enabled;
+ t->enabled_p = 1;
t->next = 0;
t->step_count = 0;
t->pass_count = 0;
t->addr_string = savestring (addr_start, addr_end - addr_start);
trace_mention (t);
-
- /* Let the UI know of any additions */
- if (create_tracepoint_hook)
- create_tracepoint_hook (t);
}
if (sals.nelts > 1)
{
printf_filtered ("Num Enb ");
if (addressprint)
- printf_filtered ("Address ");
+ {
+ if (TARGET_ADDR_BIT <= 32)
+ printf_filtered ("Address ");
+ else
+ printf_filtered ("Address ");
+ }
printf_filtered ("PassC StepC What\n");
}
strcpy (wrap_indent, " ");
if (addressprint)
- strcat (wrap_indent, " ");
+ {
+ if (TARGET_ADDR_BIT <= 32)
+ strcat (wrap_indent, " ");
+ else
+ strcat (wrap_indent, " ");
+ }
printf_filtered ("%-3d %-3s ", t->number,
- t->enabled == enabled ? "y" : "n");
+ t->enabled_p ? "y" : "n");
if (addressprint)
- printf_filtered ("%s ",
- local_hex_string_custom ((unsigned long) t->address,
- "08l"));
+ {
+ char *tmp;
+
+ if (TARGET_ADDR_BIT <= 32)
+ tmp = longest_local_hex_string_custom (t->address
+ & (CORE_ADDR) 0xffffffff,
+ "08l");
+ else
+ tmp = longest_local_hex_string_custom (t->address, "016l");
+
+ printf_filtered ("%s ", tmp);
+ }
printf_filtered ("%-5d %-5ld ", t->pass_count, t->step_count);
if (t->source_file)
switch (opcode)
{
case enable_op:
- t->enabled = enabled;
- if (modify_tracepoint_hook)
- modify_tracepoint_hook (t);
+ t->enabled_p = 1;
+ tracepoint_modify_event (t->number);
break;
case disable_op:
- t->enabled = disabled;
- if (modify_tracepoint_hook)
- modify_tracepoint_hook (t);
+ t->enabled_p = 0;
+ tracepoint_modify_event (t->number);
break;
case delete_op:
if (tracepoint_chain == t)
ALL_TRACEPOINTS (t2)
if (t2->next == t)
{
+ tracepoint_delete_event (t2->number);
t2->next = t->next;
break;
}
- /* Let the UI know of any deletions */
- if (delete_tracepoint_hook)
- delete_tracepoint_hook (t);
-
if (t->addr_string)
xfree (t->addr_string);
if (t->source_file)
if (t1 == (struct tracepoint *) -1 || t1 == t2)
{
t2->pass_count = count;
- if (modify_tracepoint_hook)
- modify_tracepoint_hook (t2);
+ tracepoint_modify_event (t2->number);
if (from_tty)
printf_filtered ("Setting tracepoint %d's passcount to %d\n",
t2->number, count);
/* Control-C quits instantly if typed while in this loop
since it should not wait until the user types a newline. */
immediate_quit++;
+ /* FIXME: kettenis/20010823: Something is wrong here. In this file
+ STOP_SIGNAL is never defined. So this code has been left out, at
+ least for quite a while now. Replacing STOP_SIGNAL with SIGTSTP
+ leads to compilation failures since the variable job_control
+ isn't declared. Leave this alone for now. */
#ifdef STOP_SIGNAL
if (job_control)
{
struct collection_list *collect;
struct cmd_list_element *cmd;
struct agent_expr *aexpr;
- long frame_reg, frame_offset;
+ int frame_reg;
+ LONGEST frame_offset;
clear_collection_list (&tracepoint_list);
struct cleanup *old_chain1 = NULL;
struct agent_reqs areqs;
- exp = parse_exp_1 (&action_exp, block_for_pc (t->address), 1);
+ exp = parse_exp_1 (&action_exp,
+ block_for_pc (t->address), 1);
old_chain = make_cleanup (free_current_contents, &exp);
switch (exp->elts[0].opcode)
sprintf_vma (tmp, t->address);
sprintf (buf, "QTDP:%x:%s:%c:%lx:%x", t->number, tmp, /* address */
- t->enabled == enabled ? 'E' : 'D',
+ t->enabled_p ? 'E' : 'D',
t->step_count, t->pass_count);
if (t->actions)
No argument means enable all tracepoints.",
&enablelist);
- add_com ("trace", class_trace, trace_command,
- "Set a tracepoint at a specified line or function or address.\n\
+ c = add_com ("trace", class_trace, trace_command,
+ "Set a tracepoint at a specified line or function or address.\n\
Argument may be a line number, function name, or '*' plus an address.\n\
For a line number or function, trace at the start of its code.\n\
If an address is specified, trace at that exact address.\n\n\
Do \"help tracepoints\" for info on other tracepoint commands.");
+ c->completer = location_completer;
add_com_alias ("tp", "trace", class_alias, 0);
add_com_alias ("tr", "trace", class_alias, 1);