• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修订版3ba6a043d4888ab5b227c98addbeffa36299ea0d (tree)
时间1991-04-19 10:55:07
作者John Gilmore <gnu@cygn...>
CommiterJohn Gilmore

Log Message

        • symtab.h (GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): New
          defines for the blocks of a blockvector that contain global and
          file-static symbols and the first of the smaller scope contours.
        • symtab.c (lookup_symbol, find_pc_symtab, find_pc_line,
          decode_line_1, make_symbol_completion_list): Use the above.
        • symtab.c (list_symbols): Process the first symbol of the
          static psymbols list.
          (types_info): Restore this function from its untimely #if 0.
          It's not perfect, but it is better than nothing.
          (_initialize_symtab): Restore "info types".

更改概述

差异

--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -854,7 +854,7 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
854854 for (s = symtab_list; s; s = s->next)
855855 {
856856 bv = BLOCKVECTOR (s);
857- b = BLOCKVECTOR_BLOCK (bv, 0);
857+ b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
858858 if (BLOCK_START (b) <= BLOCK_START (block)
859859 && BLOCK_END (b) > BLOCK_START (block))
860860 break;
@@ -889,7 +889,7 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
889889 for (s = symtab_list; s; s = s->next)
890890 {
891891 bv = BLOCKVECTOR (s);
892- block = BLOCKVECTOR_BLOCK (bv, 0);
892+ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
893893 sym = lookup_block_symbol (block, name, namespace);
894894 if (sym)
895895 {
@@ -936,7 +936,7 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
936936 if (s)
937937 {
938938 bv = BLOCKVECTOR (s);
939- block = BLOCKVECTOR_BLOCK (bv, 0);
939+ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
940940 sym = lookup_block_symbol (block, misc_function_vector[ind].name,
941941 namespace);
942942 /* sym == 0 if symbol was found in the misc_function_vector
@@ -964,7 +964,7 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
964964 {
965965 s = PSYMTAB_TO_SYMTAB(ps);
966966 bv = BLOCKVECTOR (s);
967- block = BLOCKVECTOR_BLOCK (bv, 0);
967+ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
968968 sym = lookup_block_symbol (block, name, namespace);
969969 if (!sym)
970970 fatal ("Internal: global symbol found in psymtab but not in symtab");
@@ -980,7 +980,7 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
980980 for (s = symtab_list; s; s = s->next)
981981 {
982982 bv = BLOCKVECTOR (s);
983- block = BLOCKVECTOR_BLOCK (bv, 1);
983+ block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
984984 sym = lookup_block_symbol (block, name, namespace);
985985 if (sym)
986986 {
@@ -996,7 +996,7 @@ lookup_symbol (name, block, namespace, is_a_field_of_this, symtab)
996996 {
997997 s = PSYMTAB_TO_SYMTAB(ps);
998998 bv = BLOCKVECTOR (s);
999- block = BLOCKVECTOR_BLOCK (bv, 1);
999+ block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
10001000 sym = lookup_block_symbol (block, name, namespace);
10011001 if (!sym)
10021002 fatal ("Internal: static symbol found in psymtab but not in symtab");
@@ -1197,7 +1197,7 @@ find_pc_symtab (pc)
11971197 for (s = symtab_list; s; s = s->next)
11981198 {
11991199 bv = BLOCKVECTOR (s);
1200- b = BLOCKVECTOR_BLOCK (bv, 0);
1200+ b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
12011201 if (BLOCK_START (b) <= pc
12021202 && BLOCK_END (b) > pc)
12031203 break;
@@ -1339,7 +1339,7 @@ find_pc_line (pc, notcurrent)
13391339 {
13401340 val.symtab = alt_symtab;
13411341 val.line = alt_line - 1;
1342- val.pc = BLOCK_END (BLOCKVECTOR_BLOCK (bv, 0));
1342+ val.pc = BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK));
13431343 val.end = alt_pc;
13441344 }
13451345 else
@@ -1349,7 +1349,7 @@ find_pc_line (pc, notcurrent)
13491349 val.pc = best_pc;
13501350 val.end = (best_end ? best_end
13511351 : (alt_pc ? alt_pc
1352- : BLOCK_END (BLOCKVECTOR_BLOCK (bv, 0))));
1352+ : BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK))));
13531353 }
13541354 return val;
13551355 }
@@ -1850,7 +1850,7 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line)
18501850 If file specified, use that file's per-file block to start with. */
18511851
18521852 sym = lookup_symbol (copy,
1853- (s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), 1)
1853+ (s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)
18541854 : get_selected_block ()),
18551855 VAR_NAMESPACE, 0, &sym_symtab);
18561856
@@ -2206,6 +2206,7 @@ list_symbols (regexp, class, bpt)
22062206 }
22072207 else
22082208 keep_going = 0;
2209+ continue;
22092210 }
22102211 else
22112212 {
@@ -2262,7 +2263,7 @@ list_symbols (regexp, class, bpt)
22622263 It happens that the first symtab in the list
22632264 for any given blockvector is the main file. */
22642265 if (bv != prev_bv)
2265- for (i = 0; i < 2; i++)
2266+ for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
22662267 {
22672268 b = BLOCKVECTOR_BLOCK (bv, i);
22682269 /* Skip the sort if this block is always sorted. */
@@ -2293,7 +2294,7 @@ list_symbols (regexp, class, bpt)
22932294 }
22942295 found_in_file = 1;
22952296
2296- if (class != 2 && i == 1)
2297+ if (class != 2 && i == STATIC_BLOCK)
22972298 printf_filtered ("static ");
22982299 if (class == 2
22992300 && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
@@ -2349,14 +2350,12 @@ functions_info (regexp)
23492350 list_symbols (regexp, 1, 0);
23502351 }
23512352
2352-#if 0
23532353 static void
23542354 types_info (regexp)
23552355 char *regexp;
23562356 {
23572357 list_symbols (regexp, 2, 0);
23582358 }
2359-#endif
23602359
23612360 #if 0
23622361 /* Tiemann says: "info methods was never implemented." */
@@ -2540,7 +2539,7 @@ make_symbol_completion_list (text)
25402539
25412540 for (s = symtab_list; s; s = s->next)
25422541 {
2543- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), 0);
2542+ b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
25442543
25452544 for (i = 0; i < BLOCK_NSYMS (b); i++)
25462545 if (!strncmp (SYMBOL_NAME (BLOCK_SYM (b, i)), text, text_len))
@@ -2549,7 +2548,7 @@ make_symbol_completion_list (text)
25492548
25502549 for (s = symtab_list; s; s = s->next)
25512550 {
2552- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), 1);
2551+ b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
25532552
25542553 /* Don't do this block twice. */
25552554 if (b == surrounding_static_block) continue;
@@ -2569,8 +2568,8 @@ _initialize_symtab ()
25692568 "All global and static variable names, or those matching REGEXP.");
25702569 add_info ("functions", functions_info,
25712570 "All function names, or those matching REGEXP.");
2572-#if 0
2573- /* This command has at least the following problems:
2571+
2572+ /* FIXME: This command has at least the following problems:
25742573 1. It prints builtin types (in a very strange and confusing fashion).
25752574 2. It doesn't print right, e.g. with
25762575 typedef struct foo *FOO
@@ -2580,7 +2579,7 @@ _initialize_symtab ()
25802579 there is much disagreement "info types" can be fixed). */
25812580 add_info ("types", types_info,
25822581 "All types names, or those matching REGEXP.");
2583-#endif
2582+
25842583 #if 0
25852584 add_info ("methods", methods_info,
25862585 "All method names, or those matching REGEXP::REGEXP.\n\