aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-11-18 09:19:11 -0800
committerDoug Evans <xdje42@gmail.com>2014-11-18 09:19:11 -0800
commiteb822aa6d0f2cdc1a3125da084b96c5bbe32cb86 (patch)
treed26ba8ac15567c8accf2d4bb9b24a4ed83d00a1d /gdb/source.c
parent98387a2917d136b1acbaa9229d5b6a787d9efd54 (diff)
downloadgdb-eb822aa6d0f2cdc1a3125da084b96c5bbe32cb86.zip
gdb-eb822aa6d0f2cdc1a3125da084b96c5bbe32cb86.tar.gz
gdb-eb822aa6d0f2cdc1a3125da084b96c5bbe32cb86.tar.bz2
SYMTAB_OBJFILE: New macro.
gdb/ChangeLog: * symtab.h (SYMTAB_OBJFILE): New macro. All uses of member symtab.objfile updated to use it.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/source.c b/gdb/source.c
index 1bb19c9..894531a 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1189,8 +1189,8 @@ find_source_lines (struct symtab *s, int desc)
if (fstat (desc, &st) < 0)
perror_with_name (symtab_to_filename_for_display (s));
- if (s->objfile && s->objfile->obfd)
- mtime = s->objfile->mtime;
+ if (SYMTAB_OBJFILE (s) != NULL && SYMTAB_OBJFILE (s)->obfd != NULL)
+ mtime = SYMTAB_OBJFILE (s)->mtime;
else if (exec_bfd)
mtime = exec_bfd_mtime;
@@ -1294,7 +1294,7 @@ identify_source_line (struct symtab *s, int line, int mid_statement,
/* Don't index off the end of the line_charpos array. */
return 0;
annotate_source (s->fullname, line, s->line_charpos[line - 1],
- mid_statement, get_objfile_arch (s->objfile), pc);
+ mid_statement, get_objfile_arch (SYMTAB_OBJFILE (s)), pc);
current_source_line = line;
current_source_symtab = s;
@@ -1538,7 +1538,8 @@ line_info (char *arg, int from_tty)
else if (sal.line > 0
&& find_line_pc_range (sal, &start_pc, &end_pc))
{
- struct gdbarch *gdbarch = get_objfile_arch (sal.symtab->objfile);
+ struct gdbarch *gdbarch
+ = get_objfile_arch (SYMTAB_OBJFILE (sal.symtab));
if (start_pc == end_pc)
{