diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-04-08 11:04:24 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-04-12 14:13:10 -0400 |
commit | ebd4e6d017f972cbba5d889310a09506bec4dbf4 (patch) | |
tree | 2e47ecb053ed664d330bc2b6a970436fbcdf284a /gdb/xcoffread.c | |
parent | 71bc95ed2032567e2a7aebc3efe1c55a77abb7b2 (diff) | |
download | gdb-ebd4e6d017f972cbba5d889310a09506bec4dbf4.zip gdb-ebd4e6d017f972cbba5d889310a09506bec4dbf4.tar.gz gdb-ebd4e6d017f972cbba5d889310a09506bec4dbf4.tar.bz2 |
gdb: change subfile::name and buildsym_compunit::m_comp_dir to strings
Change subfile::name to be a string, for easier memory management.
Change buildsym_compunit::m_comp_dir as well, since we move one in to
the other at some point in patch_subfile_names, so it's easier to do
both at the same time. There are various NULL checks for both fields
currently, replace them with empty checks, I think it ends up
equivalent.
I can't test the change in xcoffread.c, it's best-effort.
Change-Id: I62b5fb08b2089e096768a090627ac7617e90a016
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r-- | gdb/xcoffread.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 296e713..894a12e 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -766,10 +766,9 @@ process_linenos (CORE_ADDR start, CORE_ADDR end) if (fakename == NULL) fakename = " ?"; start_subfile (fakename); - xfree (get_current_subfile ()->name); } struct subfile *current_subfile = get_current_subfile (); - current_subfile->name = xstrdup (inclTable[ii].name); + current_subfile->name = inclTable[ii].name; #endif if (lv == lineTb) |