GDB (xrefs)
Loading...
Searching...
No Matches
cooked-index.c
Go to the documentation of this file.
1/* DIE indexing
2
3 Copyright (C) 2022-2023 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21#include "dwarf2/cooked-index.h"
22#include "dwarf2/read.h"
23#include "dwarf2/stringify.h"
24#include "dwarf2/index-cache.h"
25#include "cp-support.h"
26#include "c-lang.h"
27#include "ada-lang.h"
28#include "split-name.h"
29#include "observable.h"
30#include "run-on-main-thread.h"
31#include <algorithm>
32#include "gdbsupport/gdb-safe-ctype.h"
33#include "gdbsupport/selftest.h"
34#include <chrono>
35#include <unordered_set>
36#include "cli/cli-cmds.h"
37
38/* We don't want gdb to exit while it is in the process of writing to
39 the index cache. So, all live cooked index vectors are stored
40 here, and then these are all waited for before exit proceeds. */
41static std::unordered_set<cooked_index *> active_vectors;
42
43/* See cooked-index.h. */
44
45std::string
46to_string (cooked_index_flag flags)
47{
48 static constexpr cooked_index_flag::string_mapping mapping[] = {
49 MAP_ENUM_FLAG (IS_MAIN),
50 MAP_ENUM_FLAG (IS_STATIC),
51 MAP_ENUM_FLAG (IS_ENUM_CLASS),
52 MAP_ENUM_FLAG (IS_LINKAGE),
53 MAP_ENUM_FLAG (IS_TYPE_DECLARATION),
54 };
55
56 return flags.to_string (mapping);
57}
58
59/* See cooked-index.h. */
60
61bool
63{
64 return (lang == language_ada
65 || lang == language_c
66 || lang == language_cplus);
67}
68
69/* See cooked-index.h. */
70
71int
72cooked_index_entry::compare (const char *stra, const char *strb,
73 comparison_mode mode)
74{
75 auto munge = [] (char c) -> unsigned char
76 {
77 /* We want to sort '<' before any other printable character.
78 So, rewrite '<' to something just before ' '. */
79 if (c == '<')
80 return '\x1f';
81 return TOLOWER ((unsigned char) c);
82 };
83
84 while (*stra != '\0'
85 && *strb != '\0'
86 && (munge (*stra) == munge (*strb)))
87 {
88 ++stra;
89 ++strb;
90 }
91
92 unsigned char c1 = munge (*stra);
93 unsigned char c2 = munge (*strb);
94
95 if (c1 == c2)
96 return 0;
97
98 /* When completing, if STRB ends earlier than STRA, consider them as
99 equal. When comparing, if STRB ends earlier and STRA ends with
100 '<', consider them as equal. */
101 if (mode == COMPLETE || (mode == MATCH && c1 == munge ('<')))
102 {
103 if (c2 == '\0')
104 return 0;
105 }
106
107 return c1 < c2 ? -1 : 1;
108}
109
110#if GDB_SELF_TEST
111
112namespace {
113
114void
115test_compare ()
116{
117 /* Convenience aliases. */
118 const auto mode_compare = cooked_index_entry::MATCH;
119 const auto mode_sort = cooked_index_entry::SORT;
120 const auto mode_complete = cooked_index_entry::COMPLETE;
121
122 SELF_CHECK (cooked_index_entry::compare ("abcd", "abcd",
123 mode_compare) == 0);
124 SELF_CHECK (cooked_index_entry::compare ("abcd", "abcd",
125 mode_complete) == 0);
126
127 SELF_CHECK (cooked_index_entry::compare ("abcd", "ABCDE",
128 mode_compare) < 0);
129 SELF_CHECK (cooked_index_entry::compare ("ABCDE", "abcd",
130 mode_compare) > 0);
131 SELF_CHECK (cooked_index_entry::compare ("abcd", "ABCDE",
132 mode_complete) < 0);
133 SELF_CHECK (cooked_index_entry::compare ("ABCDE", "abcd",
134 mode_complete) == 0);
135
136 SELF_CHECK (cooked_index_entry::compare ("name", "name<>",
137 mode_compare) < 0);
138 SELF_CHECK (cooked_index_entry::compare ("name<>", "name",
139 mode_compare) == 0);
140 SELF_CHECK (cooked_index_entry::compare ("name", "name<>",
141 mode_complete) < 0);
142 SELF_CHECK (cooked_index_entry::compare ("name<>", "name",
143 mode_complete) == 0);
144
145 SELF_CHECK (cooked_index_entry::compare ("name<arg>", "name<arg>",
146 mode_compare) == 0);
147 SELF_CHECK (cooked_index_entry::compare ("name<arg>", "name<ag>",
148 mode_compare) > 0);
149 SELF_CHECK (cooked_index_entry::compare ("name<arg>", "name<arg>",
150 mode_complete) == 0);
151 SELF_CHECK (cooked_index_entry::compare ("name<arg>", "name<ag>",
152 mode_complete) > 0);
153
154 SELF_CHECK (cooked_index_entry::compare ("name<arg<more>>",
155 "name<arg<more>>",
156 mode_compare) == 0);
157
158 SELF_CHECK (cooked_index_entry::compare ("name", "name<arg<more>>",
159 mode_compare) < 0);
160 SELF_CHECK (cooked_index_entry::compare ("name<arg<more>>", "name",
161 mode_compare) == 0);
162 SELF_CHECK (cooked_index_entry::compare ("name<arg<more>>", "name<arg<",
163 mode_compare) > 0);
164 SELF_CHECK (cooked_index_entry::compare ("name<arg<more>>", "name<arg<",
165 mode_complete) == 0);
166
167 SELF_CHECK (cooked_index_entry::compare ("", "abcd", mode_compare) < 0);
168 SELF_CHECK (cooked_index_entry::compare ("", "abcd", mode_complete) < 0);
169 SELF_CHECK (cooked_index_entry::compare ("abcd", "", mode_compare) > 0);
170 SELF_CHECK (cooked_index_entry::compare ("abcd", "", mode_complete) == 0);
171
172 SELF_CHECK (cooked_index_entry::compare ("func", "func<type>",
173 mode_sort) < 0);
174 SELF_CHECK (cooked_index_entry::compare ("func<type>", "func1",
175 mode_sort) < 0);
176}
177
178} /* anonymous namespace */
179
180#endif /* GDB_SELF_TEST */
181
182/* See cooked-index.h. */
183
184const char *
185cooked_index_entry::full_name (struct obstack *storage, bool for_main) const
186{
187 const char *local_name = for_main ? name : canonical;
188
189 if ((flags & IS_LINKAGE) != 0 || parent_entry == nullptr)
190 return local_name;
191
192 const char *sep = nullptr;
193 switch (per_cu->lang ())
194 {
195 case language_cplus:
196 case language_rust:
197 sep = "::";
198 break;
199
200 case language_go:
201 case language_d:
202 case language_ada:
203 sep = ".";
204 break;
205
206 default:
207 return local_name;
208 }
209
210 parent_entry->write_scope (storage, sep, for_main);
211 obstack_grow0 (storage, local_name, strlen (local_name));
212 return (const char *) obstack_finish (storage);
213}
214
215/* See cooked-index.h. */
216
217void
218cooked_index_entry::write_scope (struct obstack *storage,
219 const char *sep,
220 bool for_main) const
221{
222 if (parent_entry != nullptr)
223 parent_entry->write_scope (storage, sep, for_main);
224 const char *local_name = for_main ? name : canonical;
225 obstack_grow (storage, local_name, strlen (local_name));
226 obstack_grow (storage, sep, strlen (sep));
227}
228
229/* See cooked-index.h. */
230
231const cooked_index_entry *
232cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag,
233 cooked_index_flag flags, const char *name,
234 const cooked_index_entry *parent_entry,
235 dwarf2_per_cu_data *per_cu)
236{
237 cooked_index_entry *result = create (die_offset, tag, flags, name,
238 parent_entry, per_cu);
239 m_entries.push_back (result);
240
241 /* An explicitly-tagged main program should always override the
242 implicit "main" discovery. */
243 if ((flags & IS_MAIN) != 0)
244 m_main = result;
245
246 return result;
247}
248
249/* See cooked-index.h. */
250
251void
253{
254 m_future = gdb::thread_pool::g_thread_pool->post_task ([this] ()
255 {
256 do_finalize ();
257 });
258}
259
260/* See cooked-index.h. */
261
262gdb::unique_xmalloc_ptr<char>
264 htab_t gnat_entries)
265{
266 std::string canonical = ada_decode (entry->name, false, false);
267 if (canonical.empty ())
268 return {};
269 std::vector<gdb::string_view> names = split_name (canonical.c_str (),
271 gdb::string_view tail = names.back ();
272 names.pop_back ();
273
274 const cooked_index_entry *parent = nullptr;
275 for (const auto &name : names)
276 {
277 uint32_t hashval = dwarf5_djb_hash (name);
278 void **slot = htab_find_slot_with_hash (gnat_entries, &name,
279 hashval, INSERT);
280 /* CUs are processed in order, so we only need to check the most
281 recent entry. */
282 cooked_index_entry *last = (cooked_index_entry *) *slot;
283 if (last == nullptr || last->per_cu != entry->per_cu)
284 {
285 gdb::unique_xmalloc_ptr<char> new_name
286 = make_unique_xstrndup (name.data (), name.length ());
287 last = create (entry->die_offset, DW_TAG_namespace,
288 0, new_name.get (), parent,
289 entry->per_cu);
290 last->canonical = last->name;
291 m_names.push_back (std::move (new_name));
292 *slot = last;
293 }
294
295 parent = last;
296 }
297
298 entry->parent_entry = parent;
299 return make_unique_xstrndup (tail.data (), tail.length ());
300}
301
302/* See cooked-index.h. */
303
304void
306{
307 auto hash_name_ptr = [] (const void *p)
308 {
309 const cooked_index_entry *entry = (const cooked_index_entry *) p;
310 return htab_hash_pointer (entry->name);
311 };
312
313 auto eq_name_ptr = [] (const void *a, const void *b) -> int
314 {
315 const cooked_index_entry *ea = (const cooked_index_entry *) a;
316 const cooked_index_entry *eb = (const cooked_index_entry *) b;
317 return ea->name == eb->name;
318 };
319
320 /* We can use pointer equality here because names come from
321 .debug_str, which will normally be unique-ified by the linker.
322 Also, duplicates are relatively harmless -- they just mean a bit
323 of extra memory is used. */
324 htab_up seen_names (htab_create_alloc (10, hash_name_ptr, eq_name_ptr,
325 nullptr, xcalloc, xfree));
326
327 auto hash_entry = [] (const void *e)
328 {
329 const cooked_index_entry *entry = (const cooked_index_entry *) e;
330 return dwarf5_djb_hash (entry->canonical);
331 };
332
333 auto eq_entry = [] (const void *a, const void *b) -> int
334 {
335 const cooked_index_entry *ae = (const cooked_index_entry *) a;
336 const gdb::string_view *sv = (const gdb::string_view *) b;
337 return (strlen (ae->canonical) == sv->length ()
338 && strncasecmp (ae->canonical, sv->data (), sv->length ()) == 0);
339 };
340
341 htab_up gnat_entries (htab_create_alloc (10, hash_entry, eq_entry,
342 nullptr, xcalloc, xfree));
343
344 for (cooked_index_entry *entry : m_entries)
345 {
346 /* Note that this code must be kept in sync with
347 language_requires_canonicalization. */
348 gdb_assert (entry->canonical == nullptr);
349 if ((entry->flags & IS_LINKAGE) != 0)
350 entry->canonical = entry->name;
351 else if (entry->per_cu->lang () == language_ada)
352 {
353 gdb::unique_xmalloc_ptr<char> canon_name
354 = handle_gnat_encoded_entry (entry, gnat_entries.get ());
355 if (canon_name == nullptr)
356 entry->canonical = entry->name;
357 else
358 {
359 entry->canonical = canon_name.get ();
360 m_names.push_back (std::move (canon_name));
361 }
362 }
363 else if (entry->per_cu->lang () == language_cplus
364 || entry->per_cu->lang () == language_c)
365 {
366 void **slot = htab_find_slot (seen_names.get (), entry,
367 INSERT);
368 if (*slot == nullptr)
369 {
370 gdb::unique_xmalloc_ptr<char> canon_name
371 = (entry->per_cu->lang () == language_cplus
372 ? cp_canonicalize_string (entry->name)
373 : c_canonicalize_name (entry->name));
374 if (canon_name == nullptr)
375 entry->canonical = entry->name;
376 else
377 {
378 entry->canonical = canon_name.get ();
379 m_names.push_back (std::move (canon_name));
380 }
381 *slot = entry;
382 }
383 else
384 {
385 const cooked_index_entry *other
386 = (const cooked_index_entry *) *slot;
387 entry->canonical = other->canonical;
388 }
389 }
390 else
391 entry->canonical = entry->name;
392 }
393
394 m_names.shrink_to_fit ();
395 m_entries.shrink_to_fit ();
396 std::sort (m_entries.begin (), m_entries.end (),
397 [] (const cooked_index_entry *a, const cooked_index_entry *b)
398 {
399 return *a < *b;
400 });
401}
402
403/* See cooked-index.h. */
404
406cooked_index_shard::find (const std::string &name, bool completing) const
407{
408 wait ();
409
410 cooked_index_entry::comparison_mode mode = (completing
413
414 auto lower = std::lower_bound (m_entries.cbegin (), m_entries.cend (), name,
415 [=] (const cooked_index_entry *entry,
416 const std::string &n)
417 {
418 return cooked_index_entry::compare (entry->canonical, n.c_str (), mode) < 0;
419 });
420
421 auto upper = std::upper_bound (m_entries.cbegin (), m_entries.cend (), name,
422 [=] (const std::string &n,
423 const cooked_index_entry *entry)
424 {
425 return cooked_index_entry::compare (entry->canonical, n.c_str (), mode) > 0;
426 });
427
428 return range (lower, upper);
429}
430
431/* See cooked-index.h. */
432
433void
434cooked_index_shard::wait (bool allow_quit) const
435{
436 if (allow_quit)
437 {
438 std::chrono::milliseconds duration { 15 };
439 while (m_future.wait_for (duration) == gdb::future_status::timeout)
440 QUIT;
441 }
442 else
443 m_future.wait ();
444}
445
447 : m_vector (std::move (vec))
448{
449 for (auto &idx : m_vector)
450 idx->finalize ();
451
452 /* ACTIVE_VECTORS is not locked, and this assert ensures that this
453 will be caught if ever moved to the background. */
454 gdb_assert (is_main_thread ());
455 active_vectors.insert (this);
456}
457
458/* See cooked-index.h. */
459
460void
462{
464
465 /* This must be set after all the finalization tasks have been
466 started, because it may call 'wait'. */
468 = gdb::thread_pool::g_thread_pool->post_task ([this, per_bfd,
469#if __cplusplus >= 201402L
470 ctx = std::move (ctx)
471#else
472 ctx
473#endif
474 ] ()
475 {
476 maybe_write_index (per_bfd, ctx);
477 });
478}
479
481{
482 /* The 'finalize' method may be run in a different thread. If
483 this object is destroyed before this completes, then the method
484 will end up writing to freed memory. Waiting for this to
485 complete avoids this problem; and the cost seems ignorable
486 because creating and immediately destroying the debug info is a
487 relatively rare thing to do. */
488 for (auto &item : m_vector)
489 item->wait (false);
490
491 /* Likewise for the index-creating future, though this one must also
492 waited for by the per-BFD object to ensure the required data
493 remains live. */
495
496 /* Remove our entry from the global list. See the assert in the
497 constructor to understand this. */
498 gdb_assert (is_main_thread ());
499 active_vectors.erase (this);
500}
501
502/* See cooked-index.h. */
503
505cooked_index::lookup (CORE_ADDR addr)
506{
507 for (const auto &index : m_vector)
508 {
509 dwarf2_per_cu_data *result = index->lookup (addr);
510 if (result != nullptr)
511 return result;
512 }
513 return nullptr;
514}
515
516/* See cooked-index.h. */
517
518std::vector<const addrmap *>
520{
521 std::vector<const addrmap *> result;
522 for (const auto &index : m_vector)
523 result.push_back (index->m_addrmap);
524 return result;
525}
526
527/* See cooked-index.h. */
528
530cooked_index::find (const std::string &name, bool completing) const
531{
532 std::vector<cooked_index_shard::range> result_range;
533 result_range.reserve (m_vector.size ());
534 for (auto &entry : m_vector)
535 result_range.push_back (entry->find (name, completing));
536 return range (std::move (result_range));
537}
538
539/* See cooked-index.h. */
540
541const cooked_index_entry *
543{
544 const cooked_index_entry *result = nullptr;
545
546 for (const auto &index : m_vector)
547 {
548 const cooked_index_entry *entry = index->get_main ();
549 /* Choose the first "main" we see. The choice among several is
550 arbitrary. See the comment by the sole caller to understand
551 the rationale for filtering by language. */
552 if (entry != nullptr
553 && !language_requires_canonicalization (entry->per_cu->lang ()))
554 {
555 result = entry;
556 break;
557 }
558 }
559
560 return result;
561}
562
563/* See cooked-index.h. */
564
565void
567{
568 auto_obstack temp_storage;
569
570 /* Ensure the index is done building. */
571 this->wait ();
572
573 gdb_printf (" entries:\n");
574 gdb_printf ("\n");
575
576 size_t i = 0;
577 for (const cooked_index_entry *entry : this->all_entries ())
578 {
579 QUIT;
580
581 gdb_printf (" [%zu] ((cooked_index_entry *) %p)\n", i++, entry);
582 gdb_printf (" name: %s\n", entry->name);
583 gdb_printf (" canonical: %s\n", entry->canonical);
584 gdb_printf (" qualified: %s\n", entry->full_name (&temp_storage, false));
585 gdb_printf (" DWARF tag: %s\n", dwarf_tag_name (entry->tag));
586 gdb_printf (" flags: %s\n", to_string (entry->flags).c_str ());
587 gdb_printf (" DIE offset: %s\n", sect_offset_str (entry->die_offset));
588
589 if (entry->parent_entry != nullptr)
590 gdb_printf (" parent: ((cooked_index_entry *) %p) [%s]\n",
591 entry->parent_entry, entry->parent_entry->name);
592 else
593 gdb_printf (" parent: ((cooked_index_entry *) 0)\n");
594
595 gdb_printf ("\n");
596 }
597
598 const cooked_index_entry *main_entry = this->get_main ();
599 if (main_entry != nullptr)
600 gdb_printf (" main: ((cooked_index_entry *) %p) [%s]\n", main_entry,
601 main_entry->name);
602 else
603 gdb_printf (" main: ((cooked_index_entry *) 0)\n");
604
605 gdb_printf ("\n");
606 gdb_printf (" address maps:\n");
607 gdb_printf ("\n");
608
609 std::vector<const addrmap *> addrmaps = this->get_addrmaps ();
610 for (i = 0; i < addrmaps.size (); ++i)
611 {
612 const addrmap &addrmap = *addrmaps[i];
613
614 gdb_printf (" [%zu] ((addrmap *) %p)\n", i, &addrmap);
615 gdb_printf ("\n");
616
617 addrmap.foreach ([arch] (CORE_ADDR start_addr, const void *obj)
618 {
619 QUIT;
620
621 const char *start_addr_str = paddress (arch, start_addr);
622
623 if (obj != nullptr)
624 {
625 const dwarf2_per_cu_data *per_cu
626 = static_cast<const dwarf2_per_cu_data *> (obj);
627 gdb_printf (" [%s] ((dwarf2_per_cu_data *) %p)\n",
628 start_addr_str, per_cu);
629 }
630 else
631 gdb_printf (" [%s] ((dwarf2_per_cu_data *) 0)\n",
632 start_addr_str);
633
634 return 0;
635 });
636
637 gdb_printf ("\n");
638 }
639}
640
641void
643 const index_cache_store_context &ctx)
644{
645 /* Wait for finalization. */
646 wait ();
647
648 /* (maybe) store an index in the cache. */
649 global_index_cache.store (per_bfd, ctx);
650}
651
652/* Wait for all the index cache entries to be written before gdb
653 exits. */
654static void
656{
657 gdb_assert (is_main_thread ());
658 for (cooked_index *item : active_vectors)
659 item->wait_completely ();
660}
661
662/* A maint command to wait for the cache. */
663
664static void
665maintenance_wait_for_index_cache (const char *args, int from_tty)
666{
668}
669
671void
673{
674#if GDB_SELF_TEST
675 selftests::register_test ("cooked_index_entry::compare", test_compare);
676#endif
677
678 add_cmd ("wait-for-index-cache", class_maintenance,
680Wait until all pending writes to the index cache have completed.\n\
681Usage: maintenance wait-for-index-cache"),
683
684 gdb::observers::gdb_exiting.attach (wait_for_index_cache, "cooked-index");
685}
const char *const name
void xfree(void *)
std::string ada_decode(const char *encoded, bool wrap, bool operators)
Definition ada-lang.c:1311
void * xcalloc(size_t number, size_t size)
Definition alloc.c:85
constexpr char c2[]
Definition 2.cc:24
constexpr char c1[]
Definition 2.cc:23
gdb::unique_xmalloc_ptr< char > c_canonicalize_name(const char *name)
Definition c-lang.c:727
gdb::future< void > m_future
iterator_range< std::vector< cooked_index_entry * >::const_iterator > range
std::vector< gdb::unique_xmalloc_ptr< char > > m_names
const cooked_index_entry * add(sect_offset die_offset, enum dwarf_tag tag, cooked_index_flag flags, const char *name, const cooked_index_entry *parent_entry, dwarf2_per_cu_data *per_cu)
gdb::unique_xmalloc_ptr< char > handle_gnat_encoded_entry(cooked_index_entry *entry, htab_t gnat_entries)
void wait(bool allow_quit=true) const
cooked_index_entry * m_main
cooked_index_entry * create(sect_offset die_offset, enum dwarf_tag tag, cooked_index_flag flags, const char *name, const cooked_index_entry *parent_entry, dwarf2_per_cu_data *per_cu)
range find(const std::string &name, bool completing) const
std::vector< cooked_index_entry * > m_entries
gdb::future< void > m_write_future
void wait_completely() override
void maybe_write_index(dwarf2_per_bfd *per_bfd, const index_cache_store_context &)
dwarf2_per_cu_data * lookup(CORE_ADDR addr)
void start_writing_index(dwarf2_per_bfd *per_bfd)
const cooked_index_entry * get_main() const
vec_type m_vector
~cooked_index() override
cooked_index(vec_type &&vec)
range_chain< cooked_index_shard::range > range
void wait() const
void dump(gdbarch *arch) const
std::vector< const addrmap * > get_addrmaps() const
range find(const std::string &name, bool completing) const
range all_entries() const
std::vector< std::unique_ptr< cooked_index_shard > > vec_type
void store(dwarf2_per_bfd *per_bfd, const index_cache_store_context &)
struct cmd_list_element * maintenancelist
Definition cli-cmds.c:143
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
Definition cli-decode.c:233
@ class_maintenance
Definition command.h:65
static std::unordered_set< cooked_index * > active_vectors
bool language_requires_canonicalization(enum language lang)
void _initialize_cooked_index()
static void wait_for_index_cache(int)
std::string to_string(cooked_index_flag flags)
static void maintenance_wait_for_index_cache(const char *args, int from_tty)
bool language_requires_canonicalization(enum language lang)
@ IS_TYPE_DECLARATION
@ IS_STATIC
@ IS_LINKAGE
@ IS_MAIN
@ IS_ENUM_CLASS
std::string to_string(cooked_index_flag flags)
gdb::unique_xmalloc_ptr< char > cp_canonicalize_string(const char *string)
Definition cp-support.c:627
language
Definition defs.h:211
@ language_ada
Definition defs.h:225
@ language_cplus
Definition defs.h:216
@ language_go
Definition defs.h:218
@ language_rust
Definition defs.h:215
@ language_c
Definition defs.h:213
@ language_d
Definition defs.h:217
#define QUIT
Definition defs.h:187
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
Definition gnu-nat.c:1861
index_cache global_index_cache
Definition index-cache.c:48
uint32_t dwarf5_djb_hash(const char *str_)
observable< int > gdb_exiting
Definition aarch64.h:67
bool is_main_thread()
std::vector< gdb::string_view > split_name(const char *name, split_style style)
Definition split-name.c:27
const char * dwarf_tag_name(unsigned tag)
Definition stringify.c:46
int foreach(addrmap_foreach_const_fn fn) const
Definition addrmap.h:102
dwarf2_per_cu_data * per_cu
void write_scope(struct obstack *storage, const char *sep, bool for_name) const
comparison_mode
@ SORT
@ COMPLETE
@ MATCH
const char * canonical
static int compare(const char *stra, const char *strb, comparison_mode mode)
const char * name
const char * full_name(struct obstack *storage, bool for_main=false) const
const cooked_index_entry * parent_entry
cooked_index_flag flags
enum language lang(bool strict_p=true) const
Definition read.h:352
static char * sect_offset_str(sect_offset offset)
Definition types.h:35
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
Definition utils.c:3166
void gdb_printf(struct ui_file *stream, const char *format,...)
Definition utils.c:1886