if (msym.minsym == NULL)
return TARGET_XFER_E_IO;
- if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
+ if (msym.minsym->size () != ptr_size)
return TARGET_XFER_E_IO;
/* POINTER_ADDRESS is a location where the `_dl_auxv' variable
struct bound_minimal_symbol msymbol
= lookup_minimal_symbol_by_pc (prologue_start);
if (msymbol.minsym != NULL)
- func_size = MSYMBOL_SIZE (msymbol.minsym);
+ func_size = msymbol.minsym->size ();
}
/* If FUNC_SIZE is 0 we may have a special-case use of lr
if (minsym.minsym)
pst->set_text_high (minsym.minsym->value_raw_address ()
- + MSYMBOL_SIZE (minsym.minsym));
+ + minsym.minsym->size ());
last_function_name = NULL;
}
if (type != ST_SYNTHETIC)
{
/* Pass symbol size field in via BFD. FIXME!!! */
- SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size);
+ msym->set_size (elf_sym->internal_elf_sym.st_size);
}
msym->filename = filesymname;
symaddr, mst_solib_trampoline, sym->section, objfile);
if (mtramp)
{
- SET_MSYMBOL_SIZE (mtramp, MSYMBOL_SIZE (msym));
+ mtramp->set_size (msym->size());
mtramp->created_by_gdb = 1;
mtramp->filename = filesymname;
if (elf_make_msymbol_special_p)
true, address, mst_slot_got_plt,
msym_section, objfile);
if (msym)
- SET_MSYMBOL_SIZE (msym, ptr_size);
+ msym->set_size (ptr_size);
}
}
if (plt == NULL)
continue;
- if (MSYMBOL_SIZE (msym.minsym) != ptr_size)
+ if (msym.minsym->size () != ptr_size)
continue;
if (target_read_memory (pointer_address, buf, ptr_size) != 0)
continue;
if (hi > 0
&& msymbol[hi].type () != want_type
&& msymbol[hi - 1].type () == want_type
- && (MSYMBOL_SIZE (&msymbol[hi])
- == MSYMBOL_SIZE (&msymbol[hi - 1]))
+ && (msymbol[hi].size () == msymbol[hi - 1].size ())
&& (msymbol[hi].value_raw_address ()
== msymbol[hi - 1].value_raw_address ())
&& (msymbol[hi].obj_section (objfile)
symbol isn't an object or function (e.g. a
label), or it may just mean that the size was not
specified. */
- if (MSYMBOL_SIZE (&msymbol[hi]) == 0)
+ if (msymbol[hi].size () == 0)
{
if (best_zero_sized == -1)
best_zero_sized = hi;
the nocancel variants of system calls are inside
the cancellable variants, but both have sizes. */
if (hi > 0
- && MSYMBOL_SIZE (&msymbol[hi]) != 0
+ && msymbol[hi].size () != 0
&& pc >= (msymbol[hi].value_raw_address ()
- + MSYMBOL_SIZE (&msymbol[hi]))
+ + msymbol[hi].size ())
&& pc < (msymbol[hi - 1].value_raw_address ()
- + MSYMBOL_SIZE (&msymbol[hi - 1])))
+ + msymbol[hi - 1].size ()))
{
hi--;
continue;
address). Also, if we ran off the end, be sure
to back up. */
if (best_zero_sized != -1
- && (hi < 0 || MSYMBOL_SIZE (&msymbol[hi]) == 0))
+ && (hi < 0 || msymbol[hi].size () == 0))
hi = best_zero_sized;
/* If the minimal symbol has a non-zero size, and this
specified sizes, they do not overlap. */
if (hi >= 0
- && MSYMBOL_SIZE (&msymbol[hi]) != 0
+ && msymbol[hi].size () != 0
&& pc >= (msymbol[hi].value_raw_address ()
- + MSYMBOL_SIZE (&msymbol[hi])))
+ + msymbol[hi].size ()))
{
if (best_zero_sized != -1)
hi = best_zero_sized;
lesser of the next minimal symbol in the same section, or the end
of the section, as the end of the function. */
- if (MSYMBOL_SIZE (minsym.minsym) != 0)
- return minsym.value_address () + MSYMBOL_SIZE (minsym.minsym);
+ if (minsym.minsym->size () != 0)
+ return minsym.value_address () + minsym.minsym->size ();
/* Step over other symbols at this same address, and symbols in
other sections, to find the next symbol in this section with a
return 0;
/* A two-instruction header. */
- if (MSYMBOL_SIZE (msym.minsym) == 8)
+ if (msym.minsym->size () == 8)
return pc + 8;
/* A three-instruction (plus delay slot) trampoline. */
- if (MSYMBOL_SIZE (msym.minsym) == 16)
+ if (msym.minsym->size () == 16)
{
if (target_read_memory (pc, stub_code, 16) != 0)
return 0;
if ((sym->flags & BSF_SYNTHETIC) != 0 && sym->udata.p != NULL)
{
elf_symbol_type *elf_sym = (elf_symbol_type *) sym->udata.p;
- SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size);
+ msym->set_size (elf_sym->internal_elf_sym.st_size);
}
}
}
if (msymbol.minsym != NULL
- && MSYMBOL_HAS_SIZE (msymbol.minsym)
- && MSYMBOL_SIZE (msymbol.minsym) == 0
+ && msymbol.minsym->has_size ()
+ && msymbol.minsym->size () == 0
&& msymbol.minsym->type () != mst_text
&& msymbol.minsym->type () != mst_text_gnu_ifunc
&& msymbol.minsym->type () != mst_file_text)
m_type = type;
}
+ /* Return this minimal symbol's size. */
+
+ unsigned long size () const
+ {
+ return m_size;
+ }
+
+ /* Set this minimal symbol's size. */
+
+ void set_size (unsigned long size)
+ {
+ m_size = size;
+ m_has_size = 1;
+ }
+
+ /* Return true if this minimal symbol's size is known. */
+
+ bool has_size () const
+ {
+ return m_has_size;
+ }
+
/* Size of this symbol. dbx_end_psymtab in dbxread.c uses this
information to calculate the end of the partial symtab based on the
address of the last symbol plus the size of the last symbol. */
- unsigned long size;
+ unsigned long m_size;
/* Which source file is this symbol in? Only relevant for mst_file_*. */
const char *filename;
/* Nonzero iff the size of the minimal symbol has been set.
Symbol size information can sometimes not be determined, because
the object file format may not carry that piece of information. */
- unsigned int has_size : 1;
+ unsigned int m_has_size : 1;
/* For data symbols only, if this is set, then the symbol might be
subject to copy relocation. In this case, a minimal symbol
#define MSYMBOL_TARGET_FLAG_1(msymbol) (msymbol)->target_flag_1
#define MSYMBOL_TARGET_FLAG_2(msymbol) (msymbol)->target_flag_2
-#define MSYMBOL_SIZE(msymbol) ((msymbol)->size + 0)
-#define SET_MSYMBOL_SIZE(msymbol, sz) \
- do \
- { \
- (msymbol)->size = sz; \
- (msymbol)->has_size = 1; \
- } while (0)
-#define MSYMBOL_HAS_SIZE(msymbol) ((msymbol)->has_size + 0)
#include "minsyms.h"