+2014-11-18 Doug Evans <xdje42@gmail.com>
+
+ * symtab.h (SYMTAB_LINETABLE): Renamed from LINETABLE. All uses
+ updated.
+
2014-11-18 Doug Evans <xdje42@gmail.com>
* symtab.h (SYMTAB_DIRNAME): New macro. All uses of member
if (subfile->line_vector)
{
/* Reallocate the line table on the symbol obstack. */
- symtab->linetable = (struct linetable *)
+ SYMTAB_LINETABLE (symtab) = (struct linetable *)
obstack_alloc (&objfile->objfile_obstack, linetablesize);
- memcpy (symtab->linetable, subfile->line_vector, linetablesize);
+ memcpy (SYMTAB_LINETABLE (symtab), subfile->line_vector,
+ linetablesize);
}
else
{
- symtab->linetable = NULL;
+ SYMTAB_LINETABLE (symtab) = NULL;
}
symtab->block_line_section = section;
if (subfile->dirname)
/* Assume symtab is valid for whole PC range. */
symtab = find_pc_line_symtab (low);
- if (symtab != NULL && symtab->linetable != NULL)
+ if (symtab != NULL && SYMTAB_LINETABLE (symtab) != NULL)
{
/* Convert the linetable to a bunch of my_line_entry's. */
- le = symtab->linetable->item;
- nlines = symtab->linetable->nitems;
+ le = SYMTAB_LINETABLE (symtab)->item;
+ nlines = SYMTAB_LINETABLE (symtab)->nitems;
}
if (!(flags & DISASSEMBLY_SOURCE) || nlines <= 0
- || symtab == NULL || symtab->linetable == NULL)
+ || symtab == NULL || SYMTAB_LINETABLE (symtab) == NULL)
do_assembly_only (gdbarch, uiout, &di, low, high, how_many, flags, stb);
else if (flags & DISASSEMBLY_SOURCE)
size_t size = ((stab->linetable->nitems - 1)
* sizeof (struct linetable_entry)
+ sizeof (struct linetable));
- LINETABLE (symtab) = obstack_alloc (&objfile->objfile_obstack, size);
- memcpy (LINETABLE (symtab), stab->linetable, size);
+ SYMTAB_LINETABLE (symtab) = obstack_alloc (&objfile->objfile_obstack,
+ size);
+ memcpy (SYMTAB_LINETABLE (symtab), stab->linetable, size);
}
else
{
- LINETABLE (symtab) = NULL;
+ SYMTAB_LINETABLE (symtab) = NULL;
}
blockvector_size = (sizeof (struct blockvector)
psymtab_language = st->language;
- lines = LINETABLE (st);
+ lines = SYMTAB_LINETABLE (st);
/* Get a new lexical context. */
size = lines->nitems;
if (size > 1)
--size;
- LINETABLE (st) = obstack_copy (&mdebugread_objfile->objfile_obstack,
- lines,
- (sizeof (struct linetable)
- + size * sizeof (lines->item)));
+ SYMTAB_LINETABLE (st)
+ = obstack_copy (&mdebugread_objfile->objfile_obstack,
+ lines,
+ (sizeof (struct linetable)
+ + size * sizeof (lines->item)));
xfree (lines);
/* .. and our share of externals.
struct symtab *s = allocate_symtab (name, objfile);
struct blockvector *bv;
- LINETABLE (s) = new_linetable (maxlines);
+ SYMTAB_LINETABLE (s) = new_linetable (maxlines);
/* All symtabs must have at least two blocks. */
bv = new_bvect (2);
gdbarch = get_objfile_arch (SYMTAB_OBJFILE (s));
cleanup_stack = make_cleanup_ui_out_list_begin_end (uiout, "lines");
- if (LINETABLE (s) != NULL && LINETABLE (s)->nitems > 0)
- for (i = 0; i < LINETABLE (s)->nitems; i++)
+ if (SYMTAB_LINETABLE (s) != NULL && SYMTAB_LINETABLE (s)->nitems > 0)
+ for (i = 0; i < SYMTAB_LINETABLE (s)->nitems; i++)
{
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
- ui_out_field_core_addr (uiout, "pc", gdbarch, LINETABLE (s)->item[i].pc);
- ui_out_field_int (uiout, "line", LINETABLE (s)->item[i].line);
+ ui_out_field_core_addr (uiout, "pc", gdbarch,
+ SYMTAB_LINETABLE (s)->item[i].pc);
+ ui_out_field_int (uiout, "line", SYMTAB_LINETABLE (s)->item[i].line);
do_cleanups (cleanup_tuple);
}
int i;
/* First the line table. */
- l = LINETABLE (s);
+ l = SYMTAB_LINETABLE (s);
if (l)
{
for (i = 0; i < l->nitems; ++i)
if (! PyArg_ParseTuple (args, GDB_PY_LL_ARG, &py_line))
return NULL;
- if (LINETABLE (symtab) == NULL)
+ if (SYMTAB_LINETABLE (symtab) == NULL)
{
PyErr_SetString (PyExc_RuntimeError,
_("Linetable information not found in symbol table"));
return NULL;
}
- for (index = 0; index < LINETABLE (symtab)->nitems; index++)
+ for (index = 0; index < SYMTAB_LINETABLE (symtab)->nitems; index++)
{
- struct linetable_entry *item = &(symtab->linetable->item[index]);
+ struct linetable_entry *item = &(SYMTAB_LINETABLE (symtab)->item[index]);
if (item->line == py_line)
Py_RETURN_TRUE;
}
LTPY_REQUIRE_VALID (self, symtab);
- if (LINETABLE (symtab) == NULL)
+ if (SYMTAB_LINETABLE (symtab) == NULL)
{
PyErr_SetString (PyExc_RuntimeError,
_("Linetable information not found in symbol table"));
if (source_dict == NULL)
return NULL;
- for (index = 0; index < LINETABLE (symtab)->nitems; index++)
+ for (index = 0; index < SYMTAB_LINETABLE (symtab)->nitems; index++)
{
- item = &(LINETABLE (symtab)->item[index]);
+ item = &(SYMTAB_LINETABLE (symtab)->item[index]);
/* 0 is used to signify end of line table information. Do not
include in the source set. */
LTPY_REQUIRE_VALID (iter_obj->source, symtab);
- if (iter_obj->current_index >= LINETABLE (symtab)->nitems)
+ if (iter_obj->current_index >= SYMTAB_LINETABLE (symtab)->nitems)
goto stop_iteration;
- item = &(LINETABLE (symtab)->item[iter_obj->current_index]);
+ item = &(SYMTAB_LINETABLE (symtab)->item[iter_obj->current_index]);
/* Skip over internal entries such as 0. 0 signifies the end of
line table data and is not useful to the API user. */
iter_obj->current_index++;
/* Exit if the internal value is the last item in the line table. */
- if (iter_obj->current_index >= symtab->linetable->nitems)
+ if (iter_obj->current_index >= SYMTAB_LINETABLE (symtab)->nitems)
goto stop_iteration;
- item = &(symtab->linetable->item[iter_obj->current_index]);
+ item = &(SYMTAB_LINETABLE (symtab)->item[iter_obj->current_index]);
}
obj = build_linetable_entry (item->line, item->pc);
ALL_OBJFILE_SYMTABS (objfile, s)
{
i++;
- if (s->linetable != NULL)
+ if (SYMTAB_LINETABLE (s) != NULL)
linetables++;
if (s->primary == 1)
blockvectors++;
language_str (symtab->language));
/* First print the line table. */
- l = LINETABLE (symtab);
+ l = SYMTAB_LINETABLE (symtab);
if (l)
{
fprintf_filtered (outfile, "\nLine table:\n\n");
symtab->primary ? " (primary)" : "");
printf_filtered (" "
"linetable ((struct linetable *) %s)\n",
- host_address_to_string (symtab->linetable));
+ host_address_to_string
+ (SYMTAB_LINETABLE (symtab)));
printf_filtered (" debugformat %s\n",
symtab->debugformat);
printf_filtered (" }\n");
continue;
/* Find the best line in this symtab. */
- l = LINETABLE (s);
+ l = SYMTAB_LINETABLE (s);
if (!l)
continue;
len = l->nitems;
struct symtab *best_symtab;
/* First try looking it up in the given symtab. */
- best_linetable = LINETABLE (symtab);
+ best_linetable = SYMTAB_LINETABLE (symtab);
best_symtab = symtab;
best_index = find_line_common (best_linetable, line, &exact, 0);
if (best_index < 0 || !exact)
if (FILENAME_CMP (symtab_to_fullname (symtab),
symtab_to_fullname (s)) != 0)
continue;
- l = LINETABLE (s);
+ l = SYMTAB_LINETABLE (s);
ind = find_line_common (l, line, &exact, 0);
if (ind >= 0)
{
int was_exact;
int idx;
- idx = find_line_common (LINETABLE (symtab), line, &was_exact, start);
+ idx = find_line_common (SYMTAB_LINETABLE (symtab), line, &was_exact,
+ start);
if (idx < 0)
break;
if (!was_exact)
{
- struct linetable_entry *item = &LINETABLE (symtab)->item[idx];
+ struct linetable_entry *item = &SYMTAB_LINETABLE (symtab)->item[idx];
if (*best_item == NULL || item->line < (*best_item)->line)
*best_item = item;
break;
}
- VEC_safe_push (CORE_ADDR, result, LINETABLE (symtab)->item[idx].pc);
+ VEC_safe_push (CORE_ADDR, result,
+ SYMTAB_LINETABLE (symtab)->item[idx].pc);
start = idx + 1;
}
symtab = find_line_symtab (symtab, line, &ind, NULL);
if (symtab != NULL)
{
- l = LINETABLE (symtab);
+ l = SYMTAB_LINETABLE (symtab);
*pc = l->item[ind].pc;
return 1;
}
int i;
/* Give up if this symbol has no lineinfo table. */
- l = LINETABLE (symtab);
+ l = SYMTAB_LINETABLE (symtab);
if (l == NULL)
return func_addr;
do this. */
if (prologue_sal.symtab->language != language_asm)
{
- struct linetable *linetable = LINETABLE (prologue_sal.symtab);
+ struct linetable *linetable = SYMTAB_LINETABLE (prologue_sal.symtab);
int idx = 0;
/* Skip any earlier lines, and any end-of-sequence marker
};
#define BLOCKVECTOR(symtab) (symtab)->blockvector
-#define LINETABLE(symtab) (symtab)->linetable
+#define SYMTAB_LINETABLE(symtab) ((symtab)->linetable)
#define SYMTAB_OBJFILE(symtab) ((symtab)->objfile)
#define SYMTAB_PSPACE(symtab) (SYMTAB_OBJFILE (symtab)->pspace)
#define SYMTAB_DIRNAME(symtab) ((symtab)->dirname)