36 #include "filenames.h"
51 #include <sys/types.h>
115 #define DEFAULT_SYMBOL_CACHE_SIZE 1021
120 #define MAX_SYMBOL_CACHE_SIZE (1024*1024)
124 #define SYMBOL_LOOKUP_FAILED ((struct symbol *) 1)
315 int len = strlen (filename);
316 size_t search_len = strlen (search_name);
318 if (len < search_len)
322 if (FILENAME_CMP (filename + len - search_len, search_name) != 0)
338 return (len == search_len
339 || (!IS_ABSOLUTE_PATH (search_name)
340 && IS_DIR_SEPARATOR (filename[len - search_len - 1]))
341 || (HAS_DRIVE_SPEC (filename)
342 && STRIP_DRIVE_SPEC (filename) == &filename[len - search_len]));
362 const char *real_path,
371 const char* base_name = lbasename (name);
373 for (cust = first; cust != NULL && cust != after_last; cust = cust->
next)
379 if (callback (s, data))
386 if (! basenames_may_differ
387 && FILENAME_CMP (base_name, lbasename (s->
filename)) != 0)
392 if (callback (s, data))
399 if (real_path != NULL)
405 if (FILENAME_CMP (real_path, fullname) == 0)
407 if (callback (s, data))
431 struct objfile *objfile;
432 char *real_path = NULL;
437 if (IS_ABSOLUTE_PATH (name))
479 struct symtab **result_ptr = data;
481 *result_ptr = symtab;
491 struct symtab *result = NULL;
506 int mangled_name_len;
509 struct fn_field *method = &f[signature_id];
516 int is_full_physname_constructor;
521 char *const_prefix = method->
is_const ?
"C" :
"";
522 char *volatile_prefix = method->
is_volatile ?
"V" :
"";
524 int len = (newname == NULL ? 0 : strlen (newname));
528 if ((physname[0] ==
'_' && physname[1] ==
'Z')
530 return xstrdup (physname);
534 is_constructor = is_full_physname_constructor
535 || (newname && strcmp (field_name, newname) == 0);
538 is_destructor = (
startswith (physname,
"__dt"));
540 if (is_destructor || is_full_physname_constructor)
542 mangled_name = (
char *)
xmalloc (strlen (physname) + 1);
543 strcpy (mangled_name, physname);
549 xsnprintf (buf,
sizeof (buf),
"__%s%s", const_prefix, volatile_prefix);
551 else if (physname[0] ==
't' || physname[0] ==
'Q')
555 xsnprintf (buf,
sizeof (buf),
"__%s%s", const_prefix, volatile_prefix);
561 xsnprintf (buf,
sizeof (buf),
"__%s%s%d", const_prefix,
562 volatile_prefix, len);
564 mangled_name_len = ((is_constructor ? 0 : strlen (field_name))
565 + strlen (buf) + len + strlen (physname) + 1);
567 mangled_name = (
char *)
xmalloc (mangled_name_len);
569 mangled_name[0] =
'\0';
571 strcpy (mangled_name, field_name);
573 strcat (mangled_name, buf);
578 strcat (mangled_name, newname);
580 strcat (mangled_name, physname);
581 return (mangled_name);
590 struct obstack *obstack)
631 struct obstack *obstack)
671 return htab_hash_string (e->
mangled);
722 if (demangled != NULL)
733 if (demangled != NULL)
743 DMGL_PARAMS | DMGL_ANSI | DMGL_JAVA);
744 if (demangled != NULL)
754 if (demangled != NULL)
769 if (demangled != NULL)
788 if (demangled != mangled && demangled != NULL && demangled[0] !=
'<')
847 #define JAVA_PREFIX "##JAVA$$"
848 #define JAVA_PREFIX_LEN 8
853 struct objfile *objfile)
857 const char *linkage_name_copy;
860 const char *lookup_name;
877 gsymbol->
name = linkage_name;
882 memcpy (name, linkage_name, len);
902 alloc_name = alloca (lookup_len + 1);
904 memcpy (alloc_name + JAVA_PREFIX_LEN, linkage_name, len);
905 alloc_name[lookup_len] =
'\0';
907 lookup_name = alloc_name;
910 else if (linkage_name[len] !=
'\0')
915 alloc_name = alloca (lookup_len + 1);
916 memcpy (alloc_name, linkage_name, len);
917 alloc_name[lookup_len] =
'\0';
919 lookup_name = alloc_name;
920 linkage_name_copy = alloc_name;
925 lookup_name = linkage_name;
926 linkage_name_copy = linkage_name;
939 && (*slot)->demangled[0] ==
'\0'))
943 int demangled_len = demangled_name ? strlen (demangled_name) : 0;
954 if (!copy_name && lookup_name == linkage_name)
959 + demangled_len + 1);
960 (*slot)->mangled = lookup_name;
972 + lookup_len + demangled_len + 2);
973 mangled_ptr = &((*slot)->demangled[demangled_len + 1]);
974 strcpy (mangled_ptr, lookup_name);
975 (*slot)->mangled = mangled_ptr;
978 if (demangled_name != NULL)
980 strcpy ((*slot)->demangled, demangled_name);
981 xfree (demangled_name);
984 (*slot)->demangled[0] =
'\0';
987 gsymbol->
name = (*slot)->mangled + lookup_len -
len;
988 if ((*slot)->demangled[0] !=
'\0')
1017 return gsymbol->
name;
1026 const char *dem_name = NULL;
1056 return gsymbol->
name;
1066 memset (sal, 0,
sizeof (*sal));
1080 struct objfile *obj;
1083 if (first == second)
1087 if (first == NULL || second == NULL)
1091 if (first->owner == NULL || second->owner == NULL)
1095 if (first->owner == second->owner)
1102 if (bfd_get_section_size (first) != bfd_get_section_size (second))
1106 if (bfd_get_section_vma (first->owner, first)
1107 - bfd_get_start_address (first->owner)
1108 != bfd_get_section_vma (second->owner, second)
1109 - bfd_get_start_address (second->owner))
1112 if (bfd_get_section_name (first->owner, first) == NULL
1113 || bfd_get_section_name (second->owner, second) == NULL
1114 || strcmp (bfd_get_section_name (first->owner, first),
1115 bfd_get_section_name (second->owner, second)) != 0)
1121 if (obj->
obfd == first->owner)
1140 struct objfile *objfile;
1173 unsigned int hash = (uintptr_t) objfile_context;
1176 hash += htab_hash_string (name);
1192 const struct objfile *objfile_context,
1195 const char *slot_name;
1216 if (slot_name == NULL && name == NULL)
1220 if (slot_domain != domain)
1223 else if (slot_name != NULL && name != NULL)
1236 if (strcmp (slot_name, name) != 0)
1238 if (slot_domain != domain)
1248 slot_domain, domain))
1332 struct symbol_cache *cache = program_space_data (pspace, symbol_cache_key);
1337 set_program_space_data (pspace, symbol_cache_key, cache);
1364 = program_space_data (pspace, symbol_cache_key);
1384 error (
_(
"Symbol cache size is too large, max is %u."),
1403 struct objfile *objfile_context,
int block,
1428 if (symbol_lookup_debug)
1430 "%s block symbol cache hit%s for %s, %s\n",
1433 ?
" (not found)" :
"",
1446 if (symbol_lookup_debug)
1449 "%s block symbol cache miss for %s, %s\n",
1518 struct symbol_cache *cache = program_space_data (pspace, symbol_cache_key);
1541 for (pass = 0; pass < 2; ++pass)
1547 for (i = 0; i < bsc->
size; ++i)
1572 for (pass = 0; pass < 2; ++pass)
1583 for (i = 0; i < bsc->
size; ++i)
1589 switch (slot->
state)
1625 :
"(no object file)");
1628 cache = program_space_data (pspace, symbol_cache_key);
1662 for (pass = 0; pass < 2; ++pass)
1696 :
"(no object file)");
1699 cache = program_space_data (pspace, symbol_cache_key);
1729 CORE_ADDR addr,
struct objfile *objfile)
1823 if (objfile == NULL)
1873 const char **result_name)
1875 char *demangled_name = NULL;
1876 const char *modified_name = NULL;
1879 modified_name =
name;
1885 demangled_name =
gdb_demangle (name, DMGL_ANSI | DMGL_PARAMS);
1888 modified_name = demangled_name;
1898 modified_name = demangled_name;
1906 DMGL_ANSI | DMGL_PARAMS | DMGL_JAVA);
1909 modified_name = demangled_name;
1918 modified_name = demangled_name;
1927 modified_name = demangled_name;
1932 *result_name = modified_name;
1953 const char *modified_name;
1954 struct symbol *returnval;
1958 is_a_field_of_this);
1973 is_a_field_of_this);
1985 if (symbol_lookup_debug > 1)
1990 "lookup_language_this (%s, %s (objfile %s))",
2002 if (symbol_lookup_debug > 1)
2009 block_found = block;
2017 if (symbol_lookup_debug > 1)
2039 if (t_field_name && (
strcmp_iw (t_field_name, name) == 0))
2078 if (symbol_lookup_debug)
2083 "lookup_symbol_aux (%s, %s (objfile %s), %s, %s)\n",
2101 if (is_a_field_of_this != NULL)
2102 memset (is_a_field_of_this, 0,
sizeof (*is_a_field_of_this));
2110 if (symbol_lookup_debug)
2143 error (
_(
"Internal error: `%s' is not an aggregate"),
2148 if (symbol_lookup_debug)
2151 "lookup_symbol_aux (...) = NULL\n");
2164 if (symbol_lookup_debug)
2176 if (symbol_lookup_debug)
2198 if (static_block == NULL)
2201 while (block != static_block)
2230 struct objfile *obj;
2259 if (symbol_lookup_debug > 1)
2264 "lookup_symbol_in_block (%s, %s (objfile %s), %s)",
2273 if (symbol_lookup_debug > 1)
2278 block_found = block;
2282 if (symbol_lookup_debug > 1)
2294 struct objfile *objfile;
2296 for (objfile = main_objfile;
2323 if (symbol_lookup_debug > 1)
2326 "lookup_symbol_in_objfile_symtabs (%s, %s, %s, %s)",
2329 ?
"GLOBAL_BLOCK" :
"STATIC_BLOCK",
2344 if (symbol_lookup_debug > 1)
2350 block_found = block;
2355 if (symbol_lookup_debug > 1)
2371 const char *linkage_name,
2375 const char *modified_name;
2378 struct objfile *main_objfile, *cur_objfile;
2383 main_objfile = objfile;
2385 for (cur_objfile = main_objfile;
2392 modified_name, domain);
2395 modified_name, domain);
2410 static void ATTRIBUTE_NORETURN
2415 Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n\
2416 %s may be an inlined function, or may be a template function\n \
2417 (if a template, try specifying an instantiation: %s<type>)."),
2439 if (symbol_lookup_debug > 1)
2442 "lookup_symbol_via_quick_fns (%s, %s, %s, %s)\n",
2445 ?
"GLOBAL_BLOCK" :
"STATIC_BLOCK",
2452 if (symbol_lookup_debug > 1)
2455 "lookup_symbol_via_quick_fns (...) = NULL\n");
2466 if (symbol_lookup_debug > 1)
2469 "lookup_symbol_via_quick_fns (...) = %s (block %s)\n",
2474 block_found = block;
2556 if (static_block == NULL)
2559 if (symbol_lookup_debug)
2564 "lookup_symbol_in_static_block (%s, %s (objfile %s),"
2573 if (symbol_lookup_debug)
2576 "lookup_symbol_in_static_block (...) = %s\n",
2593 if (symbol_lookup_debug)
2596 "lookup_symbol_in_objfile (%s, %s, %s, %s)\n",
2599 ?
"GLOBAL_BLOCK" :
"STATIC_BLOCK",
2607 if (symbol_lookup_debug)
2610 "lookup_symbol_in_objfile (...) = %s"
2619 if (symbol_lookup_debug)
2622 "lookup_symbol_in_objfile (...) = %s%s\n",
2626 result != NULL ?
" (via quick fns)" :
"");
2637 struct objfile *objfile;
2703 return (data->
result != NULL);
2715 struct objfile *objfile;
2734 if (objfile != NULL)
2740 memset (&lookup_data, 0,
sizeof (lookup_data));
2746 sym = lookup_data.
result;
2775 return (symbol_domain == domain);
2789 static struct type *
2819 static struct type *
2826 const struct symbol *sym;
2856 struct objfile *objfile;
2900 return (
struct type *) 0;
2925 if (!callback (sym, data))
2939 struct objfile *objfile;
3006 struct symbol *sym = NULL;
3024 if (best_cust != NULL)
3091 struct symtab *best_symtab = 0;
3169 if (msymbol.
minsym != NULL)
3176 if (mfunsym.
minsym == NULL)
3240 if (item->
pc > pc && (!alt || item->
pc < alt->
pc))
3243 for (i = 0; i <
len; i++, item++)
3263 if (prev && prev->
line && (!best || prev->
pc > best->
pc))
3266 best_symtab = iter_s;
3269 if (best_end <= best->pc)
3276 if (best && i < len && item->pc > best->
pc
3277 && (best_end == 0 || best_end > item->
pc))
3278 best_end = item->
pc;
3289 else if (best->
line == 0)
3298 val.
symtab = best_symtab;
3301 if (best_end && (!alt || best_end < alt->pc))
3350 int *index,
int *exact_match)
3359 struct symtab *best_symtab;
3363 best_symtab = symtab;
3365 if (best_index < 0 || !exact)
3379 struct objfile *objfile;
3383 if (best_index >= 0)
3384 best = best_linetable->
item[best_index].
line;
3416 if (best == 0 || l->
item[ind].
line < best)
3431 *index = best_index;
3433 *exact_match = exact;
3464 if (*best_item == NULL || item->
line < (*best_item)->line)
3532 *startptr = found_sal.
pc;
3533 *endptr = found_sal.
pc;
3537 *startptr = found_sal.
pc;
3538 *endptr = found_sal.
end;
3552 int *exact_match,
int start)
3561 int best_index = -1;
3572 for (i = start; i <
len; i++)
3576 if (item->
line == lineno)
3583 if (item->
line > lineno && (best == 0 || item->
line < best))
3602 return sal.symtab != 0;
3622 if (funfirstline && sal.
symtab != NULL
3674 for (i = 0; i < l->
nitems; i++)
3681 if (item->
line > 0 && func_start <= item->
pc && item->
pc < func_end)
3702 struct objfile *objfile;
3704 const struct block *b, *function_block;
3705 int force_skip, skip;
3729 if (msymbol.
minsym == NULL)
3783 if (skip && start_sal.
pc != pc
3800 && name &&
strcmp_iw (name,
"main") == 0)
3808 while (!force_skip && skip--);
3818 if (!force_skip && sym && start_sal.
symtab == NULL)
3842 sal->
end = start_sal.
end;
3847 function_block = NULL;
3856 if (function_block != NULL
3887 const struct block *bl;
3894 if (prologue_sal.
line != 0)
3908 while (linetable->
item[idx].
pc != prologue_sal.
pc
3912 if (idx+1 < linetable->
nitems
3913 && linetable->
item[idx+1].
line != 0
3914 && linetable->
item[idx+1].
pc == start_pc)
3921 if (prologue_sal.
end >= end_pc)
3924 while (prologue_sal.
end < end_pc)
3933 if (sal.line >= prologue_sal.
line)
3937 if (sal.symtab != prologue_sal.
symtab)
3969 if (prologue_sal.
end < end_pc)
3972 return prologue_sal.
end;
3975 return prologue_sal.
pc;
3993 if (isalpha (*p) || *p ==
'_' || *p ==
'$' || *p ==
'\0')
3997 while (*p ==
' ' || *p ==
'\t')
4002 if (isalpha (*p) || *p ==
'_' || *p ==
'$')
4004 const char *q = p + 1;
4006 while (isalnum (*q) || *q ==
'_' || *q ==
'$')
4024 else if (p[1] ==
'[')
4027 error (
_(
"mismatched quoting on brackets, "
4028 "try 'operator\\[\\]'"));
4029 else if (p[2] ==
'\\' && p[3] ==
']')
4035 error (
_(
"nothing is allowed between '[' and ']'"));
4061 if (p[0] ==
'-' && p[1] ==
'>')
4069 else if (p[2] ==
'\\')
4080 if (p[1] ==
'=' || p[1] == p[0])
4091 error (
_(
"`operator ()' must be specified "
4092 "without whitespace in `()'"));
4097 error (
_(
"`operator ?:' must be specified "
4098 "without whitespace in `?:'"));
4103 error (
_(
"`operator []' must be specified "
4104 "without whitespace in `[]'"));
4108 error (
_(
"`operator %s' not supported"), p);
4119 struct filename_seen_cache
4124 #define INITIAL_FILENAME_SEEN_CACHE_SIZE 100
4129 static struct filename_seen_cache *
4132 struct filename_seen_cache *cache;
4134 cache = XNEW (
struct filename_seen_cache);
4136 filename_hash, filename_eq,
4147 htab_empty (cache->
tab);
4156 struct filename_seen_cache *cache = ptr;
4158 htab_delete (cache->
tab);
4175 slot = htab_find_slot (cache->
tab, file, add ? INSERT : NO_INSERT);
4181 *slot = (
char *) file;
4244 struct objfile *objfile;
4250 error (
_(
"No symbol table is loaded. Use the \"file\" command."));
4257 printf_filtered (
"Source files for which symbols have been read in:\n\n");
4269 "will be read in on demand:\n\n");
4284 file_matches (
const char *file,
const char *files[],
int nfiles,
int basenames)
4288 if (file != NULL && nfiles != 0)
4290 for (i = 0; i < nfiles; i++)
4293 ? lbasename (files[i])
4298 else if (nfiles == 0)
4311 for (p = symbols; p != NULL; p =
next)
4372 for (i = 0; i < nfound; i++)
4385 for (i = 1, j = 1; i < nfound; ++i)
4388 symbols[j++] = symbols[i];
4393 symbols[j - 1]->
next = NULL;
4396 for (i = 0; i < nunique - 1; i++)
4397 symbols[i]->
next = symbols[i + 1];
4398 symbols[nunique - 1]->
next = NULL;
4400 *new_head = symbols[0];
4401 *new_tail = symbols[nunique - 1];
4435 return !data->
preg_p || regexec (&data->
preg, symname, 0, NULL, 0) == 0;
4465 struct objfile *objfile;
4492 ourtype = types[kind];
4493 ourtype2 = types2[kind];
4494 ourtype3 = types3[kind];
4495 ourtype4 = types4[kind];
4515 if (isalpha (*opname) || *opname ==
'_' || *opname ==
'$')
4518 if (opname[-1] !=
' ' || opname[-2] ==
' ')
4524 if (opname[-1] ==
' ')
4530 char *tmp = (
char *) alloca (8 + fix + strlen (opname) + 1);
4532 sprintf (tmp,
"operator%.*s%s", fix,
" ", opname);
4537 errcode = regcomp (&datum.
preg, regexp,
4545 error (
_(
"Invalid regexp (%s): %s"), err, regexp);
4556 datum.
files = files;
4561 NULL, kind, &datum);
4632 || ((basenames_may_differ
4742 int block,
const char *last)
4747 if (last == NULL || filename_cmp (last, s_filename) != 0)
4803 static const char *
const classnames[] =
4804 {
"variable",
"function",
"type"};
4808 const char *last_filename = NULL;
4819 classnames[kind], regexp);
4823 for (p = symbols; p != NULL; p = p->
next)
4891 char *
string = NULL;
4893 const char **files = NULL;
4894 const char *file_name;
4899 char *colon = strchr (regexp,
':');
4901 if (colon && *(colon + 1) !=
':')
4906 colon_index = colon - regexp;
4907 local_name = alloca (colon_index + 1);
4908 memcpy (local_name, regexp, colon_index);
4909 local_name[colon_index--] = 0;
4910 while (isspace (local_name[colon_index]))
4911 local_name[colon_index--] = 0;
4912 file_name = local_name;
4925 for (p = ss; p != NULL; p = p->
next)
4932 int newlen = (strlen (fullname)
4938 string =
xrealloc (
string, newlen);
4941 strcpy (
string, fullname);
4942 strcat (
string,
":'");
4944 strcat (
string,
"'");
4957 string =
xrealloc (
string, newlen);
4960 strcpy (
string,
"'");
4962 strcat (
string,
"'");
4986 int (*ncmp) (
const char *,
const char *, size_t);
4990 if (ncmp (name, sym_text, sym_text_len) != 0)
4993 if (sym_text[sym_text_len] ==
'(')
5001 if (name[sym_text_len] !=
'\0' && name[sym_text_len] !=
'(')
5033 #define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \
5034 completion_list_add_name \
5035 (SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))
5037 #define MCOMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \
5038 completion_list_add_name \
5039 (MSYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))
5055 completion_list_add_name (
const char *symname,
5056 const char *sym_text,
int sym_text_len,
5057 const char *text,
const char *word)
5070 if (word == sym_text)
5072 newobj =
xmalloc (strlen (symname) + 5);
5073 strcpy (newobj, symname);
5075 else if (word > sym_text)
5078 newobj =
xmalloc (strlen (symname) + 5);
5079 strcpy (newobj, symname + (word - sym_text));
5084 newobj =
xmalloc (strlen (symname) + (sym_text - word) + 5);
5085 strncpy (newobj, word, sym_text - word);
5086 newobj[sym_text -
word] =
'\0';
5087 strcat (newobj, symname);
5115 const char *sym_text,
int sym_text_len,
5116 const char *text,
const char *word)
5118 static char *tmp = NULL;
5119 static unsigned int tmplen = 0;
5121 const char *method, *category, *
selector;
5127 if ((method[0] !=
'-') && (method[0] !=
'+'))
5130 if (sym_text[0] ==
'[')
5132 completion_list_add_name (method + 1, sym_text, sym_text_len, text, word);
5134 while ((strlen (method) + 1) >= tmplen)
5142 selector = strchr (method,
' ');
5143 if (selector != NULL)
5146 category = strchr (method,
'(');
5148 if ((category != NULL) && (selector != NULL))
5150 memcpy (tmp, method, (category - method));
5151 tmp[category - method] =
' ';
5152 memcpy (tmp + (category - method) + 1, selector, strlen (selector) + 1);
5153 completion_list_add_name (tmp, sym_text, sym_text_len, text, word);
5154 if (sym_text[0] ==
'[')
5155 completion_list_add_name (tmp + 1, sym_text, sym_text_len, text, word);
5158 if (selector != NULL)
5161 strcpy (tmp, selector);
5162 tmp2 = strchr (tmp,
']');
5166 completion_list_add_name (tmp, sym_text, sym_text_len, text, word);
5176 for (; p > text; --p)
5178 if (isalnum (p[-1]) || p[-1] ==
'_' || p[-1] ==
'\0')
5186 else if (p[-1] ==
'[' && (p[-2] ==
'-' || p[-2] ==
'+'))
5188 else if (p[-1] ==
' ' || p[-1] ==
'(' || p[-1] ==
')')
5198 if (isalnum (t[-1]) || t[-1] ==
'_' ||
5199 t[-1] ==
' ' || t[-1] ==
':' ||
5200 t[-1] ==
'(' || t[-1] ==
')')
5205 if (t[-1] ==
'[' && (t[-2] ==
'-' || t[-2] ==
'+'))
5218 int sym_text_len,
const char *text,
5231 sym_text, sym_text_len, text,
word);
5260 completion_list_add_name (name,
5279 const char *sym_text,
int sym_text_len,
5280 const char *text,
const char *word,
5284 const struct block *b;
5298 sym_text, sym_text_len,
5322 const char *break_on,
5332 struct objfile *objfile;
5333 const struct block *b;
5334 const struct block *surrounding_static_block, *surrounding_global_block;
5337 const char *sym_text;
5347 const char *quote_pos = NULL;
5351 for (p = text; *p !=
'\0'; ++p)
5353 if (quote_found !=
'\0')
5355 if (*p == quote_found)
5358 else if (*p ==
'\\' && p[1] == quote_found)
5363 else if (*p ==
'\'' || *p ==
'"')
5369 if (quote_found ==
'\'')
5371 sym_text = quote_pos + 1;
5372 else if (quote_found ==
'"')
5384 if (isalnum (p[-1]) || p[-1] ==
'_' || p[-1] ==
'\0'
5385 || p[-1] ==
':' || strchr (break_on, p[-1]) != NULL)
5394 sym_text_len = strlen (sym_text);
5405 const char *cs = memchr (sym_text,
'(', sym_text_len);
5408 sym_text_len = cs - sym_text;
5410 gdb_assert (sym_text[sym_text_len] ==
'\0' || sym_text[sym_text_len] ==
'(');
5460 if (surrounding_static_block != NULL)
5461 while (b != surrounding_static_block)
5492 if (surrounding_static_block != NULL)
5496 if (surrounding_global_block != NULL)
5531 default_make_symbol_completion_list_break_on (
const char *text,
5533 const char *break_on,
5558 default_make_symbol_completion_list (
const char *text,
const char *word,
5561 return default_make_symbol_completion_list_break_on (text, word,
"", code);
5569 make_symbol_completion_list (
const char *text,
const char *word)
5579 make_symbol_completion_type (
const char *text,
const char *word,
5585 return current_language->la_make_symbol_completion_list (text, word, code);
5593 const char *text,
const char *word)
5595 return make_symbol_completion_list (text, word);
5602 make_file_symbol_completion_list_1 (
const char *text,
const char *word,
5603 const char *srcfile)
5610 const char *sym_text;
5619 const char *quote_pos = NULL;
5623 for (p = text; *p !=
'\0'; ++p)
5625 if (quote_found !=
'\0')
5627 if (*p == quote_found)
5630 else if (*p ==
'\\' && p[1] == quote_found)
5635 else if (*p ==
'\'' || *p ==
'"')
5641 if (quote_found ==
'\'')
5643 sym_text = quote_pos + 1;
5644 else if (quote_found ==
'"')
5657 sym_text_len = strlen (sym_text);
5666 const char *tail = lbasename (srcfile);
5674 return (return_val);
5691 return (return_val);
5698 make_file_symbol_completion_list (
const char *text,
const char *word,
5699 const char *srcfile)
5701 struct cleanup *back_to, *cleanups;
5710 make_file_symbol_completion_list_1 (text, word, srcfile);
5733 size_t fnlen = strlen (fname);
5739 strcpy (newobj, fname);
5741 else if (word > text)
5745 strcpy (newobj, fname + (word - text));
5750 newobj =
xmalloc (fnlen + (text - word) + 5);
5751 strncpy (newobj, word, text - word);
5752 newobj[text -
word] =
'\0';
5753 strcat (newobj, fname);
5761 static const char *illegal_aliens[] = {
5767 for (i = 0; illegal_aliens[i]; i++)
5769 if (filename_cmp (fname, illegal_aliens[i]) == 0)
5797 && filename_ncmp (filename, data->
text, data->
text_len) == 0)
5805 const char *base_name = lbasename (filename);
5807 if (base_name != filename
5809 && filename_ncmp (base_name, data->
text, data->
text_len) == 0)
5820 make_source_files_completion_list (
const char *text,
const char *word)
5824 struct objfile *objfile;
5825 size_t text_len = strlen (text);
5827 const char *base_name;
5829 struct filename_seen_cache *filename_seen_cache;
5830 struct cleanup *back_to, *cache_cleanup;
5839 filename_seen_cache);
5846 && filename_ncmp (s->
filename, text, text_len) == 0)
5858 base_name = lbasename (s->
filename);
5861 && filename_ncmp (base_name, text, text_len) == 0)
5866 datum.filename_seen_cache = filename_seen_cache;
5869 datum.text_len = text_len;
5890 main_progspace_key);
5946 const char *new_main_name;
5947 struct objfile *objfile;
5982 if (new_main_name != NULL)
5989 if (new_main_name != NULL)
5996 if (new_main_name != NULL)
6003 if (new_main_name != NULL)
6054 static const char *
const arm_idents[] = {
6055 "ARM C Compiler, ADS",
6056 "Thumb C Compiler, ADS",
6057 "ARM C++ Compiler, ADS",
6058 "Thumb C++ Compiler, ADS",
6059 "ARM/Thumb C/C++ Compiler, RVCT",
6060 "ARM C/C++ Compiler, RVCT"
6064 if (producer == NULL)
6067 for (i = 0; i < ARRAY_SIZE (arm_idents); i++)
6082 #define MAX_SYMBOL_IMPLS (LOC_FINAL_VALUE + 10)
6108 int result = next_aclass_value++;
6134 int result = next_aclass_value++;
6157 int result = next_aclass_value++;
6196 memset (sym, 0,
sizeof (*sym));
6279 All global and static variable names, or those matching REGEXP."));
6282 All global and static variable names, or those matching REGEXP."));
6285 _(
"All function names, or those matching REGEXP."));
6296 _(
"All type names, or those matching REGEXP."));
6299 _(
"Source files in the program."));
6302 _(
"Set a breakpoint for all functions matching REGEXP."));
6305 multiple_symbols_modes, &multiple_symbols_mode,
6307 Set the debugger behavior when more than one symbol are possible matches\n\
6308 in an expression."),
_(
"\
6309 Show how the debugger handles ambiguities in expressions."),
_(
"\
6310 Valid values are \"ask\", \"all\", \"cancel\", and the default is \"all\"."),
6314 &basenames_may_differ,
_(
"\
6315 Set whether a source file may have multiple base names."),
_(
"\
6316 Show whether a source file may have multiple base names."),
_(
"\
6317 (A \"base name\" is the name of a file with the directory part removed.\n\
6318 Example: The base name of \"/home/user/hello.c\" is \"hello.c\".)\n\
6319 If set, GDB will canonicalize file names (e.g., expand symlinks)\n\
6320 before comparing them. Canonicalization is an expensive operation,\n\
6321 but it allows the same file be known by more than one base name.\n\
6322 If not set (the default), all source files are assumed to have just\n\
6323 one base name, and gdb will do file name comparisons more efficiently."),
6328 _(
"Set debugging of symbol table creation."),
6329 _(
"Show debugging of symbol table creation."),
_(
"\
6330 When enabled (non-zero), debugging messages are printed when building\n\
6331 symbol tables. A value of 1 (one) normally provides enough information.\n\
6332 A value greater than 1 provides more verbose information."),
6339 Set debugging of symbol lookup."),
_(
"\
6340 Show debugging of symbol lookup."),
_(
"\
6341 When enabled (non-zero), symbol lookups are logged."),
6346 &new_symbol_cache_size,
6347 _(
"Set the size of the symbol cache."),
6348 _(
"Show the size of the symbol cache."),
_(
"\
6349 The size of the symbol cache.\n\
6350 If zero then the symbol cache is disabled."),
6356 _(
"Dump the symbol cache for each program space."),
6361 _(
"Print symbol cache statistics for each program space."),
6366 _(
"Flush the symbol cache for each program space."),
static void do_end_rbreak_breakpoints(void *ignore)
struct gdbarch * target_gdbarch(void)
static int check_field(struct type *type, const char *name, struct field_of_this_result *is_a_field_of_this)
const struct symbol_register_ops * ops_register
enum language main_language(void)
const char * symtab_to_filename_for_display(struct symtab *symtab)
#define SYMTAB_COMPUNIT(symtab)
char * gdb_realpath(const char *filename)
struct symbol * language_lookup_primitive_type_as_symbol(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc_section(CORE_ADDR pc, struct obj_section *section)
struct cleanup * make_cleanup_free_completion_tracker(completion_tracker_t *tracker_ptr)
static void symbol_cache_stats(struct symbol_cache *cache)
struct symbol * lookup_symbol_in_language(const char *name, const struct block *block, const domain_enum domain, enum language lang, struct field_of_this_result *is_a_field_of_this)
struct htab * demangled_names_hash
#define SYMTAB_LANGUAGE(symtab)
static void set_symbol_cache_size(unsigned int new_size)
struct template_symbol * allocate_template_symbol(struct objfile *objfile)
struct macro_source_file * file
struct observer * observer_attach_free_objfile(observer_free_objfile_ftype *f)
static struct type * basic_lookup_transparent_type_quick(struct objfile *objfile, int block_index, const char *name)
#define SYMBOL_PRINT_NAME(symbol)
static void add_macro_name(const char *name, const struct macro_definition *ignore, struct macro_source_file *ignore2, int ignore3, void *user_data)
void add_setshow_zuinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void symbol_set_symtab(struct symbol *symbol, struct symtab *symtab)
struct obstack storage_obstack
union general_symbol_info::@159 language_specific
#define MSYMBOL_LINKAGE_NAME(symbol)
void symbol_set_language(struct general_symbol_info *gsymbol, enum language language, struct obstack *obstack)
struct linetable_entry item[1]
static char * symbol_find_demangled_name(struct general_symbol_info *gsymbol, const char *mangled)
#define TYPE_FIELD_NAME(thistype, n)
int( symbol_found_callback_ftype)(struct symbol *sym, void *data)
#define TYPE_N_BASECLASSES(thistype)
void(* describe_location)(struct symbol *symbol, CORE_ADDR addr, struct ui_file *stream)
const char multiple_symbols_cancel[]
const char * go_main_name(void)
struct objfile * separate_debug_objfile_backlink
static void set_symbol_cache_size_handler(char *args, int from_tty, struct cmd_list_element *c)
int strcmp_iw(const char *string1, const char *string2)
#define TYPE_NFN_FIELDS(thistype)
int section_is_overlay(struct obj_section *section)
struct type *(* la_lookup_transparent_type)(const char *)
static void completion_list_add_fields(struct symbol *sym, const char *sym_text, int sym_text_len, const char *text, const char *word)
static const char *const multiple_symbols_modes[]
struct symbol * cp_lookup_symbol_imports_or_template(const char *scope, const char *name, const struct block *block, const domain_enum domain)
static void initialize_objfile_symbol_1(struct symbol *sym)
void add_setshow_enum_cmd(const char *name, enum command_class theclass, const char *const *enumlist, const char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct objfile * symfile_object_file
struct bfd_section * the_bfd_section
#define BMSYMBOL_VALUE_ADDRESS(symbol)
struct block_symbol_cache * static_symbols
enum address_class aclass
const char * symbol_search_name(const struct general_symbol_info *gsymbol)
struct program_space * pspace
static int compare_symbol_name(const char *name, const char *sym_text, int sym_text_len)
static struct symbol * lookup_symbol_aux(const char *name, const struct block *block, const domain_enum domain, enum language language, struct field_of_this_result *)
void map_symbol_filenames(symbol_filename_ftype *fun, void *data, int need_fullname)
struct symbol * find_pc_sect_function(CORE_ADDR pc, struct obj_section *section)
char * gdb_mangle_name(struct type *type, int method_id, int signature_id)
const struct block * block_global_block(const struct block *block)
#define TYPE_FN_FIELDLIST(thistype, n)
struct symbol * block_lookup_symbol_primary(const struct block *block, const char *name, const domain_enum domain)
enum domain_enum_tag domain_enum
int compare_filenames_for_search(const char *filename, const char *search_name)
struct ui_file * gdb_stdout
struct symtab * lookup_symtab(const char *name)
#define SYMBOL_CLASS(symbol)
#define TYPE_IS_OPAQUE(thistype)
struct compunit_symtab *(* find_pc_sect_compunit_symtab)(struct objfile *objfile, struct bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin)
static void symbol_cache_dump(const struct symbol_cache *cache)
#define obj_section_endaddr(s)
static void symbol_cache_mark_found(struct block_symbol_cache *bsc, struct symbol_cache_slot *slot, struct objfile *objfile_context, struct symbol *symbol)
const struct language_defn * language_def(enum language lang)
void init_sal(struct symtab_and_line *sal)
static void free_symbol_cache(struct symbol_cache *cache)
struct observer * observer_attach_executable_changed(observer_executable_changed_ftype *f)
CORE_ADDR gdbarch_deprecated_function_start_offset(struct gdbarch *gdbarch)
void(* expand_symtabs_with_fullname)(struct objfile *objfile, const char *fullname)
static int search_symbols_name_matches(const char *symname, void *user_data)
const char * ada_decode(const char *encoded)
unsigned int symbol_lookup_debug
char * get_regcomp_error(int, regex_t *)
static void completion_list_objc_symbol(struct minimal_symbol *msymbol, const char *sym_text, int sym_text_len, const char *text, const char *word)
void(* tracepoint_var_ref)(struct symbol *symbol, struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
struct gdbarch * symbol_arch(const struct symbol *symbol)
const char multiple_symbols_ask[]
void initialize_objfile_symbol(struct symbol *sym)
static int file_matches(const char *file, const char *files[], int nfiles, int basenames)
void macro_for_each_in_scope(struct macro_source_file *file, int line, macro_callback_fn fn, void *user_data)
int have_partial_symbols(void)
enum language la_language
#define ALL_OBJFILE_OSECTIONS(objfile, osect)
struct symbol * lookup_global_symbol_from_objfile(struct objfile *main_objfile, const char *name, const domain_enum domain)
struct filename_seen_cache * filename_seen_cache
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
#define VEC_safe_push(T, V, O)
#define BLOCKVECTOR_BLOCK(blocklist, n)
struct obj_section * section
static void symtab_free_objfile_observer(struct objfile *objfile)
char * skip_spaces(char *chp)
struct symtab_and_line find_function_start_sal(struct symbol *sym, int funfirstline)
#define TYPE_FIELD(thistype, n)
static void do_free_completion_list(void *list)
static void symtab_observer_executable_changed(void)
const char * pascal_main_name(void)
int producer_is_realview(const char *producer)
int register_symbol_computed_impl(enum address_class aclass, const struct symbol_computed_ops *ops)
int register_symbol_block_impl(enum address_class aclass, const struct symbol_block_ops *ops)
static void free_completion_list(VEC(char_ptr)**list_ptr)
struct macro_scope * default_macro_scope(void)
struct symbol * solib_global_lookup(struct objfile *objfile, const char *name, const domain_enum domain)
void rbreak_command_wrapper(char *regexp, int from_tty)
struct objfile_per_bfd_storage * per_bfd
static int filename_seen(struct filename_seen_cache *cache, const char *file, int add)
gdb_static_assert(MAX_SYMBOL_IMPLS<=(1<< SYMBOL_ACLASS_BITS))
struct bound_minimal_symbol lookup_minimal_symbol_text(const char *name, struct objfile *objf)
const struct symbol_block_ops * ops_block
struct cmd_list_element * maintenance_set_cmdlist
struct objfile * symbol_objfile(const struct symbol *symbol)
struct symbol * lookup_static_symbol(const char *name, const domain_enum domain)
static void functions_info(char *regexp, int from_tty)
static const char * operator_chars(const char *p, const char **end)
const struct block * block_for_pc(CORE_ADDR pc)
union symbol_cache_slot::@156 value
void printf_filtered(const char *format,...)
struct macro_table * macro_user_macros
static struct filename_seen_cache * create_filename_seen_cache(void)
const char * search_domain_name(enum search_domain e)
const char * multiple_symbols_select_mode(void)
#define SYMBOL_OBJ_SECTION(objfile, symbol)
struct obj_section * find_pc_overlay(CORE_ADDR pc)
struct compunit_symtab *(* lookup_symbol)(struct objfile *objfile, int block_index, const char *name, domain_enum domain)
#define BLOCK_FUNCTION(bl)
const char * symtab_to_fullname(struct symtab *s)
struct compunit_symtab * find_pc_compunit_symtab(CORE_ADDR pc)
static struct symbol * symbol_cache_lookup(struct symbol_cache *cache, struct objfile *objfile_context, int block, const char *name, domain_enum domain, struct block_symbol_cache **bsc_ptr, struct symbol_cache_slot **slot_ptr)
static void print_symbol_info(enum search_domain kind, struct symbol *sym, int block, const char *last)
#define obj_section_addr(s)
struct minimal_symbol * lookup_minimal_symbol_by_pc_name(CORE_ADDR pc, const char *name, struct objfile *objf)
static void initialize_ordinary_address_classes(void)
#define MSYMBOL_OBJ_SECTION(objfile, symbol)
struct obstack objfile_obstack
int gdbarch_skip_main_prologue_p(struct gdbarch *gdbarch)
void null_cleanup(void *arg)
static void add_filename_to_list(const char *fname, const char *text, const char *word, VEC(char_ptr)**list)
#define MSYMBOL_PRINT_NAME(symbol)
#define MCOMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word)
int(* map_symtabs_matching_filename)(struct objfile *objfile, const char *name, const char *real_path, int(*callback)(struct symtab *, void *), void *data)
struct fn_fieldlist * fn_field
static void symtab_new_objfile_observer(struct objfile *objfile)
static void maybe_add_partial_symtab_filename(const char *filename, const char *fullname, void *user_data)
struct cmd_list_element * setlist
#define SYMTAB_BLOCKVECTOR(symtab)
char * gdb_demangle(const char *name, int options)
#define ALL_OBJFILES(obj)
#define DEFAULT_SYMBOL_CACHE_SIZE
#define TYPE_FN_FIELD_PHYSNAME(thisfn, n)
void(* find_frame_base_location)(struct symbol *framefunc, CORE_ADDR pc, const gdb_byte **start, size_t *length)
#define VEC_iterate(T, V, I, P)
unsigned int created_by_gdb
static const char * multiple_symbols_mode
static hashval_t hash_demangled_name_entry(const void *data)
char * ada_main_name(void)
#define SYMBOL_VALUE_ADDRESS(symbol)
#define CATCH(EXCEPTION, MASK)
static void print_msymbol_info(struct bound_minimal_symbol msymbol)
static void symbol_cache_flush(struct program_space *pspace)
static void set_main_name(const char *name, enum language lang)
static void default_make_symbol_completion_list_break_on_1(const char *text, const char *word, const char *break_on, enum type_code code)
struct type * lookup_transparent_type(const char *name)
void free_search_symbols(struct symbol_search *symbols)
void expand_symtab_containing_pc(CORE_ADDR pc, struct obj_section *section)
#define SYMBOL_DOMAIN(symbol)
void initialize_file_ftype(void)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
struct symbol * lookup_symbol_in_block(const char *name, const struct block *block, const domain_enum domain)
struct cleanup * make_cleanup_free_search_symbols(struct symbol_search **symbolsp)
void typedef_print(struct type *type, struct symbol *newobj, struct ui_file *stream)
struct symbol * lookup_language_this(const struct language_defn *lang, const struct block *block)
initialize_file_ftype _initialize_symtab
enum ctor_kinds is_constructor_name(const char *name)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t err
struct filename_seen_cache * filename_seen_cache
#define SYMTAB_OBJFILE(symtab)
static int eq_demangled_name_entry(const void *a, const void *b)
int(* read_needs_frame)(struct symbol *symbol)
static void variables_info(char *regexp, int from_tty)
static int eq_symbol_entry(const struct symbol_cache_slot *slot, const struct objfile *objfile_context, const char *name, domain_enum domain)
const char * symbol_natural_name(const struct general_symbol_info *gsymbol)
const char * symbol_get_demangled_name(const struct general_symbol_info *gsymbol)
htab_t completion_tracker_t
struct value *(* read_variable)(struct symbol *symbol, struct frame_info *frame)
static struct symbol * lookup_local_symbol(const char *name, const struct block *block, const domain_enum domain, enum language language)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
struct symtab * compunit_primary_filetab(const struct compunit_symtab *cust)
const char * symbol_demangled_name(const struct general_symbol_info *gsymbol)
struct cmd_list_element * showlist
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
#define gdb_assert_not_reached(message)
static void output_source_filename(const char *name, struct output_source_filename_data *data)
static void create_demangled_names_hash(struct objfile *objfile)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
void free_current_contents(void *ptr)
const struct sym_fns * sf
static void symbol_cache_cleanup(struct program_space *pspace, void *data)
struct type * basic_lookup_transparent_type(const char *name)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct cleanup * make_regfree_cleanup(regex_t *)
#define ANOFFSET(secoff, whichone)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
#define ALL_COMPUNITS(objfile, cu)
struct obj_section * sections
const char * language_str(enum language lang)
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
enum dtor_kinds is_destructor_name(const char *name)
static void sources_info(char *ignore, int from_tty)
const struct block * block_found
#define BLOCK_SUPERBLOCK(bl)
static struct symbol_cache * make_symbol_cache(unsigned int size)
void start_rbreak_breakpoints(void)
struct cmd_list_element * add_info(const char *name, cmd_cfunc_ftype *fun, const char *doc)
struct objfile * separate_debug_objfile
static int compare_search_syms(const void *sa, const void *sb)
CORE_ADDR gdbarch_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR ip)
#define MSYMBOL_NATURAL_NAME(symbol)
static void sort_search_symbols_remove_dups(struct symbol_search *found, int nfound, struct symbol_search **new_head, struct symbol_search **new_tail)
static void delete_filename_seen_cache(void *ptr)
#define SYMBOL_ACLASS_BITS
const struct objfile * objfile_context
#define SYMBOL_LINE(symbol)
#define SYMBOL_LINKAGE_NAME(symbol)
void iterate_over_symbols(const struct block *block, const char *name, const domain_enum domain, symbol_found_callback_ftype *callback, void *data)
struct compunit_symtab * compunit_symtabs
static CORE_ADDR skip_prologue_using_lineinfo(CORE_ADDR func_addr, struct symtab *symtab)
static int startswith(const char *string, const char *pattern)
void expand_symtabs_matching(expand_symtabs_file_matcher_ftype *file_matcher, expand_symtabs_symbol_matcher_ftype *symbol_matcher, expand_symtabs_exp_notify_ftype *expansion_notify, enum search_domain kind, void *data)
struct compunit_symtab * find_pc_sect_compunit_symtab(CORE_ADDR pc, struct obj_section *section)
int is_operator_name(const char *name)
int iterate_over_some_symtabs(const char *name, const char *real_path, int(*callback)(struct symtab *symtab, void *data), void *data, struct compunit_symtab *first, struct compunit_symtab *after_last)
void gdbarch_iterate_over_objfiles_in_search_order(struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
struct compunit_symtab * next
static void add_symtab_completions(struct compunit_symtab *cust, const char *sym_text, int sym_text_len, const char *text, const char *word, enum type_code code)
const char * domain_name(domain_enum e)
int block_find_non_opaque_type(struct symbol *sym, void *data)
#define TYPE_BASECLASS(thistype, index)
struct symbol * block_lookup_symbol(const struct block *block, const char *name, const domain_enum domain)
void search_symbols(const char *regexp, enum search_domain kind, int nfiles, const char *files[], struct symbol_search **matches)
void wrap_here(char *indent)
static void main_info_cleanup(struct program_space *pspace, void *data)
struct symbol *(* la_lookup_symbol_nonlocal)(const struct language_defn *, const char *, const struct block *, const domain_enum)
int section_is_mapped(struct obj_section *osect)
struct cmd_list_element * setdebuglist
char * cp_canonicalize_string(const char *string)
const char * objfile_name(const struct objfile *objfile)
static struct symbol_cache * get_symbol_cache(struct program_space *pspace)
void skip_prologue_sal(struct symtab_and_line *sal)
struct ui_file * gdb_stdlog
#define ALL_FILETABS(objfile, ps, s)
void symbol_set_demangled_name(struct general_symbol_info *gsymbol, const char *name, struct obstack *obstack)
struct cmd_list_element * maintenanceprintlist
const struct block * block_for_pc_sect(CORE_ADDR pc, struct obj_section *section)
static void types_info(char *regexp, int from_tty)
static void clear_filename_seen_cache(struct filename_seen_cache *cache)
static void do_free_search_symbols_cleanup(void *symbolsp)
#define ALL_OBJFILE_COMPUNITS(objfile, cu)
static const struct program_space_data * main_progspace_key
unsigned long hash(const void *addr, int length)
void macro_for_each(struct macro_table *table, macro_callback_fn fn, void *user_data)
int find_line_pc(struct symtab *symtab, int line, CORE_ADDR *pc)
static void maintenance_print_symbol_cache(char *args, int from_tty)
static int search_symbols_file_matches(const char *filename, void *user_data, int basenames)
static void ATTRIBUTE_NORETURN error_in_psymtab_expansion(int block_index, const char *name, struct compunit_symtab *cust)
#define SYMBOL_OBJFILE_OWNED(symbol)
PTR xrealloc(PTR ptr, size_t size)
static void maintenance_flush_symbol_cache(char *args, int from_tty)
static struct symbol * lookup_symbol_in_objfile_symtabs(struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
#define COMPUNIT_BLOCKVECTOR(cust)
void throw_exception(struct gdb_exception exception)
struct symbol * fixup_symbol_section(struct symbol *sym, struct objfile *objfile)
const char const char int
int block_inlined_p(const struct block *bl)
int find_line_pc_range(struct symtab_and_line sal, CORE_ADDR *startptr, CORE_ADDR *endptr)
static void rbreak_command(char *, int)
static void symtab_symbol_info(char *regexp, enum search_domain kind, int from_tty)
#define MSYMBOL_TYPE(msymbol)
char * hex_string_custom(LONGEST num, int width)
void discard_cleanups(struct cleanup *old_chain)
struct symbol * block_find_symbol(const struct block *block, const char *name, const domain_enum domain, block_symbol_matcher_ftype *matcher, void *data)
#define ALL_MSYMBOLS(objfile, m)
const struct language_defn * current_language
struct obj_section * find_pc_mapped_section(CORE_ADDR pc)
#define TYPE_TARGET_TYPE(thistype)
struct symbol_cache_slot symbols[1]
CORE_ADDR overlay_unmapped_address(CORE_ADDR pc, struct obj_section *section)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
struct symbol * allocate_symbol(struct objfile *objfile)
void break_command(char *arg, int from_tty)
struct symbol_cache_slot::@156::@157 not_found
#define ALL_PSPACES(pspace)
struct bound_minimal_symbol msymbol
struct symbol * lookup_global_symbol(const char *name, const struct block *block, const domain_enum domain)
const char * name_of_main
static int lookup_symbol_global_iterator_cb(struct objfile *objfile, void *cb_data)
int xsnprintf(char *str, size_t size, const char *format,...)
#define SYMBOL_BLOCK_VALUE(symbol)
const struct block * block_static_block(const struct block *block)
#define TYPE_CODE(thistype)
maybe_add_completion_enum
char * d_demangle(const char *symbol, int options)
static int find_line_common(struct linetable *, int, int *, int)
static struct main_info * get_main_info(void)
struct minimal_symbol * minsym
struct symbol_search * next
__extension__ enum language language
#define MSYMBOL_SECTION(symbol)
struct gdbarch * block_gdbarch(const struct block *block)
const char * host_address_to_string(const void *addr)
static void symbol_cache_mark_not_found(struct block_symbol_cache *bsc, struct symbol_cache_slot *slot, struct objfile *objfile_context, const char *name, domain_enum domain)
enum symbol_cache_slot_state state
struct program_space * pspace
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 objfile * objfile_separate_debug_iterate(const struct objfile *parent, const struct objfile *objfile)
static unsigned int symbol_cache_size
static unsigned int new_symbol_cache_size
const char * objfile_debug_name(const struct objfile *objfile)
int register_symbol_register_impl(enum address_class aclass, const struct symbol_register_ops *ops)
static void resize_symbol_cache(struct symbol_cache *cache, unsigned int new_size)
#define TYPE_NFIELDS(thistype)
struct general_symbol_info ginfo
enum language language_of_main
void symbol_set_names(struct general_symbol_info *gsymbol, const char *linkage_name, int len, int copy_name, struct objfile *objfile)
enum language compunit_language(const struct compunit_symtab *cust)
#define SYMBOL_LANGUAGE(symbol)
#define COMPUNIT_FILETABS(cust)
#define SYMBOL_LOOKUP_FAILED
struct block_symbol_cache * global_symbols
void iterate_over_symtabs(const char *name, int(*callback)(struct symtab *symtab, void *data), void *data)
#define INITIAL_FILENAME_SEEN_CACHE_SIZE
#define CHECK_TYPEDEF(TYPE)
int symbol_matches_domain(enum language symbol_language, domain_enum symbol_domain, domain_enum domain)
int have_full_symbols(void)
#define COMPUNIT_LOCATIONS_VALID(cust)
static void symbol_cache_clear_slot(struct symbol_cache_slot *slot)
static int not_interesting_fname(const char *fname)
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
void fixup_section(struct general_symbol_info *ginfo, CORE_ADDR addr, struct objfile *objfile)
const char * ada_decode_symbol(const struct general_symbol_info *arg)
#define SYMBOL_NATURAL_NAME(symbol)
static void output_partial_symbol_filename(const char *filename, const char *fullname, void *data)
struct program_space * current_program_space
unsigned int symtab_create_debug
const char * d_main_name(void)
void end_rbreak_breakpoints(void)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static PyObject * field_name(struct type *type, int field)
#define SYMBOL_SEARCH_NAME(symbol)
struct symtab_and_line find_pc_sect_line(CORE_ADDR pc, struct obj_section *section, int notcurrent)
static int symbol_completion_matcher(const char *name, void *user_data)
static void find_main_name(void)
struct objfile * lookup_objfile_from_block(const struct block *block)
struct observer * observer_attach_new_objfile(observer_new_objfile_ftype *f)
struct cleanup * save_current_space_and_thread(void)
struct symbol * basic_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
static void maintenance_print_symbol_cache_statistics(char *args, int from_tty)
struct symbol * lookup_symbol_in_static_block(const char *name, const struct block *block, const domain_enum domain)
#define SYMBOL_TYPE(symbol)
enum macro_expansion la_macro_expansion
static const char * language_search_unquoted_string(const char *text, const char *p)
struct cmd_list_element * maintenancelist
struct cmd_list_element * showdebuglist
static struct symbol * lookup_symbol_in_objfile_from_linkage_name(struct objfile *objfile, const char *linkage_name, domain_enum domain)
int gdbarch_skip_entrypoint_p(struct gdbarch *gdbarch)
static int lookup_symtab_callback(struct symtab *symtab, void *data)
CORE_ADDR overlay_mapped_address(CORE_ADDR pc, struct obj_section *section)
#define ALL_COMPUNIT_FILETABS(cu, s)
CORE_ADDR gdbarch_skip_main_prologue(struct gdbarch *gdbarch, CORE_ADDR ip)
#define TYPE_FN_FIELDLIST_NAME(thistype, n)
#define OBSTACK_ZALLOC(OBSTACK, TYPE)
completion_tracker_t new_completion_tracker(void)
const char * type_name_no_tag(const struct type *type)
int matching_obj_sections(struct obj_section *obj_first, struct obj_section *obj_second)
#define SYMBOL_SECTION(symbol)
CORE_ADDR gdbarch_skip_entrypoint(struct gdbarch *gdbarch, CORE_ADDR ip)
void switch_to_program_space_and_thread(struct program_space *pspace)
#define ALL_BLOCK_SYMBOLS_WITH_NAME(block, name, iter, sym)
static const struct program_space_data * symbol_cache_key
struct section_offsets * section_offsets
static struct symbol * lookup_symbol_via_quick_fns(struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
struct general_symbol_info::@159::mangled_lang mangled_lang
struct symtab * find_pc_line_symtab(CORE_ADDR pc)
const struct quick_symbol_functions * qf
static void symtab_expansion_callback(struct compunit_symtab *symtab, void *user_data)
const struct symbol_computed_ops * ops_computed
void throw_max_completions_reached_error(void)
static struct symbol * lookup_symbol_in_objfile(struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
#define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word)
PTR xcalloc(size_t number, size_t size)
struct symtab * symbol_symtab(const struct symbol *symbol)
CORE_ADDR pc_in_unmapped_range(CORE_ADDR pc, struct obj_section *section)
struct cmd_list_element * maintenance_show_cmdlist
static struct type * basic_lookup_transparent_type_1(struct objfile *objfile, int block_index, const char *name)
#define SYMTAB_LINETABLE(symtab)
struct symtab * find_line_symtab(struct symtab *symtab, int line, int *index, int *exact_match)
enum language language_of_main
const char multiple_symbols_all[]
void error(const char *fmt,...)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc)
const char * block_scope(const struct block *block)
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
#define TYPE_FN_FIELDLIST1(thistype, n)
void do_cleanups(struct cleanup *old_chain)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cleanup * demangle_for_lookup(const char *name, enum language lang, const char **result_name)
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)
char * go_demangle(const char *mangled_name, int options)
enum maybe_add_completion_enum maybe_add_completion(completion_tracker_t tracker, char *name)
#define MAX_SYMBOL_CACHE_SIZE
int find_pc_line_pc_range(CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
char * copy_name(struct stoken token)
__extension__ enum domain_enum_tag domain
static size_t symbol_cache_byte_size(unsigned int size)
char * objc_demangle(const char *mangled, int options)
const ULONGEST const LONGEST len
static unsigned int hash_symbol_entry(const struct objfile *objfile_context, const char *name, domain_enum domain)