#include "symfile.h"
#include "extension.h"
-void (*deprecated_selected_frame_level_changed_hook) (int);
-
/* The possible choices of "set print frame-arguments", and the value
of this setting. */
TRY
{
- argp->val = read_var_value (sym, frame);
+ argp->val = read_var_value (sym, NULL, frame);
}
CATCH (except, RETURN_MASK_ERROR)
{
{
TRY
{
- val = read_var_value (sym, frame);
+ val = read_var_value (sym, NULL, frame);
}
CATCH (except, RETURN_MASK_ERROR)
{
TRY
{
- val = read_var_value (sym, frame);
+ val = read_var_value (sym, NULL, frame);
}
CATCH (except, RETURN_MASK_ERROR)
{
struct symbol *nsym;
nsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym),
- b, VAR_DOMAIN, NULL);
+ b, VAR_DOMAIN, NULL).symbol;
gdb_assert (nsym != NULL);
if (SYMBOL_CLASS (nsym) == LOC_REGISTER
&& !SYMBOL_IS_ARGUMENT (nsym))
do_cleanups (old_chain);
}
-static void
-backtrace_full_command (char *arg, int from_tty)
-{
- backtrace_command_1 (arg, 1 /* show_locals */, 0, from_tty);
-}
-\f
-
/* Iterate over the local variables of a block B, calling CB with
CB_DATA. */
are not combined in symbol-reading. */
sym2 = lookup_symbol (SYMBOL_LINKAGE_NAME (sym),
- b, VAR_DOMAIN, NULL);
+ b, VAR_DOMAIN, NULL).symbol;
(*cb) (SYMBOL_PRINT_NAME (sym), sym2, cb_data);
}
}
gdb_stdout);
}
-
-static void
-args_plus_locals_info (char *ignore, int from_tty)
-{
- args_info (ignore, from_tty);
- locals_info (ignore, from_tty);
-}
-\f
-
/* Select frame FRAME. Also print the stack frame and show the source
if this is the tui version. */
static void
print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
}
-/* The XDB Compatibility command to print the current frame. */
-
-static void
-current_frame_command (char *level_exp, int from_tty)
-{
- print_stack_frame (get_selected_frame (_("No stack.")), 1, SRC_AND_LOC, 1);
-}
-
/* Select the frame up one or COUNT_EXP stack levels from the
previously selected frame, and print it briefly. */
return_type = value_type (return_value);
}
do_cleanups (old_chain);
- CHECK_TYPEDEF (return_type);
+ return_type = check_typedef (return_type);
return_value = value_cast (return_type, return_value);
/* Make sure the value is fully evaluated. It may live in the
value_fetch_lazy (return_value);
if (thisfun != NULL)
- function = read_var_value (thisfun, thisframe);
+ function = read_var_value (thisfun, NULL, thisframe);
rv_conv = RETURN_VALUE_REGISTER_CONVENTION;
if (TYPE_CODE (return_type) == TYPE_CODE_VOID)
frame = parse_frame_specification ("0");
sals = decode_line_with_current_source (arg, DECODE_LINE_FUNFIRSTLINE);
cleanups = make_cleanup (xfree, sals.sals);
- func_bounds = (struct function_bounds *) xmalloc (
- sizeof (struct function_bounds) * sals.nelts);
+ func_bounds = XNEWVEC (struct function_bounds, sals.nelts);
make_cleanup (xfree, func_bounds);
for (i = 0; (i < sals.nelts && !found); i++)
{
else if (frame != get_selected_frame (NULL))
select_and_print_frame (frame);
}
-
-/* Gets the language of the current frame. */
-
-enum language
-get_frame_language (void)
-{
- struct frame_info *frame = deprecated_safe_get_selected_frame ();
-
- if (frame)
- {
- CORE_ADDR pc = 0;
- int pc_p = 0;
-
- /* We determine the current frame language by looking up its
- associated symtab. To retrieve this symtab, we use the frame
- PC. However we cannot use the frame PC as is, because it
- usually points to the instruction following the "call", which
- is sometimes the first instruction of another function. So
- we rely on get_frame_address_in_block(), it provides us with
- a PC that is guaranteed to be inside the frame's code
- block. */
-
- TRY
- {
- pc = get_frame_address_in_block (frame);
- pc_p = 1;
- }
- CATCH (ex, RETURN_MASK_ERROR)
- {
- if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
- }
- END_CATCH
-
- if (pc_p)
- {
- struct compunit_symtab *cust = find_pc_compunit_symtab (pc);
-
- if (cust != NULL)
- return compunit_language (cust);
- }
- }
-
- return language_unknown;
-}
\f
/* Provide a prototype to silence -Wmissing-prototypes. */
add_com_alias ("f", "frame", class_stack, 1);
- if (xdb_commands)
- {
- add_com ("L", class_stack, current_frame_command,
- _("Print the current stack frame.\n"));
- add_com_alias ("V", "frame", class_stack, 1);
- }
add_com ("select-frame", class_stack, select_frame_command, _("\
Select a stack frame without printing anything.\n\
An argument specifies the frame to select.\n\
Use of the 'no-filters' qualifier prohibits frame filters from executing\n\
on this backtrace.\n"));
add_com_alias ("bt", "backtrace", class_stack, 0);
- if (xdb_commands)
- {
- add_com_alias ("t", "backtrace", class_stack, 0);
- add_com ("T", class_stack, backtrace_full_command, _("\
-Print backtrace of all stack frames, or innermost COUNT frames\n\
-and the values of the local variables.\n\
-With a negative argument, print outermost -COUNT frames.\n\
-Usage: T <count>\n"));
- }
add_com_alias ("where", "backtrace", class_alias, 0);
add_info ("stack", backtrace_command,
_("Local variables of current stack frame."));
add_info ("args", args_info,
_("Argument variables of current stack frame."));
- if (xdb_commands)
- add_com ("l", class_info, args_plus_locals_info,
- _("Argument and local variables of current stack frame."));
if (dbx_commands)
add_com ("func", class_stack, func_command, _("\