diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-10-08 10:44:55 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-10-09 11:45:44 +0100 |
commit | bbb826f5e92e26815357b7f3243f6b3453ec5bc1 (patch) | |
tree | 893a50c3a3e1d044c100b1fc3cacfd8ab31a16ea /gdb/arch/tic6x.c | |
parent | 361cb219351d8b7e39e1962fe77f40aa80657b27 (diff) | |
download | gdb-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 'gdb/arch/tic6x.c')
-rw-r--r-- | gdb/arch/tic6x.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/arch/tic6x.c b/gdb/arch/tic6x.c index dad4dd8..d52ec3a 100644 --- a/gdb/arch/tic6x.c +++ b/gdb/arch/tic6x.c @@ -28,20 +28,20 @@ target_desc * tic6x_create_target_description (enum c6x_feature feature) { - target_desc *tdesc = allocate_target_description ().release (); + target_desc_up tdesc = allocate_target_description (); - set_tdesc_architecture (tdesc, "tic6x"); - set_tdesc_osabi (tdesc, "GNU/Linux"); + set_tdesc_architecture (tdesc.get (), "tic6x"); + set_tdesc_osabi (tdesc.get (), "GNU/Linux"); long regnum = 0; - regnum = create_feature_tic6x_core (tdesc, regnum); + regnum = create_feature_tic6x_core (tdesc.get (), regnum); if (feature == C6X_GP || feature == C6X_C6XP) - regnum = create_feature_tic6x_gp (tdesc, regnum); + regnum = create_feature_tic6x_gp (tdesc.get (), regnum); if (feature == C6X_C6XP) - regnum = create_feature_tic6x_c6xp (tdesc, regnum); + regnum = create_feature_tic6x_c6xp (tdesc.get (), regnum); - return tdesc; + return tdesc.release (); } |