summaryrefslogtreecommitdiff
path: root/gdb/dwarf2/loc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2/loc.c')
-rw-r--r--gdb/dwarf2/loc.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 7f27e453b30..a9523e9f7ee 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -1091,11 +1091,10 @@ chain_candidate (struct gdbarch *gdbarch,
/* Create and return call_site_chain for CALLER_PC and CALLEE_PC. All the
assumed frames between them use GDBARCH. Use depth first search so we can
keep single CHAIN of call_site's back to CALLER_PC. Function recursion
- would have needless GDB stack overhead. Caller is responsible for xfree of
- the returned result. Any unreliability results in thrown
- NO_ENTRY_VALUE_ERROR. */
+ would have needless GDB stack overhead. Any unreliability results
+ in thrown NO_ENTRY_VALUE_ERROR. */
-static struct call_site_chain *
+static gdb::unique_xmalloc_ptr<call_site_chain>
call_site_find_chain_1 (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
CORE_ADDR callee_pc)
{
@@ -1210,19 +1209,18 @@ call_site_find_chain_1 (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
paddress (gdbarch, callee_pc));
}
- return retval.release ();
+ return retval;
}
/* Create and return call_site_chain for CALLER_PC and CALLEE_PC. All the
assumed frames between them use GDBARCH. If valid call_site_chain cannot be
- constructed return NULL. Caller is responsible for xfree of the returned
- result. */
+ constructed return NULL. */
-struct call_site_chain *
+gdb::unique_xmalloc_ptr<call_site_chain>
call_site_find_chain (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
CORE_ADDR callee_pc)
{
- struct call_site_chain *retval = NULL;
+ gdb::unique_xmalloc_ptr<call_site_chain> retval;
try
{