summaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-04-04 14:29:26 +0000
committerTom Tromey <tromey@redhat.com>2011-04-04 14:29:26 +0000
commit4b11999f6f77676a5913d772e3b29e04fa057047 (patch)
tree4832594f88b79416c15f0871aa19e1453153775c /gdb/buildsym.c
parent5d40eb4446a16bb799d79b6a688924132558b0db (diff)
downloadgdb-4b11999f6f77676a5913d772e3b29e04fa057047.tar.gz
* xcoffread.c (read_xcoff_symtab): Make `debugfmt' const.
* symtab.h (struct symtab) <producer, debugformat>: Now const. * symmisc.c (free_symtab): Don't free debugformat. * buildsym.h (struct subfile) <producer, debugformat>: Now const. (record_debugformat, record_producer): Document. * buildsym.c (end_symtab): Don't save debugformat and producer names on obstack. (end_symtab): Don't free debugformat and producer fields. (record_debugformat): Don't call xstrdup. (record_producer): Likewise.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index cd159a71cd9..3c90645b78c 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -1111,20 +1111,6 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
the symbols. */
symtab->language = subfile->language;
- /* Save the debug format string (if any) in the symtab. */
- if (subfile->debugformat != NULL)
- {
- symtab->debugformat = obsavestring (subfile->debugformat,
- strlen (subfile->debugformat),
- &objfile->objfile_obstack);
- }
-
- /* Similarly for the producer. */
- if (subfile->producer != NULL)
- symtab->producer = obsavestring (subfile->producer,
- strlen (subfile->producer),
- &objfile->objfile_obstack);
-
/* All symtabs for the main file and the subfiles share a
blockvector, so we need to clear primary for everything
but the main file. */
@@ -1169,12 +1155,6 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
{
xfree ((void *) subfile->line_vector);
}
- if (subfile->debugformat != NULL)
- {
- xfree ((void *) subfile->debugformat);
- }
- if (subfile->producer != NULL)
- xfree (subfile->producer);
nextsub = subfile->next;
xfree ((void *) subfile);
@@ -1279,20 +1259,15 @@ hashname (char *name)
void
-record_debugformat (char *format)
+record_debugformat (const char *format)
{
- current_subfile->debugformat = xstrdup (format);
+ current_subfile->debugformat = format;
}
void
record_producer (const char *producer)
{
- /* The producer is not always provided in the debugging info.
- Do nothing if PRODUCER is NULL. */
- if (producer == NULL)
- return;
-
- current_subfile->producer = xstrdup (producer);
+ current_subfile->producer = producer;
}
/* Merge the first symbol list SRCLIST into the second symbol list