aboutsummaryrefslogtreecommitdiff
path: root/gdb/xcoffread.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2009-03-12 17:56:20 +0000
committerJoel Brobecker <brobecker@gnat.com>2009-03-12 17:56:20 +0000
commitc5933f6db95fefa46e4e6ad036e04b34de5034c3 (patch)
tree2f1c1919113f17c13a8f1940461f3c8b6b5a0a88 /gdb/xcoffread.c
parentc7660128e838a58bf807b42cd0a3fca3d1d0dc9d (diff)
downloadgdb-c5933f6db95fefa46e4e6ad036e04b34de5034c3.zip
gdb-c5933f6db95fefa46e4e6ad036e04b34de5034c3.tar.gz
gdb-c5933f6db95fefa46e4e6ad036e04b34de5034c3.tar.bz2
* xcoffread.c (process_linenos): Check if the line in the
include table refers to the main source file and, if so, add them to the main subfile.
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r--gdb/xcoffread.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index aab3e48..9ae929f 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -600,17 +600,32 @@ process_linenos (CORE_ADDR start, CORE_ADDR end)
start, 0, &main_source_baseline);
}
- /* Have a new subfile for the include file. */
+ if (strcmp (inclTable[ii].name, last_source_file) == 0)
+ {
+ /* The entry in the include table refers to the main source
+ file. Add the lines to the main subfile. */
- tmpSubfile = inclTable[ii].subfile =
- (struct subfile *) xmalloc (sizeof (struct subfile));
+ main_source_baseline = inclTable[ii].funStartLine;
+ enter_line_range
+ (&main_subfile, inclTable[ii].begin, inclTable[ii].end,
+ start, 0, &main_source_baseline);
+ inclTable[ii].subfile = &main_subfile;
+ }
+ else
+ {
+
+ /* Have a new subfile for the include file. */
- memset (tmpSubfile, '\0', sizeof (struct subfile));
- firstLine = &(inclTable[ii].funStartLine);
+ tmpSubfile = inclTable[ii].subfile =
+ (struct subfile *) xmalloc (sizeof (struct subfile));
- /* Enter include file's lines now. */
- enter_line_range (tmpSubfile, inclTable[ii].begin,
- inclTable[ii].end, start, 0, firstLine);
+ memset (tmpSubfile, '\0', sizeof (struct subfile));
+ firstLine = &(inclTable[ii].funStartLine);
+
+ /* Enter include file's lines now. */
+ enter_line_range (tmpSubfile, inclTable[ii].begin,
+ inclTable[ii].end, start, 0, firstLine);
+ }
if (offset <= inclTable[ii].end)
offset = inclTable[ii].end + linesz;
@@ -656,7 +671,8 @@ process_linenos (CORE_ADDR start, CORE_ADDR end)
for (ii = 0; ii < inclIndx; ++ii)
{
- if ((inclTable[ii].subfile)->line_vector) /* Useless if!!! FIXMEmgo */
+ if (inclTable[ii].subfile != ((struct subfile *) &main_subfile)
+ && (inclTable[ii].subfile)->line_vector) /* Useless if!!! FIXMEmgo */
{
struct linetable *lineTb, *lv;