48#include "gdbsupport/gdb_obstack.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 md_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)
130 complaint (_(
"bad aux index at symbol %s"), arg1);
136 complaint (_(
"unknown external symbol %s"), arg1);
142 complaint (_(
"cannot map ECOFF basic type 0x%x for %s"),
149 complaint (_(
"guessed tag type of %s incorrectly"), arg1);
155 complaint (_(
"bad rfd entry for %s: file %d, index %d"),
162 complaint (_(
"unexpected type code for %s"), arg1);
169#define MIN_GLEVEL GLEVEL_0
170#define compare_glevel(a,b) \
171 (((a) == GLEVEL_3) ? ((b) < GLEVEL_3) : \
172 ((b) == GLEVEL_3) ? -1 : (int)((b) - (a)))
231 const char **,
int,
const char *);
247static struct type *
parse_type (
int,
union aux_ext *,
unsigned int,
int *,
271 FDR *,
int, CORE_ADDR);
322 return "<stripped file>";
335 const struct ecoff_debug_swap *swap,
336 struct ecoff_debug_info *info)
347 if (info->fdr == NULL)
354 info->symbolic_header.ifdMax);
355 fdr_src = (
char *) info->external_fdr;
357 + info->symbolic_header.ifdMax * swap->external_fdr_size);
359 for (; fdr_src < fdr_end; fdr_src += swap->external_fdr_size, fdr_ptr++)
360 (*swap->swap_fdr_in) (
objfile->
obfd.get (), fdr_src, fdr_ptr);
375 "debugging support is limited.\n"),
377 gdb_printf (_(
"You should compile with -g2 or "
378 "-g3 for best debugging support.\n"));
520 complaint (_(
"bad register number %d (max %d) in symbol %s"),
521 regnum, num_regs - 1, sym);
562 struct symbol *s,
int aclass_index,
struct block *b,
571 || sh->sc == scNil || sh->index == indexNil)
583 const bfd_size_type external_sym_size =
debug_swap->external_sym_size;
584 void (*
const swap_sym_in) (bfd *,
void *, SYMR *) =
debug_swap->swap_sym_in;
592 long svalue = sh->value;
609 if (sh->st != stEnd && sh->st != stBlock)
658 if (sh->sc == scRegister)
720 if (sh->st == stProc && sh->sc != scText)
722 char *ext_tsym = ext_sh;
723 int keep_counting = 1;
726 while (keep_counting)
728 ext_tsym += external_sym_size;
729 (*swap_sym_in) (
cur_bfd, ext_tsym, &tsym);
739 complaint (_(
"unknown symbol type 0x%x"), sh->st);
754 if (strcmp (
name,
"malloc") == 0
755 && t->
code () == TYPE_CODE_VOID)
770 if (sh->st == stProc)
829 goto structured_common;
833 goto structured_common;
837 goto structured_common;
841 goto case_stBlock_code;
856 for (ext_tsym = ext_sh + external_sym_size;
858 ext_tsym += external_sym_size)
862 (*swap_sym_in) (
cur_bfd, ext_tsym, &tsym);
884 if (tsym.iss == issNull
900 if (tsym.index == indexNil
901 || (tsym.index == 0 && sh->value == 0))
906 &ax[tsym.index].a_ti,
908 if ((tir.bt == btNil || tir.bt == btVoid
909 || (tir.bt == btEnum && sh->value == 0))
915 if (tsym.value > max_value)
916 max_value = tsym.value;
927 if (tsym.sc == scVariant);
936 + ((
cur_fdr->isymBase + tsym.index - 1)
937 * external_sym_size));
957 complaint (_(
"declaration block contains "
958 "unhandled symbol type %d"),
999 if (nfields > 1 && max_value == 0)
1018 if (sh->iss == 0 ||
name[0] ==
'.' ||
name[0] ==
'\0')
1022 name, (
char *) NULL));
1032 int unsigned_enum = 1;
1047 for (ext_tsym = ext_sh + external_sym_size;
1049 ext_tsym += external_sym_size)
1054 (*swap_sym_in) (
cur_bfd, ext_tsym, &tsym);
1056 if (tsym.st != stMember)
1059 f->set_loc_enumval (tsym.value);
1141 else if (sh->sc == scText &&
1164 e->
pdr.framereg = -1;
1171 if (b_bad->superblock () == cblock
1175 b_bad->set_start (cblock->
start ());
1176 b_bad->set_end (cblock->
end ());
1200 if (iparams == nparams)
1233 complaint (_(
"stEnd with storage class %d not handled"), sh->sc);
1243 f->set_loc_bitpos (sh->value);
1305 || (s->
type ()->
code () != TYPE_CODE_STRUCT
1306 && s->
type ()->
code () != TYPE_CODE_UNION)))
1308 if (s->
type ()->
code () == TYPE_CODE_PTR
1309 || s->
type ()->
code () == TYPE_CODE_FUNC)
1348 complaint (_(
"unknown symbol type 0x%x"), sh->st);
1358 gdb::noop_deleter<struct type *>>
1374 btMax,
struct type *);
1510parse_type (
int fd,
union aux_ext *ax,
unsigned int aux_index,
int *bs,
1511 int bigend,
const char *sym_name)
1514 struct type *tp = 0;
1518 if (aux_index == indexNil)
1522 if (aux_index >= (
debug_info->fdr + fd)->caux)
1530 (*
debug_swap->swap_tir_in) (bigend, &ax->a_ti, t);
1573 int width = AUX_GET_WIDTH (bigend, ax);
1581 if (t->bt == btShort && width == 8)
1583 else if (t->bt == btUShort && width == 8)
1585 else if (t->bt == btEnum)
1588 complaint (_(
"can't handle TIR fBitfield for %s"),
1598 if (t->bt == btIndirect)
1605 (*
debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
1607 if (rn->rfd == 0xfff)
1609 rf = AUX_GET_ISYM (bigend, ax);
1617 complaint (_(
"unable to cross ref btIndirect for %s"), sym_name);
1623 rn->index, NULL, xref_fh->fBigendian, sym_name);
1629 if (t->bt == btStruct ||
1646 while (tp->
code () == TYPE_CODE_PTR
1647 || tp->
code () == TYPE_CODE_ARRAY)
1653 if (tp->
code () != TYPE_CODE_STRUCT
1654 && tp->
code () != TYPE_CODE_UNION
1655 && tp->
code () != TYPE_CODE_ENUM)
1665 if ((tp->
code () == TYPE_CODE_ENUM
1667 || (tp->
code () != TYPE_CODE_ENUM
1680 if (
name[0] ==
'.' ||
name[0] ==
'\0')
1682 else if (tp->
name () == NULL
1683 || strcmp (tp->
name (),
name) != 0)
1693 if (t->bt == btRange)
1705 if (tp->
code () != TYPE_CODE_RANGE)
1718 if (tp->
name () == NULL
1719 || strcmp (tp->
name (),
name) != 0)
1724 if (t->bt == btTypedef)
1732 complaint (_(
"unable to cross ref btTypedef for %s"), sym_name);
1738 if (t->bt == btRange)
1754#define PARSE_TQ(tq) \
1755 if (t->tq != tqNil) \
1756 ax += upgrade_type(fd, &tp, t->tq, ax, bigend, sym_name); \
1772 (*
debug_swap->swap_tir_in) (bigend, &ax->a_ti, t);
1778 complaint (_(
"illegal TIR continued for %s"), sym_name);
1792 const char *sym_name)
1821 (*
debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, &rndx);
1827 rf = AUX_GET_ISYM (bigend, ax);
1834 id, NULL, bigend, sym_name);
1838 if (indx->
code () != TYPE_CODE_INT)
1840 complaint (_(
"illegal array index type for %s, assuming int"),
1847 lower = AUX_GET_DNLOW (bigend, ax);
1849 upper = AUX_GET_DNHIGH (bigend, ax);
1851 rf = AUX_GET_WIDTH (bigend, ax);
1872 if ((*tpp)->length () == 0)
1887 complaint (_(
"unknown type qualifier 0x%x"), tq);
1909 const struct block *b;
1919 complaint (_(
"can't handle PDR for static proc at 0x%lx"),
1920 (
unsigned long) pr->adr);
1943 + ((
cur_fdr->isymBase + pr->isym)
1949 if (search_symtab != NULL)
1981 complaint (_(
"PDR for %s, but no symbol"), sh_name);
1995 SYMBOL_BLOCK_VALUE (s) = b;
1996 BLOCK_FUNCTION (b) = s;
1997 BLOCK_START (b) = pr->adr;
2000 BLOCK_END (b) = bound;
2060 if (es->ifd != ifdNil)
2073 if (
SC_IS_UNDEF (es->asym.sc) || es->asym.sc == scNil)
2076 switch (es->asym.st)
2102 gdb_printf (_(
"Warning: %s `%s' is undefined (in %s)\n"),
2108 switch (es->asym.st)
2147 CORE_ADDR textlow, CORE_ADDR lowest_pdr_addr)
2149 unsigned char *base;
2151 int delta, count, lineno = 0;
2153 if (fh->cbLine == 0)
2158 for (j = 0; j < fh->cpd; j++, pr++)
2162 unsigned char *halt;
2165 if (pr->iline == ilineNil ||
2166 pr->lnLow == -1 || pr->lnHigh == -1)
2172 if (j != (fh->cpd - 1))
2173 halt = base + pr[1].cbLineOffset;
2175 halt = base + fh->cbLine;
2176 base += pr->cbLineOffset;
2178 adr = textlow + pr->adr - lowest_pdr_addr;
2181 for (lineno = pr->lnLow; base < halt;)
2183 count = *base & 0x0f;
2184 delta = *base++ >> 4;
2189 delta = (base[0] << 8) | base[1];
2190 if (delta >= 0x8000)
2198 if (
lt->nitems >= maxlines)
2200 complaint (_(
"guessed size of linetable for %s incorrectly"),
2213 complaint (_(
"function `%s' appears to be defined "
2214 "outside of all compilation units"),
2223 const char *
name,
const CORE_ADDR address,
2229 switch (storage_class)
2291 const bfd_size_type external_sym_size =
debug_swap->external_sym_size;
2292 const bfd_size_type external_rfd_size =
debug_swap->external_rfd_size;
2293 const bfd_size_type external_ext_size =
debug_swap->external_ext_size;
2294 void (*
const swap_ext_in) (bfd *,
void *, EXTR *) =
debug_swap->swap_ext_in;
2295 void (*
const swap_sym_in) (bfd *,
void *, SYMR *) =
debug_swap->swap_sym_in;
2296 void (*
const swap_rfd_in) (bfd *,
void *, RFDT *) =
debug_swap->swap_rfd_in;
2307 int textlow_not_set = 1;
2310 const char **psymtab_include_list;
2311 int includes_allocated;
2317 int dependencies_used, dependencies_allocated;
2320 asection *text_sect;
2321 int relocatable = 0;
2329 text_sect = bfd_get_section_by_name (
cur_bfd,
".text");
2330 if (text_sect != NULL
2331 && (bfd_section_flags (text_sect) & SEC_RELOC))
2336 includes_allocated = 30;
2338 psymtab_include_list = (
const char **) alloca (includes_allocated *
2339 sizeof (
const char *));
2342 dependencies_allocated = 30;
2343 dependencies_used = 0;
2365 std::vector<struct pst_map> fdr_to_pst_holder (hdr->ifdMax + 1);
2366 fdr_to_pst = fdr_to_pst_holder.data ();
2371 fdr_to_pst[-1].
pst = new_pst;
2382 gdb::def_vector<EXTR> ext_block (hdr->iextMax);
2385 ext_out_end = ext_out + hdr->iextMax * external_ext_size;
2386 ext_in = ext_block.data ();
2387 for (; ext_out < ext_out_end; ext_out += external_ext_size, ext_in++)
2388 (*swap_ext_in) (
cur_bfd, ext_out, ext_in);
2391 ext_in = ext_block.data ();
2392 ext_in_end = ext_in + hdr->iextMax;
2393 for (; ext_in < ext_in_end; ext_in++)
2396 if (ext_in->ifd >= -1
2397 && ext_in->ifd < hdr->ifdMax
2398 && ext_in->asym.iss >= 0
2399 && ext_in->asym.iss < hdr->issExtMax)
2405 for (f_idx = -1; f_idx < hdr->ifdMax; f_idx++)
2444 ext_in = ext_block.data ();
2445 ext_in_end = ext_in + hdr->iextMax;
2446 for (; ext_in < ext_in_end; ext_in++)
2449 CORE_ADDR svalue = ext_in->asym.value;
2453 if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax)
2455 complaint (_(
"bad ifd for external symbol: %d (max %ld)"),
2456 ext_in->ifd, hdr->ifdMax);
2459 if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
2461 complaint (_(
"bad iss for external symbol: %ld (max %ld)"),
2462 ext_in->asym.iss, hdr->issExtMax);
2467 + fdr_to_pst[ext_in->ifd].
n_globals++] = *ext_in;
2470 if (
SC_IS_UNDEF (ext_in->asym.sc) || ext_in->asym.sc == scNil)
2478 switch (ext_in->asym.st)
2557 if (sbss_sect_index == -1)
2585 for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
2595 fdr_to_pst[f_idx].
pst = NULL;
2636 case langCplusplusV2:
2660 + (fh->isymBase + 1) * external_sym_size),
2662 if (strcmp (
debug_info->ss + fh->issBase + sh.iss,
2672 const char *namestring;
2676 + (fh->isymBase +
cur_sdx) * external_sym_size),
2678 type_code = ECOFF_UNMARK_STAB (sh.index);
2679 if (!ECOFF_IS_STAB (&sh))
2681 if (sh.st == stProc || sh.st == stStaticProc)
2686 if (sh.st == stStaticProc)
2688 namestring =
debug_info->ss + fh->issBase + sh.iss;
2693 procaddr = sh.value;
2695 isym = AUX_GET_ISYM (fh->fBigendian,
2701 + ((fh->isymBase + isym - 1)
2702 * external_sym_size)),
2706 CORE_ADDR high = procaddr + sh.value;
2711 || procaddr < pst->raw_text_low ()))
2717 else if (sh.st == stStatic)
2732 namestring =
debug_info->ss + fh->issBase + sh.iss;
2741 namestring =
debug_info->ss + fh->issBase + sh.iss;
2752 char *stabstring =
debug_info->ss + fh->issBase + sh.iss;
2755 gdb::unique_xmalloc_ptr<char> stabstring_storage;
2756 int len = strlen (stabstring);
2758 while (stabstring[len - 1] ==
'\\')
2761 char *stabstring1 = stabstring;
2773 * external_sym_size),
2775 stabstring2 =
debug_info->ss + fh->issBase + sh2.iss;
2776 len2 = strlen (stabstring2);
2779 if (stabstring_storage !=
nullptr)
2781 stabstring_storage.reset
2782 ((
char *)
xrealloc (stabstring_storage.release (),
2784 stabstring = stabstring_storage.get ();
2788 stabstring_storage.reset
2789 ((
char *)
xmalloc (len + len2 + 1));
2790 stabstring = stabstring_storage.get ();
2791 strcpy (stabstring, stabstring1);
2793 strcpy (stabstring + len, stabstring2);
2803 case N_TEXT | N_EXT:
2804 case N_NBTEXT | N_EXT:
2807 case N_DATA | N_EXT:
2808 case N_NBDATA | N_EXT:
2813 case N_NBBSS | N_EXT:
2814 case N_SETV | N_EXT:
2839 case N_UNDF | N_EXT:
2858 case N_INDR | N_EXT:
2860 case N_SETA | N_EXT:
2862 case N_SETT | N_EXT:
2864 case N_SETD | N_EXT:
2866 case N_SETB | N_EXT:
2876 static int prev_so_symnum = -10;
2877 const char *basename;
2885 textlow_not_set = 1;
2887 textlow_not_set = 0;
2889 if (prev_so_symnum !=
symnum - 1)
2895 dependencies_used = 0;
2905 namestring = stabstring;
2909 if (*namestring ==
'\000')
2917 basename = lbasename (namestring);
2918 if (basename != namestring && *basename ==
'\000')
2942 namestring = stabstring;
2975 for (i = 0; i < includes_used; i++)
2976 if (filename_cmp (namestring,
2977 psymtab_include_list[i]) == 0)
2986 psymtab_include_list[includes_used++] = namestring;
2987 if (includes_used >= includes_allocated)
2989 const char **orig = psymtab_include_list;
2991 psymtab_include_list = (
const char **)
2992 alloca ((includes_allocated *= 2) *
2993 sizeof (
const char *));
2994 memcpy (psymtab_include_list, orig,
2995 includes_used *
sizeof (
const char *));
3019 namestring = stabstring;
3020 p = (
char *) strchr (namestring,
':');
3067 if (p >= namestring + 2
3068 || (p == namestring + 1
3069 && namestring[0] !=
' '))
3072 (gdb::string_view (namestring, p - namestring),
3080 (gdb::string_view (namestring,
3091 if (p != namestring)
3095 (gdb::string_view (namestring,
3120 while ((*p >=
'0' && *p <=
'9')
3121 || *p ==
'(' || *p ==
',' || *p ==
')'
3144 while (*p && *p !=
';' && *p !=
',')
3150 if (*p ==
'\\' || (*p ==
'?' && p[1] ==
'\0'))
3155 for (q = p; *q && *q !=
':'; q++)
3170 while (*p && *p !=
',')
3191 std::string copy (namestring, p);
3212 std::string copy (namestring, p);
3266 complaint (_(
"unknown symbol descriptor `%c'"), p[1]);
3287 dependencies_used = 0;
3344 CORE_ADDR minsym_value;
3350 * external_sym_size)),
3353 if (ECOFF_IS_STAB (&sh))
3361 || (sh.index == indexNil
3362 && (sh.st != stStatic || sh.sc == scAbs)))
3369 sym_name =
debug_info->ss + fh->issBase + sh.iss;
3371 minsym_value = sh.value;
3410 if (sh.index >= hdr->iauxMax)
3418 new_sdx = AUX_GET_ISYM (fh->fBigendian,
3426 complaint (_(
"bad proc end in aux found from symbol %s"),
3438 if (sh.st == stProc && sh.sc != scText)
3452 if (sh.st == stProc)
3467 procaddr = sh.value;
3472 + ((fh->isymBase +
cur_sdx - 1)
3473 * external_sym_size)),
3481 || procaddr < pst->raw_text_low ()))
3484 high = procaddr + sh.value;
3523 if ((sh.sc == scInfo
3535 pst, fh, sh.st, sh.value);
3542 complaint (_(
"bad aux index at block symbol %s"),
3563 complaint (_(
"unknown local symbol %s"),
3581 cur_sdx = fdr_to_pst[f_idx].n_globals;
3591 gdb_assert (
ext_ptr->ifd == f_idx);
3599 svalue = psh->value;
3648 char *sym_name =
debug_info->ssext + psh->iss;
3660 fdr_to_pst[f_idx].
pst
3662 psymtab_include_list, includes_used,
3664 dependency_list, dependencies_used,
3667 dependencies_used = 0;
3680 save_pst = fdr_to_pst[f_idx].
pst;
3681 if (save_pst != NULL
3687 if (save_pst != iter
3700 for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
3703 pst = fdr_to_pst[f_idx].
pst;
3717 for (s_idx = 1; s_idx < fh->crfd; s_idx++)
3723 + (fh->rfdBase + s_idx) * external_rfd_size),
3725 if (rh < 0 || rh >= hdr->ifdMax)
3727 complaint (_(
"bad file number %ld"), rh);
3736 if (fdr_to_pst[rh].
pst == NULL)
3739 = fdr_to_pst[rh].
pst;
3746 if (pst_del->
next == NULL
3748 && pst_del->
empty ())
3759 FDR *fh,
int stype, CORE_ADDR svalue)
3761 const bfd_size_type external_sym_size =
debug_swap->external_sym_size;
3762 void (*
const swap_sym_in) (bfd *,
void *, SYMR *) =
debug_swap->swap_sym_in;
3763 char *ext_sym = ((
char *)
debug_info->external_sym
3764 + ((fh->isymBase +
cur_sdx + 1) * external_sym_size));
3781 (*swap_sym_in) (
cur_bfd, ext_sym, &sh);
3782 if (sh.st != stMember)
3785 if (sh.index == indexNil
3786 || (sh.index == 0 && svalue == 0))
3790 + fh->iauxBase + sh.index)->a_ti,
3792 if ((tir.bt != btNil
3794 && (tir.bt != btEnum || svalue != 0))
3795 || tir.tq0 != tqNil)
3807 (*swap_sym_in) (
cur_bfd, ext_sym, &sh);
3808 if (sh.st != stMember)
3818 ext_sym += external_sym_size;
3851 bfd_size_type external_sym_size;
3852 bfd_size_type external_pdr_size;
3853 void (*swap_sym_in) (bfd *,
void *, SYMR *);
3854 void (*swap_pdr_in) (bfd *,
void *, PDR *);
3859 CORE_ADDR lowest_pdr_addr = 0;
3860 int last_symtab_ended = 0;
3883 external_sym_size =
debug_swap->external_sym_size;
3884 external_pdr_size =
debug_swap->external_pdr_size;
3896 if (fh != NULL && fh->csym >= 2)
3902 + (fh->isymBase + 1) * external_sym_size),
3904 if (strcmp (
debug_info->ss + fh->issBase + sh.iss,
3934 + (fh->isymBase +
cur_sdx) * external_sym_size),
3939 if (ECOFF_IS_STAB (&sh) || (
name[0] ==
'#'))
3941 int type_code = ECOFF_UNMARK_STAB (sh.index);
3963 last_symtab_ended = 1;
3967 last_symtab_ended = 0;
3973 else if (
name[0] ==
'#')
3991 e->
pdr.framereg = -1;
3995 else if (sh.st == stLabel)
3997 if (sh.index == indexNil)
4011 else if (sh.st == stProc || sh.st == stStaticProc
4012 || sh.st == stStatic || sh.st == stEnd)
4019 if (! last_symtab_ended)
4040 gdb::def_vector<PDR> pr_block (fh->cpd);
4043 + fh->ipdFirst * external_pdr_size);
4044 pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
4045 pdr_in = pr_block.data ();
4048 pdr_ptr += external_pdr_size, pdr_in++)
4050 (*swap_pdr_in) (
cur_bfd, pdr_ptr, pdr_in);
4054 if (pdr_in == pr_block.data ())
4055 lowest_pdr_addr = pdr_in->adr;
4056 else if (pdr_in->adr < lowest_pdr_addr)
4057 lowest_pdr_addr = pdr_in->adr;
4060 pdr_in = pr_block.data ();
4061 pdr_in_end = pdr_in + fh->cpd;
4062 for (; pdr_in < pdr_in_end; pdr_in++)
4080 maxlines = 2 * fh->cline;
4113 + fh->isymBase * external_sym_size);
4114 sym_end = sym_ptr + fh->csym * external_sym_size;
4115 while (sym_ptr < sym_end)
4120 (*swap_sym_in) (
cur_bfd, sym_ptr, &sh);
4123 sym_ptr, fh->fBigendian,
4125 sym_ptr += c * external_sym_size;
4138 gdb::def_vector<PDR> pr_block (fh->cpd);
4141 + fh->ipdFirst * external_pdr_size);
4142 pdr_end = pdr_ptr + fh->cpd * external_pdr_size;
4143 pdr_in = pr_block.data ();
4146 pdr_ptr += external_pdr_size, pdr_in++)
4148 (*swap_pdr_in) (
cur_bfd, pdr_ptr, pdr_in);
4152 if (pdr_in == pr_block.data ())
4153 lowest_pdr_addr = pdr_in->adr;
4154 else if (pdr_in->adr < lowest_pdr_addr)
4155 lowest_pdr_addr = pdr_in->adr;
4158 parse_lines (fh, pr_block.data (), lines, maxlines,
4160 if (lines->
nitems < fh->cline)
4164 pdr_in = pr_block.data ();
4165 pdr_in_end = pdr_in + fh->cpd;
4166 for (; pdr_in < pdr_in_end; pdr_in++)
4199 gdb_printf (_(
"File %s contains %d unresolved references:"),
4204 "procedures\n\t%4d labels\n",
4233 if (sh->index == indexNil)
4236 ax =
debug_info->external_aux + fh->iauxBase + sh->index;
4237 (*
debug_swap->swap_tir_in) (fh->fBigendian, &ax->a_ti, &tir);
4238 if (tir.bt != btStruct && tir.bt != btUnion && tir.bt != btEnum)
4242 (*
debug_swap->swap_rndx_in) (fh->fBigendian, &ax->a_rndx, rn);
4243 if (rn->rfd == 0xfff)
4244 rf = AUX_GET_ISYM (fh->fBigendian, ax + 1);
4261 const char **pname,
int bigend,
const char *sym_name)
4274 (*
debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
4277 if (rn->rfd == 0xfff)
4280 rf = AUX_GET_ISYM (bigend, ax + 1);
4292 *pname =
"<undefined>";
4294 (*tpp)->set_is_stub (
true);
4301 if (rn->rfd == 0xfff && rn->index == 0)
4303 *pname =
"<undefined>";
4311 if (rn->index >= fh->csym)
4314 *pname =
"<illegal>";
4326 + ((fh->isymBase + rn->index)
4331 if ((sh.sc != scInfo
4332 || (sh.st != stBlock && sh.st != stTypedef && sh.st != stIndirect
4333 && sh.st != stStruct && sh.st != stUnion
4334 && sh.st != stEnum))
4338 *pname =
"<illegal>";
4343 *pname =
debug_info->ss + fh->issBase + sh.iss;
4352 if ((sh.iss == 0 && sh.st == stTypedef) || sh.st == stIndirect)
4372 + fh->iauxBase + sh.index)->a_ti,
4374 if (tir.tq0 != tqNil)
4375 complaint (_(
"illegal tq0 in forward typedef for %s"), sym_name);
4380 *pname =
"<undefined>";
4388 + fh->iauxBase + sh.index + 1),
4390 fh->fBigendian, sym_name);
4411 complaint (_(
"illegal bt %d in forward typedef for %s"), tir.bt,
4418 else if (sh.st == stTypedef)
4467 && sym->
aclass () == theclass
4501 *
sizeof (
struct block)));
4537 lt->item[
lt->nitems].line = lineno;
4538 lt->item[
lt->nitems++].pc = adr << 2;
4549 CORE_ADDR start1 = b1->
start ();
4550 CORE_ADDR start2 = b2->
start ();
4552 if (start1 != start2)
4553 return start1 < start2;
4555 return (b2->
end ()) < (b1->
end ());
4587 gdb::array_view<block *> blocks_view = bv->
blocks ();
4598 if (high < bv->
block (i)->end ())
4694 * sizeof (
lt->item))));
4717static struct block *
4765 const struct ecoff_debug_swap *swap, asection *sec)
4768 struct ecoff_debug_info *info;
4778 if (!(*swap->read_debug_info) (abfd, sec, info))
4779 error (_(
"Error reading ECOFF debugging information: %s"),
4780 bfd_errmsg (bfd_get_error ()));
void * xrealloc(void *ptr, size_t size)
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
struct compunit_symtab * end_compunit_symtab(CORE_ADDR end_addr, int section)
struct subfile * get_current_subfile()
void set_last_source_file(const char *name)
void record_line(struct subfile *subfile, int line, CORE_ADDR pc)
const char * get_last_source_file()
struct pending ** get_local_symbols()
void add_symbol_to_list(struct symbol *symbol, struct pending **listhead)
void record_with_info(const char *name, CORE_ADDR address, enum minimal_symbol_type ms_type, int section)
struct partial_symtab * psymtabs
void discard_psymtab(struct partial_symtab *pst)
partial_symtab_range range()
struct partial_symtab ** allocate_dependencies(int number)
void set(unsigned key, void *datum)
#define complaint(FMT,...)
void free_header_files(void)
void init_header_files(void)
void process_one_symbol(int type, int desc, CORE_ADDR valu, const char *name, const section_offsets §ion_offsets, struct objfile *objfile, enum language language)
legacy_psymtab * dbx_end_psymtab(struct objfile *objfile, psymtab_storage *partial_symtabs, legacy_psymtab *pst, const char **include_list, int num_includes, int capping_symbol_offset, CORE_ADDR capping_text, legacy_psymtab **dependency_list, int number_dependencies, int textlow_not_set)
struct multidictionary * mdict_create_hashed_expandable(enum language language)
struct multidictionary * mdict_create_linear_expandable(enum language language)
void mdict_add_symbol(struct multidictionary *mdict, struct symbol *sym)
bool is_cplus_marker(int c)
int gdbarch_sofun_address_maybe_missing(struct gdbarch *gdbarch)
int gdbarch_ecoff_reg_to_regnum(struct gdbarch *gdbarch, int ecoff_regnr)
int gdbarch_int_bit(struct gdbarch *gdbarch)
int gdbarch_float_bit(struct gdbarch *gdbarch)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_double_format(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
const struct floatformat ** gdbarch_float_format(struct gdbarch *gdbarch)
int gdbarch_double_bit(struct gdbarch *gdbarch)
static int gdbarch_num_cooked_regs(gdbarch *arch)
struct type * make_pointer_type(struct type *type, struct type **typeptr)
struct type * lookup_pointer_type(struct type *type)
struct type * init_type(struct objfile *objfile, enum type_code code, int bit, const char *name)
struct type * lookup_function_type(struct type *type)
struct type * create_array_type(struct type *result_type, struct type *element_type, struct type *range_type)
struct type * init_pointer_type(struct objfile *objfile, int bit, const char *name, struct type *target_type)
struct type * alloc_type(struct objfile *objfile)
struct type * init_complex_type(const char *name, struct type *target_type)
struct type * init_float_type(struct objfile *objfile, int bit, const char *name, const struct floatformat **floatformats, enum bfd_endian byte_order)
struct type * create_static_range_type(struct type *result_type, struct type *index_type, LONGEST low_bound, LONGEST high_bound)
struct type * init_integer_type(struct objfile *objfile, int bit, int unsigned_p, const char *name)
#define TYPE_ZALLOC(t, size)
#define TYPE_FIELD_ARTIFICIAL(thistype, n)
#define INIT_CPLUS_SPECIFIC(type)
#define TYPE_ALLOC(t, size)
#define FIELD_BITSIZE(thisfld)
static struct linetable * new_linetable(int)
static struct linetable * shrink_linetable(struct linetable *)
static void add_block(struct block *, struct symtab *)
static int found_ecoff_debugging_info
static void unknown_ext_complaint(const char *arg1)
static void bad_rfd_entry_complaint(const char *arg1, int arg2, int arg3)
static struct ecoff_debug_info * debug_info
static int upgrade_type(int, struct type **, int, union aux_ext *, int, const char *)
static void index_complaint(const char *arg1)
static const struct ecoff_debug_swap * debug_swap
static struct objfile * mdebugread_objfile
static struct parse_stack * top_stack
static int mdebug_register_index
static struct blockvector * new_bvect(int)
static char stabs_symbol[]
static void bad_tag_guess_complaint(const char *arg1)
static struct symbol * mylookup_symbol(const char *, const struct block *, domain_enum, enum address_class)
static struct type * basic_type(int bt, struct objfile *objfile)
static void push_parse_stack(void)
static struct mdebug_pending * is_pending_symbol(FDR *fh, char *sh)
static FDR * get_rfd(int cf, int rf)
static enum language psymtab_language
static struct mdebug_pending ** pending_list
void _initialize_mdebugread()
static void parse_partial_symbols(minimal_symbol_reader &, psymtab_storage *, struct objfile *)
static void mdebug_expand_psymtab(legacy_psymtab *pst, struct objfile *objfile)
static void add_symbol(struct symbol *, struct symtab *, struct block *)
static int mdebug_regparm_index
static void parse_procedure(PDR *pr, struct compunit_symtab *search_symtab, legacy_psymtab *pst)
#define ECOFF_IN_ELF(bfd)
void mdebug_build_psymtabs(minimal_symbol_reader &reader, struct objfile *objfile, const struct ecoff_debug_swap *swap, struct ecoff_debug_info *info)
static void basic_type_complaint(int arg1, const char *arg2)
static int mdebug_reg_to_regnum(struct symbol *sym, struct gdbarch *gdbarch)
static void mdebug_read_symtab(legacy_psymtab *self, struct objfile *objfile)
static legacy_psymtab * new_psymtab(const char *, psymtab_storage *, struct objfile *)
static int add_line(struct linetable *, int, CORE_ADDR, int)
static void record_minimal_symbol(minimal_symbol_reader &reader, const char *name, const CORE_ADDR address, enum minimal_symbol_type ms_type, int storage_class, struct objfile *objfile)
static void sort_blocks(struct symtab *)
static int parse_symbol(SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, const section_offsets §ion_offsets, struct objfile *objfile)
static struct type * new_type(char *)
static void unexpected_type_code_complaint(const char *arg1)
static int n_undef_labels
static void add_pending(FDR *fh, char *sh, struct type *t)
static int n_undef_symbols
static int has_opaque_xref(FDR *, SYMR *)
static void reg_value_complaint(int regnum, int num_regs, const char *sym)
static void parse_lines(FDR *fh, PDR *pr, struct linetable *lt, int maxlines, CORE_ADDR textlow, CORE_ADDR lowest_pdr_addr)
static const registry< objfile >::key< struct type *, gdb::noop_deleter< struct type * > > basic_type_data
static const struct symbol_register_ops mdebug_register_funcs
static struct symbol * new_symbol(const char *)
static void function_outside_compilation_unit_complaint(const char *arg1)
static int cross_ref(int, union aux_ext *, struct type **, enum type_code, const char **, int, const char *)
static bool block_is_less_than(const struct block *b1, const struct block *b2)
static void parse_external(EXTR *es, int bigend, const section_offsets §ion_offsets, struct objfile *objfile)
#define compare_glevel(a, b)
static void handle_psymbol_enumerators(struct objfile *, psymtab_storage *, partial_symtab *, FDR *, int, CORE_ADDR)
static struct compunit_symtab * new_symtab(const char *, int, struct objfile *)
static void add_data_symbol(SYMR *sh, union aux_ext *ax, int bigend, struct symbol *s, int aclass_index, struct block *b, struct objfile *objfile, const char *name)
static const char * fdr_name(FDR *f)
static struct block * new_block(enum block_type, enum language)
void elfmdebug_build_psymtabs(struct objfile *objfile, const struct ecoff_debug_swap *swap, asection *sec)
static const char * mdebug_next_symbol_text(struct objfile *)
static void pop_parse_stack(void)
#define MDEBUG_EFI_SYMBOL_NAME
#define SECT_OFF_BSS(objfile)
#define SECT_OFF_DATA(objfile)
#define SECT_OFF_TEXT(objfile)
const char * symtab_to_filename_for_display(struct symtab *symtab)
struct symbol * global_sym_chain[HASHSIZE]
void stabsread_new_init(void)
int hashname(const char *name)
void scan_file_globals(struct objfile *objfile)
const char *(* next_symbol_text_func)(struct objfile *)
unsigned char processing_gcc_compilation
#define next_symbol_text(objfile)
const block * superblock() const
multidictionary * multidict() const
void set_start(CORE_ADDR start)
void set_multidict(multidictionary *multidict)
void set_end(CORE_ADDR end)
void set_superblock(const block *superblock)
void set_function(symbol *function)
struct block * block(size_t i)
struct block * static_block()
gdb::array_view< struct block * > blocks()
void set_block(int i, struct block *block)
struct block * global_block()
void set_num_blocks(int num_blocks)
symtab * primary_filetab() const
enum language language() const
void set_blockvector(struct blockvector *blockvector)
struct blockvector * blockvector()
void set_debugformat(const char *debugformat)
void set_const_val(LONGEST const_val)
void set_type(struct type *type)
const char * print_name() const
void compute_and_set_names(gdb::string_view linkage_name, bool copy_name, struct objfile_per_bfd_storage *per_bfd, gdb::optional< hashval_t > hash=gdb::optional< hashval_t >())
enum language language() const
void set_language(enum language language, struct obstack *obstack)
const char * linkage_name() const
void set_linkage_name(const char *linkage_name)
void expand_psymtab(struct objfile *objf) override
void * read_symtab_private
void(* legacy_expand_psymtab)(legacy_psymtab *, struct objfile *)
void(* legacy_read_symtab)(legacy_psymtab *, struct objfile *)
struct linetable_entry item[1]
const struct ecoff_debug_swap * debug_swap
struct ecoff_debug_info * debug_info
struct mdebug_pending ** pending_list
enum language pst_language
struct mdebug_pending * next
struct type * builtin_int
struct type * builtin_void
struct type * nodebug_text_symbol
struct gdbarch * arch() const
struct objfile_per_bfd_storage * per_bfd
auto_obstack objfile_obstack
std::forward_list< quick_symbol_functions_up > qf
::section_offsets section_offsets
struct parse_stack * prev
struct parse_stack * next
struct partial_symtab ** dependencies
unsigned int text_low_valid
CORE_ADDR raw_text_low() const
unsigned int text_high_valid
void set_text_low(CORE_ADDR addr)
int number_of_dependencies
struct partial_symtab * next
void expand_dependencies(struct objfile *)
void add_psymbol(gdb::string_view name, bool copy_name, domain_enum domain, enum address_class theclass, short section, psymbol_placement where, CORE_ADDR coreaddr, enum language language, psymtab_storage *partial_symtabs, struct objfile *objfile)
CORE_ADDR raw_text_high() const
void set_text_high(CORE_ADDR addr)
CORE_ADDR text_low(struct objfile *objfile) const
const std::shared_ptr< psymtab_storage > & get_partial_symtabs() const
struct compunit_symtab * compunit_symtab
const block * value_block() const
address_class aclass() const
struct type * type() const
void set_value_block(const block *block)
domain_enum domain() const
void set_aclass_index(unsigned int aclass_index)
LONGEST value_longest() const
const gdb_byte * value_bytes() const
void set_type(struct type *type)
void set_is_argument(bool is_argument)
void set_value_address(CORE_ADDR address)
void set_value_bytes(const gdb_byte *bytes)
void set_value_longest(LONGEST value)
void set_value_chain(symbol *sym)
void set_domain(domain_enum domain)
void set_symtab(struct symtab *symtab)
enum language language() const
void set_linetable(struct linetable *linetable)
struct compunit_symtab * compunit() const
struct linetable * linetable() const
void set_language(enum language language)
struct type * target_type() const
void set_is_prototyped(bool is_prototyped)
void set_code(type_code code)
struct field & field(int idx) const
void set_has_no_signedness(bool has_no_signedness)
void set_is_unsigned(bool is_unsigned)
void set_is_stub(bool is_stub)
void set_bounds(range_bounds *bounds)
void set_num_fields(int num_fields)
void set_name(const char *name)
void set_length(ULONGEST length)
range_bounds * bounds() const
const char * name() const
void set_fields(struct field *fields)
void set_target_is_stub(bool target_is_stub)
enum language deduce_language_from_filename(const char *filename)
int get_section_index(struct objfile *objfile, const char *section_name)
void add_compunit_symtab_to_objfile(struct compunit_symtab *cu)
struct symtab * allocate_symtab(struct compunit_symtab *cust, const char *filename, const char *filename_for_id)
struct compunit_symtab * allocate_compunit_symtab(struct objfile *objfile, const char *name)
int register_symbol_register_impl(enum address_class aclass, const struct symbol_register_ops *ops)
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
std::vector< CORE_ADDR > section_offsets
void gdb_printf(struct ui_file *stream, const char *format,...)