/* Build symbol tables in GDB's internal format.
- Copyright (C) 1986-2018 Free Software Foundation, Inc.
+ 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.
#if !defined (BUILDSYM_H)
#define BUILDSYM_H 1
+#include "gdb_obstack.h"
+
struct objfile;
struct symbol;
struct addrmap;
void record_debugformat (const char *format)
{
- m_debugformat = format;
+ m_debugformat = make_unique_xstrdup (format);
}
void record_producer (const char *producer)
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;