aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2021-11-19 21:14:36 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-02-06 15:48:18 -0500
commit36664835fa3f81503633024e0e834be4d84276e1 (patch)
treea00cbe27884e94579e4ddb559faf62356be3d4b1 /gdb/buildsym.c
parent43b49762a17718fe13718238a8c0af9b62b682d4 (diff)
downloadbinutils-36664835fa3f81503633024e0e834be4d84276e1.zip
binutils-36664835fa3f81503633024e0e834be4d84276e1.tar.gz
binutils-36664835fa3f81503633024e0e834be4d84276e1.tar.bz2
gdb: add compunit_symtab::set_primary_filetab method
Add a method to set the primary filetab of the CU. This is currently done in buildsym_compunit::end_symtab_with_blockvector. Change-Id: I16c51a6b90a4cb4c0c5f183b0f2e12bc64b6fd74
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 1754f5f..914834f 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -996,28 +996,8 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
symtab->language = subfile->language;
}
- /* Make sure the symtab of main_subfile is the first in its list. */
- {
- struct symtab *main_symtab, *prev_symtab;
-
- main_symtab = m_main_subfile->symtab;
- prev_symtab = NULL;
- for (symtab *symtab : compunit_filetabs (cu))
- {
- if (symtab == main_symtab)
- {
- if (prev_symtab != NULL)
- {
- prev_symtab->next = main_symtab->next;
- main_symtab->next = COMPUNIT_FILETABS (cu);
- COMPUNIT_FILETABS (cu) = main_symtab;
- }
- break;
- }
- prev_symtab = symtab;
- }
- gdb_assert (main_symtab == COMPUNIT_FILETABS (cu));
- }
+ /* Make sure the filetab of main_subfile is the primary filetab of the CU. */
+ cu->set_primary_filetab (m_main_subfile->symtab);
/* Fill out the compunit symtab. */