aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index b36193b..e633566 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1,6 +1,6 @@
/* Print and select stack frames for GDB, the GNU debugger.
- Copyright (C) 1986-2024 Free Software Foundation, Inc.
+ Copyright (C) 1986-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -50,7 +50,6 @@
#include "linespec.h"
#include "cli/cli-utils.h"
#include "objfiles.h"
-#include "annotate.h"
#include "symfile.h"
#include "extension.h"
@@ -828,7 +827,7 @@ print_frame_args (const frame_print_options &fp_opts,
(1) Because find_saved_registers may be slow for
remote debugging.
- (2) Because registers are often re-used and stack
+ (2) Because registers are often reused and stack
slots rarely (never?) are. Therefore using
the stack slot is much less likely to print
garbage.
@@ -1299,13 +1298,12 @@ find_frame_funname (const frame_info_ptr &frame, enum language *funlang,
}
else
{
- struct bound_minimal_symbol msymbol;
CORE_ADDR pc;
if (!get_frame_address_in_block_if_available (frame, &pc))
return funname;
- msymbol = lookup_minimal_symbol_by_pc (pc);
+ bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc);
if (msymbol.minsym != NULL)
{
funname.reset (xstrdup (msymbol.minsym->print_name ()));
@@ -1419,7 +1417,7 @@ print_frame (struct ui_out *uiout,
annotate_frame_source_file_end ();
uiout->text (":");
annotate_frame_source_line ();
- uiout->field_signed ("line", sal.line);
+ uiout->field_signed ("line", sal.line, line_number_style.style ());
annotate_frame_source_end ();
}
@@ -1529,9 +1527,7 @@ info_frame_command_core (const frame_info_ptr &fi, bool selected_frame_p)
}
else if (frame_pc_p)
{
- struct bound_minimal_symbol msymbol;
-
- msymbol = lookup_minimal_symbol_by_pc (frame_pc);
+ bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (frame_pc);
if (msymbol.minsym != NULL)
{
funname = msymbol.minsym->print_name ();
@@ -1754,7 +1750,7 @@ info_frame_command_core (const frame_info_ptr &fi, bool selected_frame_p)
/* Find out the location of the saved register without
fetching the corresponding value. */
frame_register_unwind (fi, i, &optimized, &unavailable,
- &lval, &addr, &realnum, NULL);
+ &lval, &addr, &realnum);
/* For moment, only display registers that were saved on the
stack. */
if (!optimized && !unavailable && lval == lval_memory)
@@ -2225,6 +2221,7 @@ iterate_over_block_locals (const struct block *b,
switch (sym->aclass ())
{
case LOC_CONST:
+ case LOC_CONST_BYTES:
case LOC_LOCAL:
case LOC_REGISTER:
case LOC_STATIC:
@@ -2699,7 +2696,7 @@ return_command (const char *retval_exp, int from_tty)
thisfun = get_frame_function (thisframe);
gdbarch = get_frame_arch (thisframe);
- if (get_frame_type (get_current_frame ()) == INLINE_FRAME)
+ if (get_frame_type (thisframe) == INLINE_FRAME)
error (_("Can not force return from an inlined function."));
/* Compute the return value. If the computation triggers an error,
@@ -2780,7 +2777,14 @@ return_command (const char *retval_exp, int from_tty)
{
int confirmed;
- if (thisfun == NULL)
+ if (get_frame_type (thisframe) == SIGTRAMP_FRAME)
+ {
+ warning (_("Returning from signal trampoline does not fully restore"
+ " pre-signal state, such as process signal mask."));
+ confirmed = query (_("%sMake signal trampoline return now? "),
+ query_prefix.c_str ());
+ }
+ else if (thisfun == NULL)
confirmed = query (_("%sMake selected stack frame return now? "),
query_prefix.c_str ());
else
@@ -2859,9 +2863,11 @@ find_frame_for_function (const char *function_name)
do
{
+ CORE_ADDR frame_pc = get_frame_address_in_block (frame);
+
for (size_t i = 0; (i < sals.size () && !found); i++)
- found = (get_frame_pc (frame) >= func_bounds[i].low
- && get_frame_pc (frame) < func_bounds[i].high);
+ found = (frame_pc >= func_bounds[i].low
+ && frame_pc < func_bounds[i].high);
if (!found)
{
level = 1;
@@ -3256,9 +3262,7 @@ static struct cmd_list_element *select_frame_cmd_list = NULL;
/* Commands with a prefix of `info frame'. */
static struct cmd_list_element *info_frame_cmd_list = NULL;
-void _initialize_stack ();
-void
-_initialize_stack ()
+INIT_GDB_FILE (stack)
{
struct cmd_list_element *cmd;