PR29262, memory leak in pr_function_type
[binutils-gdb.git] / gdbserver / linux-riscv-low.cc
index 1831f1a3254b897bb41a28efffc4fb03bb563d4a..6b2902e422d994c7e1d2f40f5b0d1d1276fbba8b 100644 (file)
@@ -1,6 +1,6 @@
 /* GNU/Linux/RISC-V specific low level interface, for the remote server
    for GDB.
-   Copyright (C) 2020 Free Software Foundation, Inc.
+   Copyright (C) 2020-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -88,11 +88,11 @@ riscv_target::low_arch_setup ()
 
   const riscv_gdbarch_features features
     = riscv_linux_read_features (lwpid_of (current_thread));
-  target_desc *tdesc = riscv_create_target_description (features);
+  target_desc_up tdesc = riscv_create_target_description (features);
 
   if (!tdesc->expedite_regs)
-    init_target_desc (tdesc, expedite_regs);
-  current_process ()->tdesc = tdesc;
+    init_target_desc (tdesc.get (), expedite_regs);
+  current_process ()->tdesc = tdesc.release ();
 }
 
 /* Collect GPRs from REGCACHE into BUF.  */
@@ -308,11 +308,6 @@ riscv_target::low_breakpoint_at (CORE_ADDR pc)
     return false;
 }
 
-/* RISC-V/Linux target operations.  */
-struct linux_target_ops the_low_target =
-{
-};
-
 /* The linux target ops object.  */
 
 linux_process_target *the_linux_target = &the_riscv_target;