46 #include "filenames.h"
63 #include "coff/ecoff.h"
66 #include "aout/aout64.h"
67 #include "aout/stab_gnu.h"
77 #define ECOFF_IN_ELF(bfd) (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
78 && bfd_get_section_by_name (bfd, ".mdebug") != NULL)
105 #define PST_PRIVATE(p) ((struct symloc *)(p)->read_symtab_private)
106 #define FDR_IDX(p) (PST_PRIVATE(p)->fdr_idx)
107 #define CUR_BFD(p) (PST_PRIVATE(p)->cur_bfd)
108 #define DEBUG_SWAP(p) (PST_PRIVATE(p)->debug_swap)
109 #define DEBUG_INFO(p) (PST_PRIVATE(p)->debug_info)
110 #define PENDING_LIST(p) (PST_PRIVATE(p)->pending_list)
112 #define SC_IS_TEXT(sc) ((sc) == scText \
113 || (sc) == scRConst \
116 #define SC_IS_DATA(sc) ((sc) == scData \
121 #define SC_IS_COMMON(sc) ((sc) == scCommon || (sc) == scSCommon)
122 #define SC_IS_BSS(sc) ((sc) == scBss)
123 #define SC_IS_SBSS(sc) ((sc) == scSBss)
124 #define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
150 _(
"guessed tag type of %s incorrectly"), arg1);
170 #define MIN_GLEVEL GLEVEL_0
171 #define compare_glevel(a,b) \
172 (((a) == GLEVEL_3) ? ((b) < GLEVEL_3) : \
173 ((b) == GLEVEL_3) ? -1 : (int)((b) - (a)))
230 char **,
int,
char *);
246 static struct type *
parse_type (
int,
union aux_ext *,
unsigned int,
int *,
328 return "<stripped file>";
340 const struct ecoff_debug_swap *swap,
341 struct ecoff_debug_info *info)
353 if (info->fdr == (FDR *) NULL)
360 (info->symbolic_header.ifdMax
362 fdr_src = info->external_fdr;
364 + info->symbolic_header.ifdMax * swap->external_fdr_size);
366 for (; fdr_src < fdr_end; fdr_src += swap->external_fdr_size, fdr_ptr++)
367 (*swap->swap_fdr_in) (objfile->
obfd, fdr_src, fdr_ptr);
379 "debugging support is limited.\n"),
382 "-g3 for best debugging support.\n"));
494 for (p = pending_list[f_idx]; p; p = p->
next)
516 p->
next = pending_list[f_idx];
517 pending_list[f_idx] = p;
553 const bfd_size_type external_sym_size =
debug_swap->external_sym_size;
554 void (*
const swap_sym_in) (bfd *,
void *, SYMR *) =
debug_swap->swap_sym_in;
564 long svalue = sh->value;
567 if (ext_sh == (
char *) NULL)
581 if (sh->st != stEnd && sh->st != stBlock)
631 if (sh->sc == scRegister)
643 || sh->sc == scNil || sh->index == indexNil)
704 if (sh->st == stProc && sh->sc != scText)
706 char *ext_tsym = ext_sh;
707 int keep_counting = 1;
710 while (keep_counting)
712 ext_tsym += external_sym_size;
713 (*swap_sym_in) (
cur_bfd, ext_tsym, &tsym);
724 _(
"unknown symbol type 0x%x"), sh->st);
739 if (strcmp (
name,
"malloc") == 0
755 if (sh->st == stProc)
813 goto structured_common;
817 goto structured_common;
821 goto structured_common;
825 goto case_stBlock_code;
840 for (ext_tsym = ext_sh + external_sym_size;
842 ext_tsym += external_sym_size)
846 (*swap_sym_in) (
cur_bfd, ext_tsym, &tsym);
868 if (tsym.iss == issNull
884 if (tsym.index == indexNil
885 || (tsym.index == 0 && sh->value == 0))
890 &ax[tsym.index].a_ti,
892 if ((tir.bt == btNil || tir.bt == btVoid
893 || (tir.bt == btEnum && sh->value == 0))
899 if (tsym.value > max_value)
900 max_value = tsym.value;
911 if (tsym.sc == scVariant);
920 + ((
cur_fdr->isymBase + tsym.index - 1)
921 * external_sym_size));
942 _(
"declaration block contains "
943 "unhandled symbol type %d"),
984 if (nfields > 1 && max_value == 0)
1003 if (sh->iss == 0 ||
name[0] ==
'.' ||
name[0] ==
'\0')
1007 name, (
char *) NULL);
1014 nfields *
sizeof (
struct field)));
1018 int unsigned_enum = 1;
1033 for (ext_tsym = ext_sh + external_sym_size;
1035 ext_tsym += external_sym_size)
1040 (*swap_sym_in) (
cur_bfd, ext_tsym, &tsym);
1042 if (tsym.st != stMember)
1128 else if (sh->sc == scText &&
1153 e->
pdr.framereg = -1;
1190 if (iparams == nparams)
1224 _(
"stEnd with storage class %d not handled"), sh->sc);
1347 static struct type *
1360 btMax,
struct type *);
1386 "unsigned char", objfile);
1396 "unsigned short", objfile);
1406 "unsigned int", objfile);
1416 "unsigned long", objfile);
1434 "complex", objfile);
1441 "double complex", objfile);
1451 "fixed decimal", objfile);
1457 "floating decimal", objfile);
1478 "unsigned long", objfile);
1483 "long long", objfile);
1488 "unsigned long long", objfile);
1504 "unsigned int", objfile);
1521 static struct type *
1522 parse_type (
int fd,
union aux_ext *ax,
unsigned int aux_index,
int *bs,
1523 int bigend,
char *sym_name)
1526 struct type *tp = 0;
1530 if (aux_index == indexNil)
1531 return basic_type (btInt, mdebugread_objfile);
1534 if (aux_index >= (
debug_info->fdr + fd)->caux)
1537 return basic_type (btInt, mdebugread_objfile);
1542 (*
debug_swap->swap_tir_in) (bigend, &ax->a_ti, t);
1576 return basic_type (btInt, mdebugread_objfile);
1585 int width = AUX_GET_WIDTH (bigend, ax);
1588 if (bs == (
int *) NULL)
1593 if (t->bt == btShort && width == 8)
1594 tp =
basic_type (btChar, mdebugread_objfile);
1595 else if (t->bt == btUShort && width == 8)
1596 tp =
basic_type (btUChar, mdebugread_objfile);
1597 else if (t->bt == btEnum)
1601 _(
"can't handle TIR fBitfield for %s"),
1611 if (t->bt == btIndirect)
1618 (*
debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
1620 if (rn->rfd == 0xfff)
1622 rf = AUX_GET_ISYM (bigend, ax);
1631 _(
"unable to cross ref btIndirect for %s"), sym_name);
1632 return basic_type (btInt, mdebugread_objfile);
1637 rn->index, (
int *) NULL, xref_fh->fBigendian, sym_name);
1643 if (t->bt == btStruct ||
1654 ax +=
cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
1655 if (tp == (
struct type *) NULL)
1656 tp =
init_type (type_code, 0, 0, (
char *) NULL, mdebugread_objfile);
1694 if (name[0] ==
'.' || name[0] ==
'\0')
1700 name, strlen (name));
1708 if (t->bt == btRange)
1713 ax +=
cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
1714 if (tp == (
struct type *) NULL)
1715 tp =
init_type (type_code, 0, 0, (
char *) NULL, mdebugread_objfile);
1737 name, strlen (name));
1740 if (t->bt == btTypedef)
1745 ax +=
cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
1746 if (tp == (
struct type *) NULL)
1749 _(
"unable to cross ref btTypedef for %s"), sym_name);
1755 if (t->bt == btRange)
1771 #define PARSE_TQ(tq) \
1772 if (t->tq != tqNil) \
1773 ax += upgrade_type(fd, &tp, t->tq, ax, bigend, sym_name); \
1789 (*
debug_swap->swap_tir_in) (bigend, &ax->a_ti, t);
1796 _(
"illegal TIR continued for %s"), sym_name);
1839 (*
debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, &rndx);
1845 rf = AUX_GET_ISYM (bigend, ax);
1852 id, (
int *) NULL, bigend, sym_name);
1859 _(
"illegal array index type for %s, assuming int"),
1866 lower = AUX_GET_DNLOW (bigend, ax);
1868 upper = AUX_GET_DNHIGH (bigend, ax);
1870 rf = AUX_GET_WIDTH (bigend, ax);
1929 const struct block *b;
1940 _(
"can't handle PDR for static proc at 0x%lx"),
1941 (
unsigned long) pr->adr);
1964 + ((
cur_fdr->isymBase + pr->isym)
1970 if (search_symtab != NULL)
2086 if (es->ifd != ifdNil)
2099 if (
SC_IS_UNDEF (es->asym.sc) || es->asym.sc == scNil)
2102 switch (es->asym.st)
2134 switch (es->asym.st)
2158 bigend, section_offsets, objfile);
2178 unsigned char *base;
2180 int delta, count, lineno = 0;
2182 if (fh->cbLine == 0)
2187 for (j = 0; j < fh->cpd; j++, pr++)
2191 unsigned char *halt;
2194 if (pr->iline == ilineNil ||
2195 pr->lnLow == -1 || pr->lnHigh == -1)
2201 if (j != (fh->cpd - 1))
2202 halt = base + pr[1].cbLineOffset;
2204 halt = base + fh->cbLine;
2205 base += pr->cbLineOffset;
2207 adr = pst->
textlow + pr->adr - lowest_pdr_addr;
2210 for (lineno = pr->lnLow; base < halt;)
2212 count = *base & 0x0f;
2213 delta = *base++ >> 4;
2218 delta = (base[0] << 8) | base[1];
2219 if (delta >= 0x8000)
2227 if (lt->
nitems >= maxlines)
2230 _(
"guessed size of linetable for %s incorrectly"),
2244 _(
"function `%s' appears to be defined "
2245 "outside of all compilation units"),
2259 switch (storage_class)
2320 const bfd_size_type external_sym_size =
debug_swap->external_sym_size;
2321 const bfd_size_type external_rfd_size =
debug_swap->external_rfd_size;
2322 const bfd_size_type external_ext_size =
debug_swap->external_ext_size;
2323 void (*
const swap_ext_in) (bfd *,
void *, EXTR *) =
debug_swap->swap_ext_in;
2324 void (*
const swap_sym_in) (bfd *,
void *, SYMR *) =
debug_swap->swap_sym_in;
2325 void (*
const swap_rfd_in) (bfd *,
void *, RFDT *) =
debug_swap->swap_rfd_in;
2337 int textlow_not_set = 1;
2338 int past_first_source_file = 0;
2341 const char **psymtab_include_list;
2342 int includes_allocated;
2348 int dependencies_used, dependencies_allocated;
2352 asection *text_sect;
2353 int relocatable = 0;
2361 text_sect = bfd_get_section_by_name (
cur_bfd,
".text");
2362 if (text_sect != NULL
2363 && (bfd_get_section_flags (
cur_bfd, text_sect) & SEC_RELOC))
2367 sizeof (EXTR) * hdr->iextMax);
2369 includes_allocated = 30;
2371 psymtab_include_list = (
const char **) alloca (includes_allocated *
2372 sizeof (
const char *));
2375 dependencies_allocated = 30;
2376 dependencies_used = 0;
2398 fdr_to_pst = (
struct pst_map *)
2399 xzalloc ((hdr->ifdMax + 1) *
sizeof *fdr_to_pst);
2405 fdr_to_pst[-1].pst = pst;
2414 memset (pending_list, 0,
2418 ext_block = (EXTR *)
xmalloc (hdr->iextMax * sizeof (EXTR));
2422 ext_out_end = ext_out + hdr->iextMax * external_ext_size;
2424 for (; ext_out < ext_out_end; ext_out += external_ext_size, ext_in++)
2425 (*swap_ext_in) (
cur_bfd, ext_out, ext_in);
2429 ext_in_end = ext_in + hdr->iextMax;
2430 for (; ext_in < ext_in_end; ext_in++)
2433 if (ext_in->ifd >= -1
2434 && ext_in->ifd < hdr->ifdMax
2435 && ext_in->asym.iss >= 0
2436 && ext_in->asym.iss < hdr->issExtMax)
2437 fdr_to_pst[ext_in->ifd].n_globals++;
2442 for (f_idx = -1; f_idx < hdr->ifdMax; f_idx++)
2444 fdr_to_pst[f_idx].globals_offset = s_idx;
2445 s_idx += fdr_to_pst[f_idx].n_globals;
2446 fdr_to_pst[f_idx].n_globals = 0;
2482 ext_in_end = ext_in + hdr->iextMax;
2483 for (; ext_in < ext_in_end; ext_in++)
2490 if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax)
2493 _(
"bad ifd for external symbol: %d (max %ld)"),
2494 ext_in->ifd, hdr->ifdMax);
2497 if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
2500 _(
"bad iss for external symbol: %ld (max %ld)"),
2501 ext_in->asym.iss, hdr->issExtMax);
2505 extern_tab[fdr_to_pst[ext_in->ifd].globals_offset
2506 + fdr_to_pst[ext_in->ifd].n_globals++] = *ext_in;
2509 if (
SC_IS_UNDEF (ext_in->asym.sc) || ext_in->asym.sc == scNil)
2517 switch (ext_in->asym.st)
2596 if (sbss_sect_index == -1)
2624 for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
2634 fdr_to_pst[f_idx].pst = NULL;
2643 if (relocatable || textlow != 0)
2656 memset (pst->read_symtab_private, 0, sizeof (
struct symloc));
2683 case langCplusplusV2:
2694 pst->texthigh = pst->textlow;
2707 + (fh->isymBase + 1) * external_sym_size),
2709 if (strcmp (
debug_info->ss + fh->issBase + sh.iss,
2719 const char *namestring;
2723 + (fh->isymBase +
cur_sdx) * external_sym_size),
2725 type_code = ECOFF_UNMARK_STAB (sh.index);
2726 if (!ECOFF_IS_STAB (&sh))
2728 if (sh.st == stProc || sh.st == stStaticProc)
2733 if (sh.st == stStaticProc)
2735 namestring =
debug_info->ss + fh->issBase + sh.iss;
2742 procaddr = sh.value;
2744 isym = AUX_GET_ISYM (fh->fBigendian,
2750 + ((fh->isymBase + isym - 1)
2751 * external_sym_size)),
2759 && (pst->textlow == 0 || procaddr < pst->textlow))
2760 pst->textlow = procaddr;
2761 if (high > pst->texthigh)
2762 pst->texthigh = high;
2765 else if (sh.st == stStatic)
2780 namestring =
debug_info->ss + fh->issBase + sh.iss;
2791 namestring =
debug_info->ss + fh->issBase + sh.iss;
2804 char *stabstring =
debug_info->ss + fh->issBase + sh.iss;
2805 int len = strlen (stabstring);
2807 while (stabstring[len - 1] ==
'\\')
2810 char *stabstring1 = stabstring;
2822 * external_sym_size),
2824 stabstring2 =
debug_info->ss + fh->issBase + sh2.iss;
2825 len2 = strlen (stabstring2);
2829 && stabstring !=
debug_info->ss + fh->issBase + sh.iss)
2830 stabstring =
xrealloc (stabstring, len + len2 + 1);
2833 stabstring =
xmalloc (len + len2 + 1);
2834 strcpy (stabstring, stabstring1);
2836 strcpy (stabstring + len, stabstring2);
2846 case N_TEXT | N_EXT:
2847 case N_NBTEXT | N_EXT:
2852 case N_DATA | N_EXT:
2853 case N_NBDATA | N_EXT:
2860 case N_NBBSS | N_EXT:
2861 case N_SETV | N_EXT:
2890 case N_UNDF | N_EXT:
2909 case N_INDR | N_EXT:
2911 case N_SETA | N_EXT:
2913 case N_SETT | N_EXT:
2915 case N_SETD | N_EXT:
2917 case N_SETB | N_EXT:
2928 static int prev_so_symnum = -10;
2929 static int first_so_symnum;
2931 int prev_textlow_not_set;
2936 prev_textlow_not_set = textlow_not_set;
2945 textlow_not_set = 1;
2949 textlow_not_set = 0;
2951 past_first_source_file = 1;
2953 if (prev_so_symnum !=
symnum - 1)
2955 first_so_symnum =
symnum;
2961 dependencies_used = 0;
2971 namestring = stabstring;
2975 if (*namestring ==
'\000')
2983 p = lbasename (namestring);
2984 if (p != namestring && *p ==
'\000')
3008 namestring = stabstring;
3035 if (pst && filename_cmp (namestring, pst->filename) == 0)
3041 for (i = 0; i < includes_used; i++)
3042 if (filename_cmp (namestring,
3043 psymtab_include_list[i]) == 0)
3052 psymtab_include_list[includes_used++] = namestring;
3053 if (includes_used >= includes_allocated)
3055 const char **orig = psymtab_include_list;
3057 psymtab_include_list = (
const char **)
3058 alloca ((includes_allocated *= 2) *
3059 sizeof (
const char *));
3060 memcpy (psymtab_include_list, orig,
3061 includes_used *
sizeof (
const char *));
3085 namestring = stabstring;
3086 p = (
char *) strchr (namestring,
':');
3108 (gdbarch, namestring);
3136 if (p >= namestring + 2
3137 || (p == namestring + 1
3138 && namestring[0] !=
' '))
3160 if (p != namestring)
3188 while ((*p >=
'0' && *p <=
'9')
3189 || *p ==
'(' || *p ==
',' || *p ==
')'
3212 while (*p && *p !=
';' && *p !=
',')
3218 if (*p ==
'\\' || (*p ==
'?' && p[1] ==
'\0'))
3223 for (q = p; *q && *q !=
':'; q++)
3236 while (*p && *p !=
',')
3256 int name_len = p - namestring;
3259 memcpy (name, namestring, name_len);
3260 name[name_len] =
'\0';
3280 int name_len = p - namestring;
3283 memcpy (name, namestring, name_len);
3284 name[name_len] =
'\0';
3338 _(
"unknown symbol descriptor `%c'"), p[1]);
3359 dependencies_used = 0;
3403 _(
"unknown symbol type %s"),
3408 && stabstring !=
debug_info->ss + fh->issBase + sh.iss)
3425 * external_sym_size)),
3428 if (ECOFF_IS_STAB (&sh))
3436 || (sh.index == indexNil
3437 && (sh.st != stStatic || sh.sc == scAbs)))
3444 name =
debug_info->ss + fh->issBase + sh.iss;
3446 minsym_value = sh.value;
3489 if (sh.index >= hdr->iauxMax)
3497 new_sdx = AUX_GET_ISYM (fh->fBigendian,
3506 _(
"bad proc end in aux found from symbol %s"),
3518 if (sh.st == stProc && sh.sc != scText)
3532 if (sh.st == stProc)
3543 procaddr = sh.value;
3548 + ((fh->isymBase +
cur_sdx - 1)
3549 * external_sym_size)),
3556 && (pst->textlow == 0 || procaddr < pst->textlow))
3557 pst->textlow = procaddr;
3559 high = procaddr + sh.value;
3560 if (high > pst->texthigh)
3561 pst->texthigh = high;
3600 if ((sh.sc == scInfo
3619 _(
"bad aux index at block symbol %s"), name);
3655 ext_ptr = &extern_tab[fdr_to_pst[f_idx].globals_offset];
3656 cur_sdx = fdr_to_pst[f_idx].n_globals;
3659 for (; --
cur_sdx >= 0; ext_ptr++)
3666 if (ext_ptr->ifd != f_idx)
3668 _(
"failed internal consistency check"));
3669 psh = &ext_ptr->asym;
3675 svalue = psh->value;
3736 fdr_to_pst[f_idx].pst =
end_psymtab (objfile, save_pst,
3737 psymtab_include_list, includes_used,
3739 dependency_list, dependencies_used, textlow_not_set);
3741 dependencies_used = 0;
3754 save_pst = fdr_to_pst[f_idx].pst;
3755 if (save_pst != NULL
3762 && save_pst->
textlow >= pst->textlow
3763 && save_pst->
textlow < pst->texthigh
3764 && save_pst->
texthigh > pst->texthigh)
3774 for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
3777 pst = fdr_to_pst[f_idx].pst;
3788 pst->number_of_dependencies = 0;
3794 for (s_idx = 1; s_idx < fh->crfd; s_idx++)
3800 + (fh->rfdBase + s_idx) * external_rfd_size),
3802 if (rh < 0 || rh >= hdr->ifdMax)
3815 pst->dependencies[pst->number_of_dependencies++]
3816 = fdr_to_pst[rh].pst;
3837 const bfd_size_type external_sym_size =
debug_swap->external_sym_size;
3838 void (*
const swap_sym_in) (bfd *,
void *, SYMR *) =
debug_swap->swap_sym_in;
3839 char *ext_sym = ((
char *)
debug_info->external_sym
3840 + ((fh->isymBase +
cur_sdx + 1) * external_sym_size));
3857 (*swap_sym_in) (
cur_bfd, ext_sym, &sh);
3858 if (sh.st != stMember)
3861 if (sh.index == indexNil
3862 || (sh.index == 0 && svalue == 0))
3866 + fh->iauxBase + sh.index)->a_ti,
3868 if ((tir.bt != btNil
3870 && (tir.bt != btEnum || svalue != 0))
3871 || tir.tq0 != tqNil)
3883 (*swap_sym_in) (
cur_bfd, ext_sym, &sh);
3884 if (sh.st != stMember)
3894 ext_sym += external_sym_size;
3928 bfd_size_type external_sym_size;
3929 bfd_size_type external_pdr_size;
3930 void (*swap_sym_in) (bfd *,
void *, SYMR *);
3931 void (*swap_pdr_in) (bfd *,
void *, PDR *);
3937 int last_symtab_ended = 0;
3980 external_sym_size =
debug_swap->external_sym_size;
3981 external_pdr_size =
debug_swap->external_pdr_size;
3984 mdebugread_objfile = objfile;
3993 if (fh != (FDR *) NULL && fh->csym >= 2)
3999 + (fh->isymBase + 1) * external_sym_size),
4001 if (strcmp (
debug_info->ss + fh->issBase + sh.iss,
4020 mdebugread_objfile = NULL;
4031 + (fh->isymBase +
cur_sdx) * external_sym_size),
4033 name =
debug_info->ss + fh->issBase + sh.iss;
4036 if (ECOFF_IS_STAB (&sh) || (name[0] ==
'#'))
4038 int type_code = ECOFF_UNMARK_STAB (sh.index);
4043 if (type_code & N_STAB)
4050 if (type_code == N_SO
4060 last_symtab_ended = 1;
4064 last_symtab_ended = 0;
4066 section_offsets, objfile);
4070 else if (name[0] ==
'#')
4073 section_offsets, objfile);
4075 if (type_code == N_FUN)
4090 e->
pdr.framereg = -1;
4094 else if (sh.st == stLabel)
4096 if (sh.index == indexNil)
4111 else if (sh.st == stProc || sh.st == stStaticProc
4112 || sh.st == stStatic || sh.st == stEnd)
4117 _(
"unknown stabs symbol %s"), name);
4120 if (! last_symtab_ended)
4142 pr_block = (PDR *)
xmalloc (fh->cpd * sizeof (PDR));
4146 + fh->ipdFirst * external_pdr_size);
4147 pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
4151 pdr_ptr += external_pdr_size, pdr_in++)
4153 (*swap_pdr_in) (
cur_bfd, pdr_ptr, pdr_in);
4157 if (pdr_in == pr_block)
4158 lowest_pdr_addr = pdr_in->adr;
4159 else if (pdr_in->adr < lowest_pdr_addr)
4160 lowest_pdr_addr = pdr_in->adr;
4164 pdr_in_end = pdr_in + fh->cpd;
4165 for (; pdr_in < pdr_in_end; pdr_in++)
4185 maxlines = 2 * fh->cline;
4218 + fh->isymBase * external_sym_size);
4219 sym_end = sym_ptr + fh->csym * external_sym_size;
4220 while (sym_ptr < sym_end)
4225 (*swap_sym_in) (
cur_bfd, sym_ptr, &sh);
4228 sym_ptr, fh->fBigendian,
4229 section_offsets, objfile);
4230 sym_ptr += c * external_sym_size;
4245 pr_block = (PDR *)
xmalloc (fh->cpd * sizeof (PDR));
4250 + fh->ipdFirst * external_pdr_size);
4251 pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
4255 pdr_ptr += external_pdr_size, pdr_in++)
4257 (*swap_pdr_in) (
cur_bfd, pdr_ptr, pdr_in);
4261 if (pdr_in == pr_block)
4262 lowest_pdr_addr = pdr_in->adr;
4263 else if (pdr_in->adr < lowest_pdr_addr)
4264 lowest_pdr_addr = pdr_in->adr;
4268 pst, lowest_pdr_addr);
4269 if (lines->
nitems < fh->cline)
4274 pdr_in_end = pdr_in + fh->cpd;
4275 for (; pdr_in < pdr_in_end; pdr_in++)
4289 + size *
sizeof (lines->
item)));
4302 for (i =
PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
4304 section_offsets, objfile);
4316 "procedures\n\t%4d labels\n",
4329 mdebugread_objfile = NULL;
4345 if (sh->index == indexNil)
4348 ax =
debug_info->external_aux + fh->iauxBase + sh->index;
4349 (*
debug_swap->swap_tir_in) (fh->fBigendian, &ax->a_ti, &tir);
4350 if (tir.bt != btStruct && tir.bt != btUnion && tir.bt != btEnum)
4354 (*
debug_swap->swap_rndx_in) (fh->fBigendian, &ax->a_rndx, rn);
4355 if (rn->rfd == 0xfff)
4356 rf = AUX_GET_ISYM (fh->fBigendian, ax + 1);
4373 char **pname,
int bigend,
char *sym_name)
4384 *tpp = (
struct type *) NULL;
4386 (*
debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
4389 if (rn->rfd == 0xfff)
4392 rf = AUX_GET_ISYM (bigend, ax + 1);
4404 *pname =
"<undefined>";
4406 (
char *) NULL, mdebugread_objfile);
4413 if (rn->rfd == 0xfff && rn->index == 0)
4415 *pname =
"<undefined>";
4423 if (rn->index >= fh->csym)
4426 *pname =
"<illegal>";
4438 + ((fh->isymBase + rn->index)
4443 if ((sh.sc != scInfo
4444 || (sh.st != stBlock && sh.st != stTypedef && sh.st != stIndirect
4445 && sh.st != stStruct && sh.st != stUnion
4446 && sh.st != stEnum))
4450 *pname =
"<illegal>";
4455 *pname =
debug_info->ss + fh->issBase + sh.iss;
4464 if ((sh.iss == 0 && sh.st == stTypedef) || sh.st == stIndirect)
4484 + fh->iauxBase + sh.index)->a_ti,
4486 if (tir.tq0 != tqNil)
4488 _(
"illegal tq0 in forward typedef for %s"), sym_name);
4492 *tpp =
init_type (type_code, 0, 0, (
char *) NULL,
4493 mdebugread_objfile);
4494 *pname =
"<undefined>";
4502 + fh->iauxBase + sh.index + 1),
4503 tpp, type_code, pname,
4504 fh->fBigendian, sym_name);
4526 _(
"illegal bt %d in forward typedef for %s"), tir.bt,
4528 *tpp =
init_type (type_code, 0, 0, (
char *) NULL,
4529 mdebugread_objfile);
4534 else if (sh.st == stTypedef)
4557 *tpp =
init_type (type_code, 0, 0, (
char *) NULL, mdebugread_objfile);
4615 + BLOCKVECTOR_NBLOCKS (bv)
4616 *
sizeof (bv->
block)));
4702 sizeof (
struct block *),
4808 * sizeof (lt->
item))));
4832 static struct block *
4863 static struct type *
4881 const struct ecoff_debug_swap *swap, asection *sec)
4883 bfd *abfd = objfile->
obfd;
4884 struct ecoff_debug_info *info;
4894 info = ((
struct ecoff_debug_info *)
4896 sizeof (
struct ecoff_debug_info)));
4898 if (!(*swap->read_debug_info) (abfd, sec, info))
4899 error (
_(
"Error reading ECOFF debugging information: %s"),
4900 bfd_errmsg (bfd_get_error ()));
#define ALL_OBJFILE_PSYMTABS(objfile, p)
struct psymbol_allocation_list static_psymbols
void free_header_files(void)
static int add_line(struct linetable *, int, CORE_ADDR, int)
char * hex_string(LONGEST num)
static struct type * parse_type(int, union aux_ext *, unsigned int, int *, int, char *)
const char * symtab_to_filename_for_display(struct symtab *symtab)
static int mdebug_register_index
#define TYPE_RANGE_DATA(thistype)
#define compare_glevel(a, b)
static const char * range
void stabsread_new_init(void)
static struct blockvector * new_bvect(int)
#define OBSTACK_CALLOC(OBSTACK, NUMBER, TYPE)
int gdbarch_ecoff_reg_to_regnum(struct gdbarch *gdbarch, int ecoff_regnr)
static void parse_lines(FDR *, PDR *, struct linetable *, int, struct partial_symtab *, CORE_ADDR)
#define SECT_OFF_TEXT(objfile)
struct type * create_static_range_type(struct type *result_type, struct type *index_type, LONGEST low_bound, LONGEST high_bound)
#define COMPUNIT_DEBUGFORMAT(cust)
void symbol_set_symtab(struct symbol *symbol, struct symtab *symtab)
struct type * builtin_void
struct linetable_entry item[1]
#define MDEBUG_EFI_SYMBOL_NAME
static struct symbol * mylookup_symbol(char *, const struct block *, domain_enum, enum address_class)
static void bad_rfd_entry_complaint(const char *arg1, int arg2, int arg3)
int hashname(const char *name)
#define TYPE_LOW_BOUND(range_type)
struct dictionary * dict_create_linear_expandable(void)
void add_symbol_to_list(struct symbol *symbol, struct pending **listhead)
int gdbarch_int_bit(struct gdbarch *gdbarch)
EXTERN unsigned char processing_gcc_compilation
struct psymbol_allocation_list global_psymbols
struct type * create_array_type(struct type *result_type, struct type *element_type, struct type *range_type)
#define TYPE_NAME(thistype)
#define TYPE_FIELD_ARTIFICIAL(thistype, n)
#define INIT_CPLUS_SPECIFIC(type)
static void function_outside_compilation_unit_complaint(const char *arg1)
#define TYPE_HIGH_BOUND(range_type)
void set_last_source_file(const char *name)
enum domain_enum_tag domain_enum
struct compunit_symtab * allocate_compunit_symtab(struct objfile *objfile, const char *name)
#define SYMBOL_SET_LINKAGE_NAME(symbol, linkage_name)
struct ui_file * gdb_stdout
struct parse_stack * next
const struct objfile_type * objfile_type(struct objfile *objfile)
struct compunit_symtab * end_symtab(CORE_ADDR end_addr, int section)
#define SYMBOL_CLASS(symbol)
void internal_error(const char *file, int line, const char *fmt,...)
static int compare_blocks(const void *arg1, const void *arg2)
static int has_opaque_xref(FDR *, SYMR *)
struct type * make_pointer_type(struct type *type, struct type **typeptr)
static void parse_external(EXTR *, int, struct section_offsets *, struct objfile *)
struct type * nodebug_data_symbol
#define BLOCKVECTOR_BLOCK(blocklist, n)
struct type * init_type(enum type_code code, int length, int flags, const char *name, struct objfile *objfile)
struct minimal_symbol * prim_record_minimal_symbol_and_info(const char *name, CORE_ADDR address, enum minimal_symbol_type ms_type, int section, struct objfile *objfile)
#define SET_FIELD_BITPOS(thisfld, bitpos)
static void parse_procedure(PDR *pr, struct compunit_symtab *search_symtab, struct partial_symtab *pst)
#define TYPE_PROTOTYPED(t)
#define TYPE_FIELD_TYPE(thistype, n)
struct ecoff_debug_info * debug_info
void printf_filtered(const char *format,...)
static struct type * new_type(char *)
static int n_undef_symbols
#define BLOCK_FUNCTION(bl)
EXTERN struct subfile * current_subfile
struct obstack objfile_obstack
int is_cplus_marker(int c)
#define SYMTAB_BLOCKVECTOR(symtab)
EXTERN unsigned int symnum
static const struct objfile_data * basic_type_data
#define SYMBOL_ACLASS_INDEX(symbol)
#define SYMBOL_VALUE_ADDRESS(symbol)
static struct partial_symtab * new_psymtab(char *, struct objfile *)
static struct type * basic_type(int bt, struct objfile *objfile)
static void bad_tag_guess_complaint(const char *arg1)
CORE_ADDR gdbarch_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
#define SYMBOL_DOMAIN(symbol)
int get_section_index(struct objfile *objfile, char *section_name)
#define SYMBOL_SET_LANGUAGE(symbol, language, obstack)
void * xzalloc(size_t size)
struct partial_symbol ** next
static void unexpected_type_code_complaint(const char *arg1)
void scan_file_globals(struct objfile *objfile)
static void add_block(struct block *, struct symtab *)
static char * mdebug_next_symbol_text(struct objfile *)
struct partial_symtab * start_psymtab_common(struct objfile *, const char *, CORE_ADDR, struct partial_symbol **, struct partial_symbol **)
char * obconcat(struct obstack *obstackp,...)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
#define SECT_OFF_DATA(objfile)
void buildsym_new_init(void)
static void record_minimal_symbol(const char *name, const CORE_ADDR address, enum minimal_symbol_type ms_type, int storage_class, struct objfile *objfile)
void complaint(struct complaints **complaints, const char *fmt,...)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
#define ANOFFSET(secoff, whichone)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
static char * fdr_name(FDR *f)
static const struct ecoff_debug_swap * debug_swap
EXTERN struct pending * local_symbols
void add_compunit_symtab_to_objfile(struct compunit_symtab *cu)
void _initialize_mdebugread(void)
#define TYPE_TARGET_STUB(t)
static void parse_partial_symbols(struct objfile *)
#define next_symbol_text(objfile)
static void handle_psymbol_enumerators(struct objfile *, FDR *, int, CORE_ADDR)
#define BLOCK_SUPERBLOCK(bl)
struct type * alloc_type(struct objfile *objfile)
const char * get_last_source_file(void)
static void pop_parse_stack(void)
int gdbarch_double_bit(struct gdbarch *gdbarch)
EXTERN int previous_stab_code
#define SYMBOL_LINKAGE_NAME(symbol)
static void unknown_ext_complaint(const char *arg1)
static struct linetable * shrink_linetable(struct linetable *)
struct cleanup * make_cleanup_discard_minimal_symbols(void)
int gdbarch_sofun_address_maybe_missing(struct gdbarch *gdbarch)
#define SET_FIELD_ENUMVAL(thisfld, enumval)
static void push_parse_stack(void)
static void add_symbol(struct symbol *, struct symtab *, struct block *)
static void mdebug_read_symtab(struct partial_symtab *self, struct objfile *objfile)
void wrap_here(char *indent)
void printf_unfiltered(const char *format,...)
int number_of_dependencies
#define TYPE_FIELDS(thistype)
static int mdebug_regparm_index
static int n_undef_labels
static struct symbol * new_symbol(char *)
void elfmdebug_build_psymtabs(struct objfile *objfile, const struct ecoff_debug_swap *swap, asection *sec)
#define FIELD_BITSIZE(thisfld)
#define ECOFF_IN_ELF(bfd)
void * read_symtab_private
enum language pst_language
#define SYMBOL_VALUE(symbol)
#define SYMBOL_VALUE_CHAIN(symbol)
struct partial_symtab * allocate_psymtab(const char *, struct objfile *) ATTRIBUTE_NONNULL(1)
void init_minimal_symbol_collection(void)
void add_psymbol_to_list(const char *, int, int, domain_enum, enum address_class, struct psymbol_allocation_list *, long, CORE_ADDR, enum language, struct objfile *)
const struct ecoff_debug_swap * debug_swap
struct type * builtin_int
PTR xrealloc(PTR ptr, size_t size)
#define COMPUNIT_BLOCKVECTOR(cust)
static struct compunit_symtab * new_symtab(const char *, int, struct objfile *)
static struct mdebug_pending ** pending_list
#define SYMBOL_SET_NAMES(symbol, linkage_name, len, copy_name, objfile)
static struct ecoff_debug_info * debug_info
#define TYPE_TARGET_TYPE(thistype)
struct symbol * allocate_symbol(struct objfile *objfile)
struct partial_symtab * pst
struct partial_symtab * next
enum language deduce_language_from_filename(const char *filename)
#define SYMBOL_BLOCK_VALUE(symbol)
#define TYPE_CODE(thistype)
struct partial_symtab * end_psymtab(struct objfile *objfile, struct partial_symtab *pst, const char **include_list, int num_includes, int capping_symbol_offset, CORE_ADDR capping_text, struct partial_symtab **dependency_list, int number_dependencies, int textlow_not_set)
struct partial_symtab ** dependencies
struct complaints * symfile_complaints
const char * gdbarch_static_transform_name(struct gdbarch *gdbarch, const char *name)
void dict_add_symbol(struct dictionary *dict, struct symbol *sym)
struct symbol * lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
struct dictionary * dict_create_hashed_expandable(void)
int register_symbol_register_impl(enum address_class aclass, const struct symbol_register_ops *ops)
struct symtab * allocate_symtab(struct compunit_symtab *cust, const char *filename)
#define TYPE_NFIELDS(thistype)
record_line_ftype record_line
int gdbarch_float_bit(struct gdbarch *gdbarch)
#define SYMBOL_LANGUAGE(symbol)
#define COMPUNIT_FILETABS(cust)
static enum language psymtab_language
#define BLOCKVECTOR_NBLOCKS(blocklist)
struct mdebug_pending ** pending_list
void mdebug_build_psymtabs(struct objfile *objfile, const struct ecoff_debug_swap *swap, struct ecoff_debug_info *info)
struct type * nodebug_text_symbol
#define TYPE_TAG_NAME(type)
static void add_pending(FDR *fh, char *sh, struct type *t)
void(* read_symtab)(struct partial_symtab *, struct objfile *)
#define FIELD_NAME(thisfld)
EXTERN char *(* next_symbol_text_func)(struct objfile *)
static struct mdebug_pending * is_pending_symbol(FDR *fh, char *sh)
#define TYPE_ALLOC(t, size)
#define SYMBOL_TYPE(symbol)
static void psymtab_to_symtab_1(struct objfile *objfile, struct partial_symtab *, const char *)
static int upgrade_type(int, struct type **, int, union aux_ext *, int, char *)
#define TYPE_LENGTH(thistype)
#define SECT_OFF_BSS(objfile)
static struct parse_stack * top_stack
#define TYPE_ZALLOC(t, size)
struct compunit_symtab * compunit_symtab
struct section_offsets * section_offsets
void gdb_flush(struct ui_file *file)
static int mdebug_reg_to_regnum(struct symbol *sym, struct gdbarch *gdbarch)
#define SYMBOL_VALUE_BYTES(symbol)
static void sort_blocks(struct symtab *)
void process_one_symbol(int type, int desc, CORE_ADDR valu, char *name, const struct section_offsets *section_offsets, struct objfile *objfile)
int gdbarch_static_transform_name_p(struct gdbarch *gdbarch)
static struct objfile * mdebugread_objfile
static void basic_type_complaint(int arg1, const char *arg2)
void install_minimal_symbols(struct objfile *objfile)
static int found_ecoff_debugging_info
static char stabs_symbol[]
#define SYMTAB_LINETABLE(symtab)
void error(const char *fmt,...)
static struct linetable * new_linetable(int)
struct type * lookup_pointer_type(struct type *type)
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
struct mdebug_pending * next
void init_header_files(void)
static int parse_symbol(SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, struct section_offsets *section_offsets, struct objfile *objfile)
EXTERN struct symbol * global_sym_chain[HASHSIZE]
void do_cleanups(struct cleanup *old_chain)
static struct block * new_block(enum block_type)
struct parse_stack * prev
#define FIELD_TYPE(thisfld)
struct type * lookup_function_type(struct type *type)
#define SYMBOL_IS_ARGUMENT(symbol)
struct partial_symtab * psymtabs
static FDR * get_rfd(int cf, int rf)
__extension__ enum domain_enum_tag domain
static int cross_ref(int, union aux_ext *, struct type **, enum type_code, char **, int, char *)
const ULONGEST const LONGEST len
static void index_complaint(const char *arg1)