aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/linux-arc-low.cc
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-10-08 10:44:55 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-10-09 11:45:44 +0100
commitbbb826f5e92e26815357b7f3243f6b3453ec5bc1 (patch)
tree893a50c3a3e1d044c100b1fc3cacfd8ab31a16ea /gdbserver/linux-arc-low.cc
parent361cb219351d8b7e39e1962fe77f40aa80657b27 (diff)
downloadgdb-bbb826f5e92e26815357b7f3243f6b3453ec5bc1.zip
gdb-bbb826f5e92e26815357b7f3243f6b3453ec5bc1.tar.gz
gdb-bbb826f5e92e26815357b7f3243f6b3453ec5bc1.tar.bz2
gdb: Delay releasing target_desc_up in more cases
After commit: commit 51a948fdf0e14fb69ab9e0c79ae8b2415801f9a3 Date: Mon Jul 20 14:18:04 2020 +0100 gdb: Have allocate_target_description return a unique_ptr There were a few places where we could (should?) have delayed releasing the target_desc_up until a little later. This commit catches these cases. In the case of ARC, the target_desc_up is now exposed right out to gdbserver, which means making a small change there too. There should be no user visible changes after this commit. gdb/ChangeLog: * arch/aarch32.c (aarch32_create_target_description): Release the target_desc_up as late as possible. * arch/aarch64.c (aarch64_create_target_description): Likewise. * arch/amd64.c (amd64_create_target_description): Likewise. * arch/arc.c (arc_create_target_description): Return a target_desc_up, don't release it. * arch/arc.h (arc_create_target_description): Update declaration. (arc_lookup_target_description): Move target_desc_up into the cache, and return a borrowed pointer. * arch/arm.c (arm_create_target_description): Release the target_desc_up as late as possible. * arch/i386.c (i386_create_target_description): Likewise. * arch/riscv.h (riscv_create_target_description): Update declaration to match definition. * arch/tic6x.c (tic6x_create_target_description): Release the target_desc_up as late as possible. gdbserver/ChangeLog: * linux-arc-low.cc (arc_linux_read_description): Release the unique_ptr returned from arc_create_target_description.
Diffstat (limited to 'gdbserver/linux-arc-low.cc')
-rw-r--r--gdbserver/linux-arc-low.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdbserver/linux-arc-low.cc b/gdbserver/linux-arc-low.cc
index 1f370ef..d101bd2 100644
--- a/gdbserver/linux-arc-low.cc
+++ b/gdbserver/linux-arc-low.cc
@@ -112,12 +112,12 @@ arc_linux_read_description (void)
#else
arc_arch_features features (4, ARC_ISA_ARCV2);
#endif
- struct target_desc *tdesc = arc_create_target_description (features);
+ target_desc_up tdesc = arc_create_target_description (features);
static const char *expedite_regs[] = { "sp", "status32", nullptr };
- init_target_desc (tdesc, expedite_regs);
+ init_target_desc (tdesc.get (), expedite_regs);
- return tdesc;
+ return tdesc.release ();
}
void