aboutsummaryrefslogtreecommitdiff
path: root/gdb/riscv-tdep.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2021-11-08 14:58:46 +0000
committerAndrew Burgess <aburgess@redhat.com>2021-11-16 17:45:45 +0000
commit8579fd136a614985bd27f20539c7bb7c5a51287d (patch)
treefb84850409a44e13e832cbadc9025d40c1d33d9f /gdb/riscv-tdep.c
parent2bb7589ddf61e163f2e414e7033fad56ea17e784 (diff)
downloadgdb-8579fd136a614985bd27f20539c7bb7c5a51287d.zip
gdb-8579fd136a614985bd27f20539c7bb7c5a51287d.tar.gz
gdb-8579fd136a614985bd27f20539c7bb7c5a51287d.tar.bz2
gdb/gdbsupport: make xstrprintf and xstrvprintf return a unique_ptr
The motivation is to reduce the number of places where unmanaged pointers are returned from allocation type routines. All of the callers are updated. There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/riscv-tdep.c')
-rw-r--r--gdb/riscv-tdep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index a6a64d3..522eaa7 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -566,8 +566,8 @@ private:
for (auto &reg : m_registers)
{
int csr_num = reg.regnum - RISCV_FIRST_CSR_REGNUM;
- const char *alias = xstrprintf ("csr%d", csr_num);
- reg.names.push_back (alias);
+ gdb::unique_xmalloc_ptr<char> alias = xstrprintf ("csr%d", csr_num);
+ reg.names.push_back (alias.release ());
}
}
};