/* Tracing functionality for remote targets in custom GDB protocol
- Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
- Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of GDB.
#define MAX_AGENT_EXPR_LEN 184
-extern void (*readline_begin_hook) (char *, ...);
-extern char *(*readline_hook) (char *);
-extern void (*readline_end_hook) (void);
+extern void (*deprecated_readline_begin_hook) (char *, ...);
+extern char *(*deprecated_readline_hook) (char *);
+extern void (*deprecated_readline_end_hook) (void);
extern void x_command (char *, int);
extern int addressprint; /* Print machine addresses? */
if (from_tty)
{
- if (readline_begin_hook)
- (*readline_begin_hook) ("%s %s\n", tmpbuf, end_msg);
+ if (deprecated_readline_begin_hook)
+ (*deprecated_readline_begin_hook) ("%s %s\n", tmpbuf, end_msg);
else if (input_from_terminal_p ())
printf_filtered ("%s\n%s\n", tmpbuf, end_msg);
}
t->step_count = 0; /* read_actions may set this */
read_actions (t);
- if (readline_end_hook)
- (*readline_end_hook) ();
+ if (deprecated_readline_end_hook)
+ (*deprecated_readline_end_hook) ();
/* tracepoints_changed () */
}
/* else just return */
gdb_flush (gdb_stdout);
gdb_flush (gdb_stderr);
- if (readline_hook && instream == NULL)
- line = (*readline_hook) (prompt);
+ if (deprecated_readline_hook && instream == NULL)
+ line = (*deprecated_readline_hook) (prompt);
else if (instream == stdin && ISATTY (instream))
{
line = gdb_readline_wrapper (prompt);
anysecs = 1;
lma = s->lma;
- size = bfd_get_section_size_before_reloc (s);
+ size = bfd_get_section_size (s);
sprintf_vma (tmp1, lma);
sprintf_vma (tmp2, lma + size);
sprintf (target_buf + strlen (target_buf),
set_tracepoint_num (-1);
set_traceframe_context (-1);
trace_running_p = 1;
- if (trace_start_stop_hook)
- trace_start_stop_hook (1, from_tty);
+ if (deprecated_trace_start_stop_hook)
+ deprecated_trace_start_stop_hook (1, from_tty);
}
else
if (strcmp (target_buf, "OK"))
error ("Bogus reply from target: %s", target_buf);
trace_running_p = 0;
- if (trace_start_stop_hook)
- trace_start_stop_hook (0, from_tty);
+ if (deprecated_trace_start_stop_hook)
+ deprecated_trace_start_stop_hook (0, from_tty);
}
else
error ("Trace can only be run on remote targets.");
if (from_tty)
{
- int source_only;
+ enum print_what print_what;
/* NOTE: in immitation of the step command, try to determine
whether we have made a transition from one function to another.
(old_frame_addr == 0 ||
get_frame_base (get_current_frame ()) == 0 ||
old_frame_addr == get_frame_base (get_current_frame ())))
- source_only = -1;
+ print_what = SRC_LINE;
else
- source_only = 1;
+ print_what = SRC_AND_LOC;
- print_stack_frame (deprecated_selected_frame,
- frame_relative_level (deprecated_selected_frame),
- source_only);
+ print_stack_frame (get_selected_frame (), 1, print_what);
do_displays ();
}
}
if (target_is_remote ())
{
- if (trace_find_hook)
- trace_find_hook (args, from_tty);
+ if (deprecated_trace_find_hook)
+ deprecated_trace_find_hook (args, from_tty);
if (args == 0 || *args == 0)
{ /* TFIND with no args means find NEXT trace frame. */
sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
if (sals.nelts == 0)
- return; /* presumably decode_line_1 has already warned */
+ return; /* presumably decode_line_1 has already warned */
/* Resolve line numbers to PC */
resolve_sal_pc (&sals.sals[0]);
break;
case LOC_STATIC:
printf_filtered ("in static storage at address ");
- print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 1, gdb_stdout);
+ print_address_numeric (SYMBOL_VALUE_ADDRESS (sym),
+ 1, gdb_stdout);
break;
case LOC_REGISTER:
printf_filtered ("a local variable in register $%s",
continue;
case LOC_LABEL:
printf_filtered ("a label at address ");
- print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 1, gdb_stdout);
+ print_address_numeric (SYMBOL_VALUE_ADDRESS (sym),
+ 1, gdb_stdout);
break;
case LOC_BLOCK:
printf_filtered ("a function at address ");
- print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)), 1,
- gdb_stdout);
+ print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)),
+ 1, gdb_stdout);
break;
case LOC_BASEREG:
printf_filtered ("a variable at offset %ld from register $%s",
REGISTER_NAME (SYMBOL_BASEREG (sym)));
break;
case LOC_UNRESOLVED:
- msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL);
+ msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym),
+ NULL, NULL);
if (msym == NULL)
printf_filtered ("Unresolved Static");
else
case LOC_OPTIMIZED_OUT:
printf_filtered ("optimized out.\n");
continue;
+ case LOC_HP_THREAD_LOCAL_STATIC:
+ printf_filtered ("HP thread local static ");
+ break;
+ case LOC_INDIRECT:
+ printf_filtered ("extern (local indirect) at address ");
+ print_address_numeric (SYMBOL_VALUE_ADDRESS (sym),
+ 1, gdb_stdout);
+ break;
+ case LOC_COMPUTED:
+ case LOC_COMPUTED_ARG:
+ SYMBOL_OPS (sym)->describe_location (sym, gdb_stdout);
+ break;
}
if (SYMBOL_TYPE (sym))
printf_filtered (", length %d.\n",
- TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
+ TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
}
if (BLOCK_FUNCTION (block))
break;