LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   gdb-8.1.1 versus AIX (https://www.linuxquestions.org/questions/aix-43/gdb-8-1-1-versus-aix-4175636082/)

NevemTeve 08-10-2018 06:24 AM

gdb-8.1.1 versus AIX
 
Well, there is some problem with something, I'll try to collect the details.

Testcase 1:
Code:

/usr/local/src/gdb-8.1.1/gdb/gdb ~projects/devel/test/timegm_test64
GNU gdb (GDB) 8.1.1
This GDB was configured as "powerpc-ibm-aix6.1.9.0".
Reading symbols from /home/projects/devel/test/timegm_test64...done.
dictionary.insert_symbol_hashed error:
        sym=1104dff38
        SYMBOL_LANGUAGE(sym)=2 sym->ginfo.name=Test1
        dict=1104e03e8
        dict->language=110038c98
        dict->language->la_language=0
        dict->vector=110157d50
        dict->vector->type=0
        DICT_LANGUAGE (dict)->la_language)=0
dictionary.c:711: internal-error: void insert_symbol_hashed(dictionary*, symbol*):
Assertion `SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language' failed.

Some of the debug messages are mine, here is what I hacked:
Code:

--- gdb/dictionary.cold 2018-01-12 04:09:26.000000000 +0100
+++ gdb/dictionary.c    2018-08-11 15:42:52.000000000 +0200
@@ -687,6 +687,27 @@
 
    /* We don't want to insert a symbol into a dictionary of a different
      language.  The two may not use the same hashing algorithm.  */
+  if (SYMBOL_LANGUAGE (sym) != DICT_LANGUAGE (dict)->la_language) {
+    fprintf (stderr, "dictionary.insert_symbol_hashed error:"
+            "\n\tsym=%p"
+            "\n\tSYMBOL_LANGUAGE(sym)=%llx sym->ginfo.name=%s"
+            "\n\tdict=%p"
+            "\n\tdict->language=%p"
+            "\n\tdict->language->la_language=%llx"
+            "\n\tdict->vector=%p"
+            "\n\tdict->vector->type=%llx"
+            "\n\tDICT_LANGUAGE (dict)->la_language)=%llx"
+            "\n"
+          , (void *)sym
+          , (long long)SYMBOL_LANGUAGE (sym), sym->ginfo.name
+          , (void *)dict
+          , (void *)dict->language
+          , (long long)dict->language->la_language
+          , (void *)dict->vector
+          , (long long)dict->vector->type
+          , (long long)DICT_LANGUAGE (dict)->la_language
+          );
+  }
    gdb_assert (SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language);
 
    hash = search_name_hash (SYMBOL_LANGUAGE (sym), SYMBOL_SEARCH_NAME (sym));


NevemTeve 08-10-2018 06:52 AM

Then I decided to debug gdb-8.1.1 with gdb-8.0.1, but the output of 'backtrace' was quite disheartening:
Code:

(top-gdb) run
Starting program: /usr/local/src/gdb-8.1.1/gdb/gdb ~projects/devel/test/timegm_test64
During symbol reading...Storage class 111 not recognized during scan...
[New Thread 1]
GNU gdb (GDB) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix6.1.9.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/projects/devel/test/timegm_test64...done.
[Switching to Thread 1]

Thread 2 hit Breakpoint 3, _ZL20insert_symbol_hashedP10dictionaryP6symbol (dict=0x1104e0188, sym=0x1104dfcd8) at dictionary.c:709
709                );
(top-gdb) bt
#0  _ZL20insert_symbol_hashedP10dictionaryP6symbol (dict=0x1104e0188, sym=0x1104dfcd8) at dictionary.c:709
#1  0x0000000100309cbc in _Z18dict_create_hashedP7obstack8languagePK7pending (obstack=0x11044c690, language=language_unknown,
    symbol_list=0x1104c35f0) at dictionary.c:382
During symbol reading, Method has bad physname _ZNKSt17integral_constantIbLb0EEcvbEv
.
During symbol reading, struct/union type gets multiply defined: struct initializer_list.
During symbol reading, inner block not inside outer block in _ZN20scoped_free_pendingsD2Ev.
#2  0x00000001005d6fcc in _ZL21finish_block_internalP6symbolPP7pendingP13pending_blockPK12dynamic_propmmii (symbol=0x0,
    listhead=0x1100b69a8 <file_symbols>, old_blocks=0x0, static_link=0x0, start=268436576, end=268439000, is_global=0, expandable=0)
    at buildsym.c:368
#3  0x00000001005d9950 in _Z27end_symtab_get_static_blockmii (end_addr=268439000, expandable=0, required=0) at buildsym.c:1301
#4  0x00000001005da430 in _Z10end_symtabmi (end_addr=268439000, section=0) at buildsym.c:1540
#5  0x00000001005ce85c in _ZL17read_xcoff_symtabP7objfileP14partial_symtab (objfile=0x11044c630, pst=0x110486320) at xcoffread.c:1528
#6  0x00000001005cfa38 in _ZL25xcoff_psymtab_to_symtab_1P7objfileP14partial_symtab (objfile=0x11044c630, pst=0x110486320)
    at xcoffread.c:1879
#7  0x00000001005cfbd0 in _ZL17xcoff_read_symtabP14partial_symtabP7objfile (self=0x110486320, objfile=0x11044c630) at xcoffread.c:1912
#8  0x0000000100743268 in _ZL17psymtab_to_symtabP7objfileP14partial_symtab (objfile=0x11044c630, pst=0x110486320) at psymtab.c:792
#9  0x00000001007421e0 in _ZL18psym_lookup_symbolP7objfileiPKc15domain_enum_tag (objfile=0x11044c630, block_index=0,
    name=0x1103caf30 "main", domain=VAR_DOMAIN) at psymtab.c:522
#10 0x0000000100315948 in _ZL27lookup_symbol_via_quick_fnsP7objfileiPKc15domain_enum_tag (objfile=0x11044c630, block_index=0,
    name=0x1103caf30 "main", domain=VAR_DOMAIN) at symtab.c:2384
#11 0x0000000100316088 in _ZL24lookup_symbol_in_objfileP7objfileiPKc15domain_enum_tag (objfile=0x11044c630, block_index=0,
    name=0x1103caf30 "main", domain=VAR_DOMAIN) at symtab.c:2559
#12 0x000000010031646c in _ZL32lookup_symbol_global_iterator_cbP7objfilePv (objfile=0x11044c630, cb_data=0xfffffffffffea20)
    at symtab.c:2642
#13 0x0000000100157050 in _Z45default_iterate_over_objfiles_in_search_orderP7gdbarchPFiP7objfilePvES3_S2_ (gdbarch=0x1104656a0,
    cb=@0x110179470: 0x1003163c4 <_ZL32lookup_symbol_global_iterator_cbP7objfilePv>, cb_data=0xfffffffffffea20, current_objfile=0x0)
    at objfiles.c:1549
#14 0x0000000100142db4 in _Z45gdbarch_iterate_over_objfiles_in_search_orderP7gdbarchPFiP7objfilePvES3_S2_ (gdbarch=0x1104656a0,
    cb=@0x110179470: 0x1003163c4 <_ZL32lookup_symbol_global_iterator_cbP7objfilePv>, cb_data=0xfffffffffffea20, current_objfile=0x0)
    at gdbarch.c:4825
#15 0x00000001003166ac in _Z20lookup_global_symbolPKcPK5block15domain_enum_tag (name=0x1103caf30 "main", block=0x0, domain=VAR_DOMAIN)
    at symtab.c:2688
#16 0x0000000100315c74 in _Z28basic_lookup_symbol_nonlocalPK13language_defnPKcPK5block15domain_enum_tag (
    langdef=0x110099c80 <c_language_defn>, name=0x1103caf30 "main", block=0x0, domain=VAR_DOMAIN) at symtab.c:2482
#17 0x0000000100314974 in _ZL17lookup_symbol_auxPKc22symbol_name_match_typePK5block15domain_enum_tag8languageP20field_of_this_result (
    name=0x1103caf30 "main", match_type=FULL, block=0x0, domain=VAR_DOMAIN, language=language_c, is_a_field_of_this=0x0)
    at symtab.c:2092

So it's C++ now... I cannot say I am a big fan of C++; in my experience, C++ always has been the problem, never the solution.

Anyways, what is 'Storage class 111'?

Might be related: https://stackoverflow.com/questions/...mbol-xxxxxxxxx

NevemTeve 08-11-2018 04:24 AM

There is an xcoffread.c:scan_xcoff_symtab that checks internal_syment.n_symbol for values that (most likely) come from /usr/include/storclass.h:
Code:

#define C_EXT          2      /* external symbol */
#define C_HIDEXT        107    /* Un-named external symbol */
#define C_WEAKEXT      111    /* weak external symbol */

8.0.1:
Code:

  1146        if ((cs->c_sclass == C_EXT || cs->c_sclass == C_HIDEXT)
  1147            && cs->c_naux == 1)

  1438          case C_HIDEXT:
  1439          case C_STAT:
  1440            break;

  1577        if (cs->c_sclass == C_EXT)
  1578          add_symbol_to_list (sym2, &global_symbols);
  1579        else if (cs->c_sclass == C_HIDEXT || cs->c_sclass == C_STAT)
  1580          add_symbol_to_list (sym2, &file_symbols);

  2249        switch (sclass)
  2250          {
  2251          case C_EXT:
  2252          case C_HIDEXT:
  2253            {

  2506          default:
  2507            {
  2508              complaint (&symfile_complaints,
  2509                        _("Storage class %d not recognized during scan"),
  2510                        sclass);
  2511            }

8.1.1
Code:

  1150        if (cs->c_sclass == C_EXT || cs->c_sclass == C_HIDEXT ||
  1151            cs->c_sclass == C_WEAKEXT)
  1152          {
  1153            /* Dealing with a symbol with a csect entry.  */

  1460          case C_HIDEXT:
  1461          case C_STAT:
  1462            break;

  1599        if (cs->c_sclass == C_EXT || C_WEAKEXT)
  1600          add_symbol_to_list (sym2, &global_symbols);
  1601        else if (cs->c_sclass == C_HIDEXT || cs->c_sclass == C_STAT)
  1602          add_symbol_to_list (sym2, &file_symbols);

  2268        switch (sclass)
  2269          {
  2270          case C_EXT:
  2271          case C_HIDEXT:
  2272          case C_WEAKEXT:

  2526          default:
  2527            {
  2528              complaint (&symfile_complaints,
  2529                        _("Storage class %d not recognized during scan"),
  2530                        sclass);
  2531            }

So handling C_WEAKEXT is an improvement in 8.1.1

NevemTeve 08-11-2018 06:55 AM

The programming-language-codes are also defined in storclass.h:
Code:

#define TB_C            0      /* C */
#define TB_FORTRAN      1      /* Fortran */
#define TB_PASCAL      2      /* Pascal */
#define TB_ADA          3      /* Ada */
#define TB_PLI          4      /* PL/I */
#define TB_BASIC        5      /* BASIC */
#define TB_LISP        6      /* LISP */
#define TB_COBOL        7      /* COBOL */
#define TB_MODULA2      8      /* Modula2 */
#define TB_CPLUSPLUS    9      /* C++ */
...


NevemTeve 08-11-2018 08:35 AM

Debugging the debugger
Code:

breakpoint at dictionary.c:709
print sym->ginfo
$3 = {name = 0x110497191 "Test1",
value = {ivalue = 4568514784, block = 0x1104e00e0,
        bytes = 0x1104e00e0 "", address = 4568514784,
        common_block = 0x1104e00e0, chain = 0x1104e00e0},
language_specific = {
        obstack = 0x0, demangled_name = 0x0},
language = language_c, ada_mangled = 0, section = 0}

(top-gdb) p sym->ginfo.language         
$9 = language_c

(top-gdb) p/x sym->ginfo.language
$10 = 0x2

language_c is defined in dgb/defs.h:
Code:

enum language
  {
    language_unknown,          /* Language not known */
    language_auto,              /* Placeholder for automatic setting */
    language_c,                /* C */
    language_objc,              /* Objective-C */
    language_cplus,            /* C++ */
...


NevemTeve 08-11-2018 10:08 AM

Code:

p dict
$2 = (dictionary *) 0x1104e0208

print *dict
$1 = {
  language = 0x110038c98 <unknown_language_defn>,
  vector = 0x110157d50 <_dictionary.rw_>,
  data = {
    hashed = {nbuckets = 81, buckets = 0x1104e0230},
    hashed_expandable = {nbuckets = 81, buckets = 0x1104e0230, nsyms = 0},
    linear = {nsyms = 81, syms = 0x1104e0230},
    linear_expandable = {nsyms = 81, syms = 0x1104e0230, capacity = 0}
  }
}

ptype dict->vector           
type = const struct dict_vector

print/x dict->vector[0]
$8 = {type = 0x0, free = 0x1101797c8, add_symbol = 0x1101797e0, iterator_first = 0x1101797f8,
  iterator_next = 0x110179810, iter_match_first = 0x110179828, iter_match_next = 0x110179840,
  size = 0x110179858}

dict_vector->type=0 seems to be DICT_HASHED /* Symbols are stored in a fixed-size hash table. */

NevemTeve 08-11-2018 10:45 AM

Code:

struct dictionary_hashed
{
  int nbuckets;
  struct symbol **buckets;
};

Also I have just realized that it is the very first call of 'insert_symbol_hashed', so that's why the dictionary is empty.

NevemTeve 08-11-2018 10:58 AM

'dict_create_hashed' was called with 'language=language_unknown=0'

that's called by buildsym.c:finish_block_internal

Code:

#0  _Z18dict_create_hashedP7obstack8languagePK7pending (obstack=0x11044c7b0, language=language_unknown,
    symbol_list=0x1104c3710) at dictionary.c:354
#1  0x00000001005d6fcc in _ZL21finish_block_internalP6symbolPP7pendingP13pending_blockPK12dynamic_propmmii (
    symbol=0x0, listhead=0x1100b69b8 <file_symbols>, old_blocks=0x0, static_link=0x0, start=268436576,
    end=268439000, is_global=0, expandable=0) at buildsym.c:368

Code:

  365          {
  366            BLOCK_DICT (block) =
  367              dict_create_hashed (&objfile->objfile_obstack,
  368                                  buildsym_compunit->language, *listhead);
  369          }

it is the seventh call of 'finish_block_internal'

And now here is little problem:
Code:

buildsym.c:165 static struct buildsym_compunit *buildsym_compunit;
so I couldn't use gdb to debug this variable:
Code:

(gdb) print buildsym_compunit
Attempt to use a type name as an expression

calls of finish_block_internal printing pbuildsym_compunit->objfile->original_name and symbol->ginfo.name
Code:

#1:
$1 = 0x110464a40 "/home/projects/devel/test/timegm_test64"
$2 = 0x1104980d9 "strtold"

#2:
$3 = 0x110464a40 "/home/projects/devel/test/timegm_test64"
$4 = 0x1104980f1 "select"

#3:
$5 = 0x110464a40 "/home/projects/devel/test/timegm_test64"
$6 = 0x110498101 "main"

#4:
$7 = 0x110464a40 "/home/projects/devel/test/timegm_test64"
$8 = 0x110498111 "val"

#5:
$9 = 0x110464a40 "/home/projects/devel/test/timegm_test64"
$10 = 0x110498121 "my_timegm"

#6:
$11 = 0x110464a40 "/home/projects/devel/test/timegm_test64"
$12 = 0x110498131 "Test1"

#7:
$13 = 0x110464a40 "/home/projects/devel/test/timegm_test64"
$14 = 0x0

These symbols are:
Code:

strtold  -- function: static long double strtold (...) from unistd.h
select    -- function: static int select (...) from sys/time.h
main      -- function: int main (void)
val      -- function: static int val (int len, const char *from)
my_timegm -- function: static time_t my_timegm (struct tm *tm)
Test1    -- function: static void Test1 (const char sd[8], const char st[6])


NevemTeve 08-13-2018 05:26 AM

These are the .function line from the Assembly:
Code:

        .function .strtold,.strtold,16,044,FE..strtold-.strtold
        .function .select,.select,16,044,FE..select-.select
        .function .main,.main,16,044,FE..main-.main
        .function .val,.val,16,044,FE..val-.val
        .function .my_timegm,.my_timegm,16,044,FE..my_timegm-.my_timegm
        .function .Test1,.Test1,16,044,FE..Test1-.Test1

Maybe the relevant part in the binary executable:
Code:

  165f0: 2e 68 00 3c  62 75 69 6c  74 2d 69 6e  3e 00 2e 73  .h.<built-in>..s
  16600: 74 72 74 6f  6c 64 00 2e  62 66 00 2e  65 66 00 2e  trtold..bf..ef..
  16610: 73 65 6c 65  63 74 00 2e  6d 61 69 6e  00 2e 76 61  select..main..va
  16620: 6c 00 2e 6d  79 5f 74 69  6d 65 67 6d  00 2e 54 65  l..my_timegm..Te
  16630: 73 74 31 00  5f 74 69 6d  65 67 6d 74  65 73 74 2e  st1._timegmtest.
  16640: 72 77 5f 00  2e 2e 2f 2e  2e 2f 2e 2e  2f 2e 2e 2f  rw_.../../../../

Edit: it is the string-table

NevemTeve 08-13-2018 07:18 AM

calling chain:
Code:

#0 dictionary.c:711:insert_symbol_hashed detecting the problem

#1 dictionary.c:382:dict_create_hashed -> dictionary.c:681:insert_symbol_hashed

#2 buildsym.c:368:finish_block_internal -> dictionary.c:349:dict_create_hashed

#3 buildsym.c:1301:end_symtab_get_static_block -> buildsym.c:332:finish_block_internal

#4 buildsym.c:1540:end_symtab -> buildsym.c:1218:end_symtab_get_static_block

#5 xcoffread.c:1528:read_xcoff_symtab -> buildsym.c:1536:end_symtab

#6 xcoffread.c:1879:xcoff_psymtab_to_symtab_1 -> xcoffread.c:1007:read_xcoff_symtab

#7 xcoffread.c:1912:xcoff_read_symtab -> xcoffread.c:1839:xcoff_psymtab_to_symtab_1

#8 psymtab.c:792:psymtab_to_symtab-> xcoffread.c:1889:xcoff_read_symtab

#9 psymtab.c:522:psym_lookup_symbol-> psymtab.c:776:psymtab_to_symtab


NevemTeve 08-13-2018 10:18 AM

Symbols processed by read_xcoff_symtab:
Code:

$1 = 0x110473b45 "timegm_test.c"
$2 = 0x110473b53 "/usr/include/stdlib.h"
$6 = 0x110473b81 "<built-in>"
$8 = 0x110473a67 ".text"
$9 = 0x1104746e4 "__int128:t1=@s128;r1;02"
$391 = 0x110473b8c ".strtold"
$392 = 0x11047a5c2 "strtold:f-14"
$393 = 0x110473b95 ".bf"
$399 = 0x110473b9d ".select"
$446 = 0x110473bbb ".Test1"
$447 = 0x11047a792 "Test1:f-11"
$448 = 0x110473b95 ".bf"
$449 = 0x11047a7a1 "sd:p524"
$455 = 0x110473b99 ".ef"
$458 = 0x110473bc2 "_timegmtest.rw_"
$459 = 0x110473bc2 "_timegmtest.rw_"

Printing more information:
Code:

name="timegm_test.c" symnum=218 naux=0 sclass=103 C_FILE secnum=-2 type=2 value=692 0x2b4
name="/usr/include/stdlib.h" symnum=219 naux=0 sclass=108 C_BINCL secnum=-2 type=0
name="/usr/include/stdlib.h" symnum=220 naux=0 sclass=109 C_EINCL secnum=-2 type=0
name="/usr/include/sys/time.h" symnum=221 naux=0 sclass=108 secnum=-2 type=0
name="/usr/include/sys/time.h" symnum=222 naux=0 sclass=109 secnum=-2 type=0
name="<built-in>" symnum=223 naux=0 sclass=108 secnum=-2 type=0
name="<built-in>" symnum=224 naux=0 sclass=109 secnum=-2 type=0
name=".text" symnum=225 naux=1 sclass=107 C_HIDEXT secnum=1 type=0
name="__int128 unsigned:t2=@s128;r2;0;03777777777777777777777777777777777777777777;" symnum=228 naux=0 sclass=140 secnum=-2 type=0
name="size_t:t3=-32" symnum=229 naux=0 sclass=140 C_DECL secnum=-2 type=0

name=".my_timegm" symnum=652 naux=2 sclass=107 secnum=1 type=32
name="my_timegm:f70" symnum=655 naux=0 sclass=142 C_FUN secnum=-2 type=0
name=".bf" symnum=656 naux=1 sclass=101 secnum=1 type=0
name="tm:p526=*515" symnum=658 naux=0 sclass=130 C_PSYM secnum=-2 type=0
name="year:-1" symnum=659 naux=0 sclass=129 C_LSYM secnum=-2 type=0
name="ytmp:-1" symnum=660 naux=0 sclass=129 secnum=-2 type=0
name="dtmp:-1" symnum=661 naux=0 sclass=129 secnum=-2 type=0
name="ytmpe:-1" symnum=662 naux=0 sclass=129 secnum=-2 type=0
name="dtmpe:-1" symnum=663 naux=0 sclass=129 secnum=-2 type=0
name="isleapyear:-1" symnum=664 naux=0 sclass=129 secnum=-2 type=0
name=".bs" symnum=665 naux=0 sclass=143 C_BSTAT secnum=1 type=0
name="msum:V527=ar13;0;01;528=ar13;0;013;-1" symnum=666 naux=0 sclass=133 C_STSYM secnum=-2 type=0
name=".es" symnum=667 naux=0 sclass=144 C_ESTAT secnum=1 type=0
name=".bs" symnum=668 naux=0 sclass=143 secnum=1 type=0
name="mlen:V527" symnum=669 naux=0 sclass=133 secnum=-2 type=0
name=".es" symnum=670 naux=0 sclass=144 secnum=1 type=0
name="t:-31" symnum=671 naux=0 sclass=129 secnum=-2 type=0
name=".ef" symnum=672 naux=1 sclass=101 secnum=1 type=0

name=".Test1" symnum=674 naux=2 sclass=107 secnum=1 type=32
name="Test1:f-11" symnum=677 naux=0 sclass=142 C_FUN secnum=-2 type=0
name=".bf" symnum=678 naux=1 sclass=101 secnum=1 type=0
name="sd:p524" symnum=680 naux=0 sclass=130 secnum=-2 type=0
name="st:p524" symnum=681 naux=0 sclass=130 secnum=-2 type=0
name="tmi:515" symnum=682 naux=0 sclass=129 secnum=-2 type=0
name="tmo:515" symnum=683 naux=0 sclass=129 secnum=-2 type=0
name="t:70" symnum=684 naux=0 sclass=129 secnum=-2 type=0
name="mysdt:529=ar13;0;017;-2" symnum=685 naux=0 sclass=129 secnum=-2 type=0
name=".ef" symnum=686 naux=1 sclass=101 C_FCN secnum=1 type=0

name="_timegmtest.rw_" symnum=688 naux=1 sclass=107 C_HIDEXT secnum=1 type=0
name="_timegmtest.rw_" symnum=690 naux=1 sclass=107 secnum=2 type=0


NevemTeve 08-14-2018 08:58 AM

Within dict_create_hashed:
Code:

(top-gdb) p language
$1 = language_unknown

(top-gdb) p nsyms
$11 = 400

(top-gdb) p nbuckets
$12 = 81

(top-gdb) p list_counter->nsyms
$20 = 100

(top-gdb) p symbol_list.symbol[99][0]
$19 = {ginfo = {name = 0x110498119 "Test1", value = {ivalue = 4568518752, block = 0x1104e1060, bytes = 0x1104e1060 "",
      address = 4568518752, common_block = 0x1104e1060, chain = 0x1104e1060}, language_specific = {obstack = 0x0,
      demangled_name = 0x0}, language = language_c, ada_mangled = 0, section = 0}, type = 0x1104e0d00,
      owner = {symtab = 0x0, arch = 0x0},
      domain = VAR_DOMAIN, aclass_index = 10, is_objfile_owned = 1, is_argument = 0, is_inlined = 0,
      subclass = SYMBOL_NONE, line = 0, aux_value = 0x0, hash_next = 0x0}


NevemTeve 08-14-2018 09:31 AM

'buildsym.c:finish_block_internal' calls 'dict_create_hashed':
Code:

  350    if (symbol)
  351      {
  352        BLOCK_DICT (block)
  353          = dict_create_linear (&objfile->objfile_obstack,
  354                                pbuildsym_compunit->language, *listhead);
  355      }
  356    else
  357      {
  358        if (expandable)
  359          {
  360            BLOCK_DICT (block)
  361              = dict_create_hashed_expandable (pbuildsym_compunit->language);
  362            dict_add_pending (BLOCK_DICT (block), *listhead);
  363          }
  364        else
  365          {
  366            BLOCK_DICT (block) =
  367              dict_create_hashed (&objfile->objfile_obstack,
  368                                  pbuildsym_compunit->language, *listhead);
  369          }
  370      }

within finish_block_internal:
Code:

(gdb)p pbuildsym_compunit[0]
$3 = {objfile = 0x11044d610, subfiles = 0x1104ba470, main_subfile = 0x1104ba470, comp_dir = 0x0, producer = 0x0,
  debugformat = 0x100b41250 <file_system_kind_dos_based+2944> "XCOFF64",
  compunit_symtab = 0x110487bf8,
  language = language_unknown}

Also we have this function:
Code:

static struct buildsym_compunit *     
start_buildsym_compunit (struct objfile *objfile, const char *comp_dir,
                        enum language language)

Code:

Thread 2 hit Breakpoint 7, _ZL23start_buildsym_compunitP7objfilePKc8language (objfile=0x11044d610, comp_dir=0x0,
    language=language_unknown) at buildsym.c:777
Thread 2 hit Breakpoint 7, _ZL23start_buildsym_compunitP7objfilePKc8language (objfile=0x11044d610, comp_dir=0x0,
    language=language_unknown) at buildsym.c:777

It is called twice, with the same parameters (language=language_unknown), perhaps the second is the problematic.

Code:

buildsym.c:1060:start_symtab -> start_buildsym_compunit:772

xcoffread.c:1355:read_xcoff_symtab -> buildsym.c:1055:start_symtab (..., language_unknown)



All times are GMT -5. The time now is 05:48 PM.