aboutsummaryrefslogtreecommitdiff
path: root/gdb/frv-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/frv-tdep.c
parent2bb7589ddf61e163f2e414e7033fad56ea17e784 (diff)
downloadbinutils-8579fd136a614985bd27f20539c7bb7c5a51287d.zip
binutils-8579fd136a614985bd27f20539c7bb7c5a51287d.tar.gz
binutils-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/frv-tdep.c')
-rw-r--r--gdb/frv-tdep.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index c74ea68..c5eac6b 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -182,11 +182,8 @@ new_variant (void)
in the G packet. If we need more in the future, we'll add them
elsewhere. */
for (r = acc0_regnum; r <= acc7_regnum; r++)
- {
- char *buf;
- buf = xstrprintf ("acc%d", r - acc0_regnum);
- var->register_names[r] = buf;
- }
+ var->register_names[r]
+ = xstrprintf ("acc%d", r - acc0_regnum).release ();
/* accg0 - accg7: These are one byte registers. The remote protocol
provides the raw values packed four into a slot. accg0123 and
@@ -195,11 +192,8 @@ new_variant (void)
likely not want to see these raw values. */
for (r = accg0_regnum; r <= accg7_regnum; r++)
- {
- char *buf;
- buf = xstrprintf ("accg%d", r - accg0_regnum);
- var->register_names[r] = buf;
- }
+ var->register_names[r]
+ = xstrprintf ("accg%d", r - accg0_regnum).release ();
/* msr0 and msr1. */