Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1020)

Side by Side Diff: gdb/dictionary.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/dictionary.h ('k') | gdb/disasm.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Routines for name->symbol lookups in GDB. 1 /* Routines for name->symbol lookups in GDB.
2 2
3 Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc. 3 Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
4 4
5 Contributed by David Carlton <carlton@bactrian.org> and by Kealia, 5 Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
6 Inc. 6 Inc.
7 7
8 This file is part of GDB. 8 This file is part of GDB.
9 9
10 This program is free software; you can redistribute it and/or modify 10 This program is free software; you can redistribute it and/or modify
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 491 }
492 492
493 /* Add SYM to DICT. DICT had better be expandable. */ 493 /* Add SYM to DICT. DICT had better be expandable. */
494 494
495 void 495 void
496 dict_add_symbol (struct dictionary *dict, struct symbol *sym) 496 dict_add_symbol (struct dictionary *dict, struct symbol *sym)
497 { 497 {
498 (DICT_VECTOR (dict))->add_symbol (dict, sym); 498 (DICT_VECTOR (dict))->add_symbol (dict, sym);
499 } 499 }
500 500
501 /* Utility to add a list of symbols to a dictionary.
502 DICT must be an expandable dictionary. */
503
504 void
505 dict_add_pending (struct dictionary *dict, const struct pending *symbol_list)
506 {
507 const struct pending *list;
508 int i;
509
510 for (list = symbol_list; list != NULL; list = list->next)
511 {
512 for (i = 0; i < list->nsyms; ++i)
513 dict_add_symbol (dict, list->symbol[i]);
514 }
515 }
516
501 /* Initialize ITERATOR to point at the first symbol in DICT, and 517 /* Initialize ITERATOR to point at the first symbol in DICT, and
502 return that first symbol, or NULL if DICT is empty. */ 518 return that first symbol, or NULL if DICT is empty. */
503 519
504 struct symbol * 520 struct symbol *
505 dict_iterator_first (const struct dictionary *dict, 521 dict_iterator_first (const struct dictionary *dict,
506 struct dict_iterator *iterator) 522 struct dict_iterator *iterator)
507 { 523 {
508 return (DICT_VECTOR (dict))->iterator_first (dict, iterator); 524 return (DICT_VECTOR (dict))->iterator_first (dict, iterator);
509 } 525 }
510 526
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 { 809 {
794 if (strncmp (string, "_ada_", 5) == 0) 810 if (strncmp (string, "_ada_", 5) == 0)
795 string += 5; 811 string += 5;
796 else 812 else
797 return msymbol_hash_iw (string0); 813 return msymbol_hash_iw (string0);
798 } 814 }
799 815
800 hash = 0; 816 hash = 0;
801 while (*string) 817 while (*string)
802 { 818 {
819 /* Ignore "TKB" suffixes.
820
821 These are used by Ada for subprograms implementing a task body.
822 For instance for a task T inside package Pck, the name of the
823 subprogram implementing T's body is `pck__tTKB'. We need to
824 ignore the "TKB" suffix because searches for this task body
825 subprogram are going to be performed using `pck__t' (the encoded
826 version of the natural name `pck.t'). */
827 if (strcmp (string, "TKB") == 0)
828 return hash;
829
803 switch (*string) 830 switch (*string)
804 { 831 {
805 case '$': 832 case '$':
806 case '.': 833 case '.':
807 case 'X': 834 case 'X':
808 if (string0 == string) 835 if (string0 == string)
809 return msymbol_hash_iw (string0); 836 return msymbol_hash_iw (string0);
810 else 837 else
811 return hash; 838 return hash;
812 case ' ': 839 case ' ':
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 { 943 {
917 DICT_LINEAR_EXPANDABLE_CAPACITY (dict) *= 2; 944 DICT_LINEAR_EXPANDABLE_CAPACITY (dict) *= 2;
918 DICT_LINEAR_SYMS (dict) 945 DICT_LINEAR_SYMS (dict)
919 = xrealloc (DICT_LINEAR_SYMS (dict), 946 = xrealloc (DICT_LINEAR_SYMS (dict),
920 DICT_LINEAR_EXPANDABLE_CAPACITY (dict) 947 DICT_LINEAR_EXPANDABLE_CAPACITY (dict)
921 * sizeof (struct symbol *)); 948 * sizeof (struct symbol *));
922 } 949 }
923 950
924 DICT_LINEAR_SYM (dict, nsyms - 1) = sym; 951 DICT_LINEAR_SYM (dict, nsyms - 1) = sym;
925 } 952 }
OLDNEW
« no previous file with comments | « gdb/dictionary.h ('k') | gdb/disasm.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698