aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/frame.h')
-rw-r--r--gdb/frame.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/gdb/frame.h b/gdb/frame.h
index e207c71..086abc8 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -1,6 +1,6 @@
/* Definitions for dealing with 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.
@@ -504,7 +504,8 @@ extern CORE_ADDR get_frame_pc (const frame_info_ptr &);
/* Same as get_frame_pc, but return a boolean indication of whether
the PC is actually available, instead of throwing an error. */
-extern bool get_frame_pc_if_available (const frame_info_ptr &frame, CORE_ADDR *pc);
+extern std::optional<CORE_ADDR> get_frame_pc_if_available
+ (const frame_info_ptr &frame);
/* An address (not necessarily aligned to an instruction boundary)
that falls within THIS frame's code block.
@@ -586,7 +587,7 @@ void set_current_sal_from_frame (const frame_info_ptr &);
the old get_frame_base method was not sufficient.
get_frame_base_address: get_frame_locals_address:
- get_frame_args_address: A set of high-level debug-info dependant
+ get_frame_args_address: A set of high-level debug-info dependent
addresses that fall within the frame. These addresses almost
certainly will not match the stack address part of a frame ID (as
returned by get_frame_base).
@@ -822,10 +823,24 @@ enum print_what
allocate memory using this method. */
extern void *frame_obstack_zalloc (unsigned long size);
-#define FRAME_OBSTACK_ZALLOC(TYPE) \
- ((TYPE *) frame_obstack_zalloc (sizeof (TYPE)))
-#define FRAME_OBSTACK_CALLOC(NUMBER,TYPE) \
- ((TYPE *) frame_obstack_zalloc ((NUMBER) * sizeof (TYPE)))
+
+/* Allocate one instance of T using frame_obstack_zalloc. */
+
+template <typename T>
+T *
+frame_obstack_zalloc ()
+{
+ return static_cast<T *> (frame_obstack_zalloc (sizeof (T)));
+}
+
+/* Allocate N instances of T using frame_obstack_zalloc. */
+
+template <typename T>
+T *
+frame_obstack_calloc (int n)
+{
+ return static_cast<T *> (frame_obstack_zalloc (n * sizeof (T)));
+}
class readonly_detached_regcache;
/* Create a regcache, and copy the frame's registers into it. */