#include "top.h"
#include "source.h"
#include "objfiles.h"
+#include "source-cache.h"
\f
/* Prototypes for local functions. */
{
if (annotation_level > 0)
{
- if (s->line_charpos == nullptr)
- open_source_file_with_line_charpos (s);
- if (s->fullname == nullptr)
+ const std::vector<off_t> *offsets;
+ if (!g_source_cache.get_line_charpos (s, &offsets))
return;
+
/* Don't index off the end of the line_charpos array. */
- if (line > s->nlines)
+ if (line > offsets->size ())
return;
- annotate_source (s->fullname, line, s->line_charpos[line - 1],
+ annotate_source (s->fullname, line, (int) (*offsets)[line - 1],
mid_statement, get_objfile_arch (SYMTAB_OBJFILE (s)),
pc);
}