Merge branch 'master' into merge-job
[deliverable/binutils-gdb.git] / gdb / buildsym.h
index c8e1bd0d5a734a55924e61b8f55d84b37b2dce69..1e57fe471120a57ed10657a4d0c93ddc2f460a49 100644 (file)
@@ -1,5 +1,6 @@
 /* Build symbol tables in GDB's internal format.
    Copyright (C) 1986-2020 Free Software Foundation, Inc.
+   Copyright (C) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
 
    This file is part of GDB.
 
@@ -258,7 +259,7 @@ struct buildsym_compunit
 
   void record_debugformat (const char *format)
   {
-    m_debugformat = format;
+    m_debugformat = make_unique_xstrdup (format);
   }
 
   void record_producer (const char *producer)
@@ -325,9 +326,8 @@ private:
      the same lifetime as objfile.  */
   const char *m_producer = nullptr;
 
-  /* Space for this is not malloc'd, and is assumed to have at least
-     the same lifetime as objfile.  */
-  const char *m_debugformat = nullptr;
+  /* Space for this is malloc'd.  */
+  gdb::unique_xmalloc_ptr<char> m_debugformat;
 
   /* The compunit we are building.  */
   struct compunit_symtab *m_compunit_symtab = nullptr;
This page took 0.029488 seconds and 4 git commands to generate.