mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
gdb/
Display @entry parameter values (without references). * dwarf2expr.c (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset): New functions. * dwarf2expr.h (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset): New declarations. * dwarf2loc.c (dwarf2_find_location_expression): Support location list entry record. (dwarf_entry_parameter_to_value, value_of_dwarf_reg_entry) (value_of_dwarf_block_entry, locexpr_read_variable_at_entry): New functions. (dwarf2_locexpr_funcs): Install locexpr_read_variable_at_entry. (loclist_read_variable_at_entry): New function. (dwarf2_loclist_funcs): Install loclist_read_variable_at_entry. * dwarf2read.c (read_call_site_scope): Support also DW_OP_fbreg in DW_AT_location, call dwarf_block_to_sp_offset for it. * frame.h (print_entry_values_no, print_entry_values_only) (print_entry_values_preferred, print_entry_values_if_needed) (print_entry_values_both, print_entry_values_compact) (print_entry_values_default, print_entry_values): New declarations. (struct frame_arg): New field entry_kind. (read_frame_arg): New parameter entryargp. * mi/mi-cmd-stack.c (list_arg_or_local): New gdb_assert for arg->entry_kind. Optionally print the `@entry' suffix. (list_args_or_locals): New variable entryarg, initialize it. Initialize also entry_kind of arg and entryarg. Conditionalize list_arg_or_local for arg, add list_arg_or_local for entryarg. Call xfree for entryarg.error. * stack.c (print_entry_values_no, print_entry_values_only) (print_entry_values_preferred, print_entry_values_if_needed) (print_entry_values_both, print_entry_values_compact) (print_entry_values_default, print_entry_values_choices) (print_entry_values): New variables. (print_frame_arg): New gdb_assert for arg->entry_kind. Optionally print the `@entry' suffix, possibly in combination for print_entry_values_compact. (read_frame_arg): New parameter entryargp, new variables entryval, entryval_error and val_equal. Read in also entryargp, respect print_entry_values, compare the values using val_equal, fill in also argp->entry_kind (together with entryargp->entry_kind). (print_frame_args): New variable entryarg, initialize it. Conditionalize print_frame_arg for arg, add print_frame_arg for entryarg. Call xfree for entryarg.error. (_initialize_stack): Call add_setshow_enum_cmd for `entry-values'. * symtab.h (struct symbol_computed_ops): New field read_variable_at_entry. gdb/doc/ Display @entry parameter values (without references). * gdb.texinfo (Tail Call Frames): Add anchor. Add self tail call example. (Print Settings): New description of set print entry-values and show print entry-values. gdb/testsuite/ Display @entry parameter values (without references). * gdb.arch/amd64-entry-value.cc (locexpr, stacktest, data, data2) (different, validity, invalid): New functions. (main): Call them. * gdb.arch/amd64-entry-value.exp: New breakpoints breakhere_locexpr, stacktest, breakhere_stacktest, different, breakhere_different, breakhere_validity and breakhere_invalid. (entry: bt): Update for @entry. (entry_locexpr: *, entry_stack: *, entry_equal: *, entry_different: *) (entry_validity: *, entry_invalid: *): Many new tests. * gdb.base/break.exp (run until breakpoint set at small function, optimized file): Accept also the @entry suffix. * gdb.mi/Makefile.in (PROGS): Add mi2-amd64-entry-value. * gdb.mi/mi2-amd64-entry-value.c: New files. * gdb.mi/mi2-amd64-entry-value.exp: New files.
This commit is contained in:
@ -34,6 +34,13 @@ asm ("breakhere:");
|
||||
e (v, v);
|
||||
}
|
||||
|
||||
static void __attribute__((noinline, noclone))
|
||||
locexpr (int i)
|
||||
{
|
||||
i = i;
|
||||
asm ("breakhere_locexpr:");
|
||||
}
|
||||
|
||||
static void __attribute__((noinline, noclone))
|
||||
c (int i, double j)
|
||||
{
|
||||
@ -114,10 +121,68 @@ self (int i)
|
||||
}
|
||||
}
|
||||
|
||||
static void __attribute__((noinline, noclone))
|
||||
stacktest (int r1, int r2, int r3, int r4, int r5, int r6, int s1, int s2,
|
||||
double d1, double d2, double d3, double d4, double d5, double d6,
|
||||
double d7, double d8, double d9, double da)
|
||||
{
|
||||
s1 = 3;
|
||||
s2 = 4;
|
||||
d9 = 3.5;
|
||||
da = 4.5;
|
||||
e (v, v);
|
||||
asm ("breakhere_stacktest:");
|
||||
e (v, v);
|
||||
}
|
||||
|
||||
static int __attribute__((noinline, noclone))
|
||||
data (void)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
static int __attribute__((noinline, noclone))
|
||||
data2 (void)
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
static int __attribute__((noinline, noclone))
|
||||
different (int val)
|
||||
{
|
||||
val++;
|
||||
e (val, val);
|
||||
asm ("breakhere_different:");
|
||||
return val;
|
||||
}
|
||||
|
||||
static int __attribute__((noinline, noclone))
|
||||
validity (int lost, int born)
|
||||
{
|
||||
lost = data ();
|
||||
e (0, 0.0);
|
||||
asm ("breakhere_validity:");
|
||||
return born;
|
||||
}
|
||||
|
||||
static void __attribute__((noinline, noclone))
|
||||
invalid (int inv)
|
||||
{
|
||||
e (0, 0.0);
|
||||
asm ("breakhere_invalid:");
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
d (30, 30.5);
|
||||
locexpr (30);
|
||||
stacktest (1, 2, 3, 4, 5, 6, 11, 12,
|
||||
1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 11.5, 12.5);
|
||||
different (5);
|
||||
validity (5, data ());
|
||||
invalid (data2 ());
|
||||
|
||||
if (v)
|
||||
a (1, 1.25);
|
||||
else
|
||||
|
Reference in New Issue
Block a user