GDB (xrefs)
/tmp/gdb-8.1/gdb/symfile-debug.c
Go to the documentation of this file.
1 /* Debug logging for the symbol file functions for the GNU debugger, GDB.
2 
3  Copyright (C) 2013-2018 Free Software Foundation, Inc.
4 
5  Contributed by Cygnus Support, using pieces from other GDB modules.
6 
7  This file is part of GDB.
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 
22 /* Note: Be careful with functions that can throw errors.
23  We want to see a logging message regardless of whether an error was thrown.
24  This typically means printing a message before calling the real function
25  and then if the function returns a result printing a message after it
26  returns. */
27 
28 #include "defs.h"
29 #include "gdbcmd.h"
30 #include "objfiles.h"
31 #include "observer.h"
32 #include "source.h"
33 #include "symtab.h"
34 #include "symfile.h"
35 
36 /* We need to save a pointer to the real symbol functions.
37  Plus, the debug versions are malloc'd because we have to NULL out the
38  ones that are NULL in the real copy. */
39 
41 {
42  const struct sym_fns *real_sf;
43  struct sym_fns debug_sf;
44 };
45 
46 /* We need to record a pointer to the real set of functions for each
47  objfile. */
48 static const struct objfile_data *symfile_debug_objfile_data_key;
49 
50 /* If non-zero all calls to the symfile functions are logged. */
51 static int debug_symfile = 0;
52 
53 /* Return non-zero if symfile debug logging is installed. */
54 
55 static int
57 {
58  return (objfile->sf != NULL
59  && objfile_data (objfile, symfile_debug_objfile_data_key) != NULL);
60 }
61 
62 /* Utility return the name to print for SYMTAB. */
63 
64 static const char *
66 {
68 }
69 
70 /* Debugging version of struct quick_symbol_functions. */
71 
72 static int
74 {
75  const struct debug_sym_fns_data *debug_data
76  = ((const struct debug_sym_fns_data *)
77  objfile_data (objfile, symfile_debug_objfile_data_key));
78  int retval;
79 
80  retval = debug_data->real_sf->qf->has_symbols (objfile);
81 
82  fprintf_filtered (gdb_stdlog, "qf->has_symbols (%s) = %d\n",
83  objfile_debug_name (objfile), retval);
84 
85  return retval;
86 }
87 
88 static struct symtab *
90 {
91  const struct debug_sym_fns_data *debug_data
92  = ((const struct debug_sym_fns_data *)
93  objfile_data (objfile, symfile_debug_objfile_data_key));
94  struct symtab *retval;
95 
96  fprintf_filtered (gdb_stdlog, "qf->find_last_source_symtab (%s)\n",
98 
99  retval = debug_data->real_sf->qf->find_last_source_symtab (objfile);
100 
101  fprintf_filtered (gdb_stdlog, "qf->find_last_source_symtab (...) = %s\n",
102  retval ? debug_symtab_name (retval) : "NULL");
103 
104  return retval;
105 }
106 
107 static void
109 {
110  const struct debug_sym_fns_data *debug_data
111  = ((const struct debug_sym_fns_data *)
112  objfile_data (objfile, symfile_debug_objfile_data_key));
113 
114  fprintf_filtered (gdb_stdlog, "qf->forget_cached_source_info (%s)\n",
116 
118 }
119 
120 static bool
122  (struct objfile *objfile, const char *name, const char *real_path,
123  gdb::function_view<bool (symtab *)> callback)
124 {
125  const struct debug_sym_fns_data *debug_data
126  = ((const struct debug_sym_fns_data *)
127  objfile_data (objfile, symfile_debug_objfile_data_key));
128 
130  "qf->map_symtabs_matching_filename (%s, \"%s\", \"%s\", %s)\n",
132  real_path ? real_path : NULL,
133  host_address_to_string (&callback));
134 
135  bool retval = (debug_data->real_sf->qf->map_symtabs_matching_filename
136  (objfile, name, real_path, callback));
137 
139  "qf->map_symtabs_matching_filename (...) = %d\n",
140  retval);
141 
142  return retval;
143 }
144 
145 static struct compunit_symtab *
146 debug_qf_lookup_symbol (struct objfile *objfile, int kind, const char *name,
147  domain_enum domain)
148 {
149  const struct debug_sym_fns_data *debug_data
150  = ((const struct debug_sym_fns_data *)
151  objfile_data (objfile, symfile_debug_objfile_data_key));
152  struct compunit_symtab *retval;
153 
155  "qf->lookup_symbol (%s, %d, \"%s\", %s)\n",
157  domain_name (domain));
158 
159  retval = debug_data->real_sf->qf->lookup_symbol (objfile, kind, name,
160  domain);
161 
162  fprintf_filtered (gdb_stdlog, "qf->lookup_symbol (...) = %s\n",
163  retval
165  : "NULL");
166 
167  return retval;
168 }
169 
170 static void
172 {
173  const struct debug_sym_fns_data *debug_data
174  = ((const struct debug_sym_fns_data *)
175  objfile_data (objfile, symfile_debug_objfile_data_key));
176 
177  fprintf_filtered (gdb_stdlog, "qf->print_stats (%s)\n",
179 
180  debug_data->real_sf->qf->print_stats (objfile);
181 }
182 
183 static void
185 {
186  const struct debug_sym_fns_data *debug_data
187  = ((const struct debug_sym_fns_data *)
188  objfile_data (objfile, symfile_debug_objfile_data_key));
189 
190  fprintf_filtered (gdb_stdlog, "qf->dump (%s)\n",
192 
193  debug_data->real_sf->qf->dump (objfile);
194 }
195 
196 static void
198  const struct section_offsets *new_offsets,
199  const struct section_offsets *delta)
200 {
201  const struct debug_sym_fns_data *debug_data
202  = ((const struct debug_sym_fns_data *)
203  objfile_data (objfile, symfile_debug_objfile_data_key));
204 
205  fprintf_filtered (gdb_stdlog, "qf->relocate (%s, %s, %s)\n",
207  host_address_to_string (new_offsets),
208  host_address_to_string (delta));
209 
210  debug_data->real_sf->qf->relocate (objfile, new_offsets, delta);
211 }
212 
213 static void
215  const char *func_name)
216 {
217  const struct debug_sym_fns_data *debug_data
218  = ((const struct debug_sym_fns_data *)
219  objfile_data (objfile, symfile_debug_objfile_data_key));
220 
222  "qf->expand_symtabs_for_function (%s, \"%s\")\n",
223  objfile_debug_name (objfile), func_name);
224 
225  debug_data->real_sf->qf->expand_symtabs_for_function (objfile, func_name);
226 }
227 
228 static void
230 {
231  const struct debug_sym_fns_data *debug_data
232  = ((const struct debug_sym_fns_data *)
233  objfile_data (objfile, symfile_debug_objfile_data_key));
234 
235  fprintf_filtered (gdb_stdlog, "qf->expand_all_symtabs (%s)\n",
237 
238  debug_data->real_sf->qf->expand_all_symtabs (objfile);
239 }
240 
241 static void
243  const char *fullname)
244 {
245  const struct debug_sym_fns_data *debug_data
246  = ((const struct debug_sym_fns_data *)
247  objfile_data (objfile, symfile_debug_objfile_data_key));
248 
250  "qf->expand_symtabs_with_fullname (%s, \"%s\")\n",
251  objfile_debug_name (objfile), fullname);
252 
253  debug_data->real_sf->qf->expand_symtabs_with_fullname (objfile, fullname);
254 }
255 
256 static void
258  const char *name, domain_enum domain,
259  int global,
260  int (*callback) (struct block *,
261  struct symbol *, void *),
262  void *data,
264  symbol_compare_ftype *ordered_compare)
265 {
266  const struct debug_sym_fns_data *debug_data
267  = ((const struct debug_sym_fns_data *)
268  objfile_data (objfile, symfile_debug_objfile_data_key));
269 
271  "qf->map_matching_symbols (%s, \"%s\", %s, %d, %s, %s, %s, %s)\n",
273  domain_name (domain), global,
274  host_address_to_string (callback),
275  host_address_to_string (data),
276  plongest ((LONGEST) match),
277  host_address_to_string (ordered_compare));
278 
279  debug_data->real_sf->qf->map_matching_symbols (objfile, name,
280  domain, global,
281  callback, data,
282  match,
283  ordered_compare);
284 }
285 
286 static void
288  (struct objfile *objfile,
290  const lookup_name_info &lookup_name,
293  enum search_domain kind)
294 {
295  const struct debug_sym_fns_data *debug_data
296  = ((const struct debug_sym_fns_data *)
297  objfile_data (objfile, symfile_debug_objfile_data_key));
298 
300  "qf->expand_symtabs_matching (%s, %s, %s, %s, %s)\n",
302  host_address_to_string (&file_matcher),
303  host_address_to_string (&symbol_matcher),
304  host_address_to_string (&expansion_notify),
305  search_domain_name (kind));
306 
307  debug_data->real_sf->qf->expand_symtabs_matching (objfile,
308  file_matcher,
309  lookup_name,
310  symbol_matcher,
311  expansion_notify,
312  kind);
313 }
314 
315 static struct compunit_symtab *
317  struct bound_minimal_symbol msymbol,
318  CORE_ADDR pc,
319  struct obj_section *section,
320  int warn_if_readin)
321 {
322  const struct debug_sym_fns_data *debug_data
323  = ((const struct debug_sym_fns_data *)
324  objfile_data (objfile, symfile_debug_objfile_data_key));
325  struct compunit_symtab *retval;
326 
328  "qf->find_pc_sect_compunit_symtab (%s, %s, %s, %s, %d)\n",
330  host_address_to_string (msymbol.minsym),
331  hex_string (pc),
332  host_address_to_string (section),
333  warn_if_readin);
334 
335  retval
336  = debug_data->real_sf->qf->find_pc_sect_compunit_symtab (objfile, msymbol,
337  pc, section,
338  warn_if_readin);
339 
341  "qf->find_pc_sect_compunit_symtab (...) = %s\n",
342  retval
344  : "NULL");
345 
346  return retval;
347 }
348 
349 static void
351  symbol_filename_ftype *fun, void *data,
352  int need_fullname)
353 {
354  const struct debug_sym_fns_data *debug_data
355  = ((const struct debug_sym_fns_data *)
356  objfile_data (objfile, symfile_debug_objfile_data_key));
358  "qf->map_symbol_filenames (%s, %s, %s, %d)\n",
361  host_address_to_string (data),
362  need_fullname);
363 
364  debug_data->real_sf->qf->map_symbol_filenames (objfile, fun, data,
365  need_fullname);
366 }
367 
368 static struct compunit_symtab *
370  CORE_ADDR address)
371 {
372  const struct debug_sym_fns_data *debug_data
373  = ((const struct debug_sym_fns_data *)
374  objfile_data (objfile, symfile_debug_objfile_data_key));
376  "qf->find_compunit_symtab_by_address (%s, %s)\n",
378  hex_string (address));
379 
380  struct compunit_symtab *result = NULL;
381  if (debug_data->real_sf->qf->map_symbol_filenames != NULL)
382  result
384  address);
385 
387  "qf->find_compunit_symtab_by_address (...) = %s\n",
388  result
390  : "NULL");
391 
392  return result;
393 }
394 
396 {
413 };
414 
415 /* Debugging version of struct sym_probe_fns. */
416 
417 static const std::vector<probe *> &
419 {
420  const struct debug_sym_fns_data *debug_data
421  = ((const struct debug_sym_fns_data *)
422  objfile_data (objfile, symfile_debug_objfile_data_key));
423 
424  const std::vector<probe *> &retval
425  = debug_data->real_sf->sym_probe_fns->sym_get_probes (objfile);
426 
428  "probes->sym_get_probes (%s) = %s\n",
430  host_address_to_string (retval.data ()));
431 
432  return retval;
433 }
434 
435 static const struct sym_probe_fns debug_sym_probe_fns =
436 {
438 };
439 
440 /* Debugging version of struct sym_fns. */
441 
442 static void
444 {
445  const struct debug_sym_fns_data *debug_data
446  = ((const struct debug_sym_fns_data *)
447  objfile_data (objfile, symfile_debug_objfile_data_key));
448 
449  fprintf_filtered (gdb_stdlog, "sf->sym_new_init (%s)\n",
451 
452  debug_data->real_sf->sym_new_init (objfile);
453 }
454 
455 static void
457 {
458  const struct debug_sym_fns_data *debug_data
459  = ((const struct debug_sym_fns_data *)
460  objfile_data (objfile, symfile_debug_objfile_data_key));
461 
462  fprintf_filtered (gdb_stdlog, "sf->sym_init (%s)\n",
464 
465  debug_data->real_sf->sym_init (objfile);
466 }
467 
468 static void
469 debug_sym_read (struct objfile *objfile, symfile_add_flags symfile_flags)
470 {
471  const struct debug_sym_fns_data *debug_data
472  = ((const struct debug_sym_fns_data *)
473  objfile_data (objfile, symfile_debug_objfile_data_key));
474 
475  fprintf_filtered (gdb_stdlog, "sf->sym_read (%s, 0x%x)\n",
476  objfile_debug_name (objfile), (unsigned) symfile_flags);
477 
478  debug_data->real_sf->sym_read (objfile, symfile_flags);
479 }
480 
481 static void
483 {
484  const struct debug_sym_fns_data *debug_data
485  = ((const struct debug_sym_fns_data *)
486  objfile_data (objfile, symfile_debug_objfile_data_key));
487 
488  fprintf_filtered (gdb_stdlog, "sf->sym_read_psymbols (%s)\n",
490 
491  debug_data->real_sf->sym_read_psymbols (objfile);
492 }
493 
494 static void
496 {
497  const struct debug_sym_fns_data *debug_data
498  = ((const struct debug_sym_fns_data *)
499  objfile_data (objfile, symfile_debug_objfile_data_key));
500 
501  fprintf_filtered (gdb_stdlog, "sf->sym_finish (%s)\n",
503 
504  debug_data->real_sf->sym_finish (objfile);
505 }
506 
507 static void
509  const struct section_addr_info *info)
510 {
511  const struct debug_sym_fns_data *debug_data
512  = ((const struct debug_sym_fns_data *)
513  objfile_data (objfile, symfile_debug_objfile_data_key));
514 
515  fprintf_filtered (gdb_stdlog, "sf->sym_offsets (%s, %s)\n",
517  host_address_to_string (info));
518 
519  debug_data->real_sf->sym_offsets (objfile, info);
520 }
521 
522 static struct symfile_segment_data *
524 {
525  /* This API function is annoying, it doesn't take a "this" pointer.
526  Fortunately it is only used in one place where we (re-)lookup the
527  sym_fns table to use. Thus we will never be called. */
528  gdb_assert_not_reached ("debug_sym_segments called");
529 }
530 
531 static void
533 {
534  const struct debug_sym_fns_data *debug_data
535  = ((const struct debug_sym_fns_data *)
536  objfile_data (objfile, symfile_debug_objfile_data_key));
537 
538  fprintf_filtered (gdb_stdlog, "sf->sym_read_linetable (%s)\n",
540 
541  debug_data->real_sf->sym_read_linetable (objfile);
542 }
543 
544 static bfd_byte *
545 debug_sym_relocate (struct objfile *objfile, asection *sectp, bfd_byte *buf)
546 {
547  const struct debug_sym_fns_data *debug_data
548  = ((const struct debug_sym_fns_data *)
549  objfile_data (objfile, symfile_debug_objfile_data_key));
550  bfd_byte *retval;
551 
552  retval = debug_data->real_sf->sym_relocate (objfile, sectp, buf);
553 
555  "sf->sym_relocate (%s, %s, %s) = %s\n",
557  host_address_to_string (sectp),
559  host_address_to_string (retval));
560 
561  return retval;
562 }
563 
564 /* Template of debugging version of struct sym_fns.
565  A copy is made, with sym_flavour updated, and a pointer to the real table
566  installed in real_sf, and then a pointer to the copy is installed in the
567  objfile. */
568 
569 static const struct sym_fns debug_sym_fns =
570 {
582 };
583 
584 /* Free the copy of sym_fns recorded in the registry. */
585 
586 static void
588 {
589  xfree (datum);
590 }
591 
592 /* Install the debugging versions of the symfile functions for OBJFILE.
593  Do not call this if the debug versions are already installed. */
594 
595 static void
597 {
598  const struct sym_fns *real_sf;
599  struct debug_sym_fns_data *debug_data;
600 
601  /* The debug versions should not already be installed. */
603 
604  real_sf = objfile->sf;
605 
606  /* Alas we have to preserve NULL entries in REAL_SF. */
607  debug_data = XCNEW (struct debug_sym_fns_data);
608 
609 #define COPY_SF_PTR(from, to, name, func) \
610  do { \
611  if ((from)->name) \
612  (to)->debug_sf.name = func; \
613  } while (0)
614 
615  COPY_SF_PTR (real_sf, debug_data, sym_new_init, debug_sym_new_init);
616  COPY_SF_PTR (real_sf, debug_data, sym_init, debug_sym_init);
617  COPY_SF_PTR (real_sf, debug_data, sym_read, debug_sym_read);
618  COPY_SF_PTR (real_sf, debug_data, sym_read_psymbols,
620  COPY_SF_PTR (real_sf, debug_data, sym_finish, debug_sym_finish);
621  COPY_SF_PTR (real_sf, debug_data, sym_offsets, debug_sym_offsets);
622  COPY_SF_PTR (real_sf, debug_data, sym_segments, debug_sym_segments);
623  COPY_SF_PTR (real_sf, debug_data, sym_read_linetable,
625  COPY_SF_PTR (real_sf, debug_data, sym_relocate, debug_sym_relocate);
626  if (real_sf->sym_probe_fns)
628  debug_data->debug_sf.qf = &debug_sym_quick_functions;
629 
630 #undef COPY_SF_PTR
631 
632  debug_data->real_sf = real_sf;
633  set_objfile_data (objfile, symfile_debug_objfile_data_key, debug_data);
634  objfile->sf = &debug_data->debug_sf;
635 }
636 
637 /* Uninstall the debugging versions of the symfile functions for OBJFILE.
638  Do not call this if the debug versions are not installed. */
639 
640 static void
642 {
643  struct debug_sym_fns_data *debug_data;
644 
645  /* The debug versions should be currently installed. */
647 
648  debug_data = ((struct debug_sym_fns_data *)
649  objfile_data (objfile, symfile_debug_objfile_data_key));
650 
651  objfile->sf = debug_data->real_sf;
652  xfree (debug_data);
653  set_objfile_data (objfile, symfile_debug_objfile_data_key, NULL);
654 }
655 
656 /* Call this function to set OBJFILE->SF.
657  Do not set OBJFILE->SF directly. */
658 
659 void
660 objfile_set_sym_fns (struct objfile *objfile, const struct sym_fns *sf)
661 {
663  {
665  /* Remove the current one, and reinstall a new one later. */
667  }
668 
669  /* Assume debug logging is disabled. */
670  objfile->sf = sf;
671 
672  /* Turn debug logging on if enabled. */
673  if (debug_symfile)
675 }
676 
677 static void
678 set_debug_symfile (const char *args, int from_tty, struct cmd_list_element *c)
679 {
680  struct program_space *pspace;
681  struct objfile *objfile;
682 
685  {
686  if (debug_symfile)
687  {
690  }
691  else
692  {
695  }
696  }
697 }
698 
699 static void
700 show_debug_symfile (struct ui_file *file, int from_tty,
701  struct cmd_list_element *c, const char *value)
702 {
703  fprintf_filtered (file, _("Symfile debugging is %s.\n"), value);
704 }
705 
706 void
708 {
710  = register_objfile_data_with_cleanup (NULL, symfile_debug_free_objfile);
711 
713 Set debugging of the symfile functions."), _("\
714 Show debugging of the symfile functions."), _("\
715 When enabled, all calls to the symfile functions are logged."),
718 
719  /* Note: We don't need a new-objfile observer because debug logging
720  will be installed when objfile init'n calls objfile_set_sym_fns. */
721 }
void(* expand_symtabs_matching)(struct objfile *objfile, gdb::function_view< expand_symtabs_file_matcher_ftype > file_matcher, const lookup_name_info &lookup_name, gdb::function_view< expand_symtabs_symbol_matcher_ftype > symbol_matcher, gdb::function_view< expand_symtabs_exp_notify_ftype > expansion_notify, enum search_domain kind)
Definition: symfile.h:256
static void debug_qf_relocate(struct objfile *objfile, const struct section_offsets *new_offsets, const struct section_offsets *delta)
static void debug_qf_map_matching_symbols(struct objfile *objfile, const char *name, domain_enum domain, int global, int(*callback)(struct block *, struct symbol *, void *), void *data, symbol_name_match_type match, symbol_compare_ftype *ordered_compare)
static const struct sym_probe_fns debug_sym_probe_fns
const char * symtab_to_filename_for_display(struct symtab *symtab)
Definition: source.c:1168
struct sym_fns debug_sf
Definition: symfile-debug.c:43
void(* forget_cached_source_info)(struct objfile *objfile)
Definition: symfile.h:148
static void debug_sym_new_init(struct objfile *objfile)
bfd_vma CORE_ADDR
Definition: common-types.h:41
void xfree(void *)
static void debug_qf_expand_symtabs_with_fullname(struct objfile *objfile, const char *fullname)
struct program_space * pspace
Definition: objfiles.h:315
bool(* map_symtabs_matching_filename)(struct objfile *objfile, const char *name, const char *real_path, gdb::function_view< bool(symtab *)> callback)
Definition: symfile.h:163
static void debug_qf_dump(struct objfile *objfile)
enum domain_enum_tag domain_enum
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)
Definition: symfile.h:270
static void debug_qf_forget_cached_source_info(struct objfile *objfile)
void objfile_set_sym_fns(struct objfile *objfile, const struct sym_fns *sf)
static void debug_sym_finish(struct objfile *objfile)
void(* expand_symtabs_with_fullname)(struct objfile *objfile, const char *fullname)
Definition: symfile.h:208
void(* print_stats)(struct objfile *objfile)
Definition: symfile.h:183
struct compunit_symtab *(* find_compunit_symtab_by_address)(struct objfile *objfile, CORE_ADDR address)
Definition: symfile.h:279
static struct compunit_symtab * debug_qf_lookup_symbol(struct objfile *objfile, int kind, const char *name, domain_enum domain)
search_domain
Definition: symtab.h:773
#define _(String)
Definition: gdb_locale.h:35
static void debug_sym_read(struct objfile *objfile, symfile_add_flags symfile_flags)
int() symbol_compare_ftype(const char *string1, const char *string2)
Definition: symfile.h:45
static struct symtab * debug_qf_find_last_source_symtab(struct objfile *objfile)
Definition: symfile-debug.c:89
const struct sym_probe_fns * sym_probe_fns
Definition: symfile.h:365
const char * search_domain_name(enum search_domain e)
Definition: symtab.c:277
static int debug_qf_has_symbols(struct objfile *objfile)
Definition: symfile-debug.c:73
struct compunit_symtab *(* lookup_symbol)(struct objfile *objfile, int block_index, const char *name, domain_enum domain)
Definition: symfile.h:176
static const char * debug_symtab_name(struct symtab *symtab)
Definition: symfile-debug.c:65
static void debug_qf_expand_symtabs_for_function(struct objfile *objfile, const char *func_name)
static void set_debug_symfile(const char *args, int from_tty, struct cmd_list_element *c)
static int symfile_debug_installed(struct objfile *objfile)
Definition: symfile-debug.c:56
static int debug_symfile
Definition: symfile-debug.c:51
const char *const name
Definition: aarch64-tdep.c:76
static const struct sym_fns debug_sym_fns
const std::vector< probe * > &(* sym_get_probes)(struct objfile *)
Definition: symfile.h:296
static void debug_qf_expand_all_symtabs(struct objfile *objfile)
objfile(bfd *, const char *, objfile_flags)
Definition: objfiles.c:373
void fprintf_filtered(struct ui_file *stream, const char *format,...)
Definition: utils.c:2008
static const struct quick_symbol_functions debug_sym_quick_functions
static void debug_sym_offsets(struct objfile *objfile, const struct section_addr_info *info)
static void debug_qf_map_symbol_filenames(struct objfile *objfile, symbol_filename_ftype *fun, void *data, int need_fullname)
struct symtab * compunit_primary_filetab(const struct compunit_symtab *cust)
Definition: symtab.c:292
static struct compunit_symtab * debug_qf_find_pc_sect_compunit_symtab(struct objfile *objfile, struct bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin)
void _initialize_symfile_debug(void)
#define gdb_assert_not_reached(message)
Definition: gdb_assert.h:55
const struct sym_fns * sf
Definition: objfiles.h:381
void(* sym_new_init)(struct objfile *)
Definition: symfile.h:308
void(* dump)(struct objfile *objfile)
Definition: symfile.h:187
struct symtab *(* find_last_source_symtab)(struct objfile *objfile)
Definition: symfile.h:145
void(* expand_all_symtabs)(struct objfile *objfile)
Definition: symfile.h:201
static bool debug_qf_map_symtabs_matching_filename(struct objfile *objfile, const char *name, const char *real_path, gdb::function_view< bool(symtab *)> callback)
const char * domain_name(domain_enum e)
Definition: symtab.c:260
void(* expand_symtabs_for_function)(struct objfile *objfile, const char *func_name)
Definition: symfile.h:197
void(* sym_offsets)(struct objfile *, const struct section_addr_info *)
Definition: symfile.h:343
struct cmd_list_element * setdebuglist
Definition: cli-cmds.c:153
void(* sym_finish)(struct objfile *)
Definition: symfile.h:334
static struct compunit_symtab * debug_qf_find_compunit_symtab_by_address(struct objfile *objfile, CORE_ADDR address)
void(* relocate)(struct objfile *objfile, const struct section_offsets *new_offsets, const struct section_offsets *delta)
Definition: symfile.h:191
void(* sym_read_psymbols)(struct objfile *)
Definition: symfile.h:328
#define gdb_assert(expr)
Definition: gdb_assert.h:32
Definition: block.h:60
Definition: value.c:169
static void debug_qf_expand_symtabs_matching(struct objfile *objfile, gdb::function_view< expand_symtabs_file_matcher_ftype > file_matcher, const lookup_name_info &lookup_name, gdb::function_view< expand_symtabs_symbol_matcher_ftype > symbol_matcher, gdb::function_view< expand_symtabs_exp_notify_ftype > expansion_notify, enum search_domain kind)
void(* sym_read_linetable)(struct objfile *)
Definition: symfile.h:355
#define ALL_PSPACES(pspace)
Definition: progspace.h:243
static void install_symfile_debug_logging(struct objfile *objfile)
static const std::vector< probe * > & debug_sym_get_probes(struct objfile *objfile)
#define XCNEW(T)
Definition: poison.h:121
static void show_debug_symfile(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct minimal_symbol * minsym
Definition: minsyms.h:34
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
Definition: cli-decode.c:569
const char * objfile_debug_name(const struct objfile *objfile)
Definition: objfiles.c:1579
#define COPY_SF_PTR(from, to, name, func)
static void uninstall_symfile_debug_logging(struct objfile *objfile)
static void debug_sym_read_psymbols(struct objfile *objfile)
static struct symfile_segment_data * debug_sym_segments(bfd *abfd)
#define gdb_stdlog
Definition: utils.h:349
static void debug_qf_print_stats(struct objfile *objfile)
static const struct objfile_data * symfile_debug_objfile_data_key
Definition: symfile-debug.c:48
struct cmd_list_element * showdebuglist
Definition: cli-cmds.c:155
void(* map_matching_symbols)(struct objfile *, const char *name, domain_enum domain, int global, int(*callback)(struct block *, struct symbol *, void *), void *data, symbol_name_match_type match, symbol_compare_ftype *ordered_compare)
Definition: symfile.h:228
static void debug_sym_read_linetable(struct objfile *objfile)
void(* sym_init)(struct objfile *)
Definition: symfile.h:314
const struct quick_symbol_functions * qf
Definition: symfile.h:369
const struct sym_fns * real_sf
Definition: symfile-debug.c:42
int(* has_symbols)(struct objfile *objfile)
Definition: symfile.h:141
static bfd_byte * debug_sym_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
#define ALL_PSPACE_OBJFILES(ss, obj)
Definition: objfiles.h:579
bfd_byte *(* sym_relocate)(struct objfile *, asection *sectp, bfd_byte *buf)
Definition: symfile.h:361
static void symfile_debug_free_objfile(struct objfile *objfile, void *datum)
long long LONGEST
Definition: common-types.h:52
symbol_name_match_type
Definition: symtab.h:52
void(* sym_read)(struct objfile *, symfile_add_flags)
Definition: symfile.h:321
static void debug_sym_init(struct objfile *objfile)
void(* map_symbol_filenames)(struct objfile *objfile, symbol_filename_ftype *fun, void *data, int need_fullname)
Definition: symfile.h:285
void() symbol_filename_ftype(const char *filename, const char *fullname, void *data)
Definition: symfile.h:100