Home | History | Annotate | Download | only in binutils

Lines Matching refs:info

339 stab_write_symbol (struct stab_write_handle *info, int type, int desc,
351 h = string_hash_lookup (&info->strhash, string, TRUE, TRUE);
362 strx = info->strings_size;
364 if (info->last_string == NULL)
365 info->strings = h;
367 info->last_string->next = h;
368 info->last_string = h;
369 info->strings_size += strlen (string) + 1;
374 bfd_put_32 (info->abfd, strx, sym);
375 bfd_put_8 (info->abfd, type, sym + 4);
376 bfd_put_8 (info->abfd, 0, sym + 5);
377 bfd_put_16 (info->abfd, desc, sym + 6);
378 bfd_put_32 (info->abfd, value, sym + 8);
380 if (info->symbols_size + STAB_SYMBOL_SIZE > info->symbols_alloc)
382 info->symbols_alloc *= 2;
383 info->symbols = (bfd_byte *) xrealloc (info->symbols,
384 info->symbols_alloc);
387 memcpy (info->symbols + info->symbols_size, sym, STAB_SYMBOL_SIZE);
389 info->symbols_size += STAB_SYMBOL_SIZE;
397 stab_push_string (struct stab_write_handle *info, const char *string,
413 s->next = info->type_stack;
414 info->type_stack = s;
422 stab_push_defined_type (struct stab_write_handle *info, long tindex,
428 return stab_push_string (info, buf, tindex, FALSE, size);
435 stab_pop_type (struct stab_write_handle *info)
440 s = info->type_stack;
443 info->type_stack = s->next;
469 struct stab_write_handle info;
473 info.abfd = abfd;
475 info.symbols_size = 0;
476 info.symbols_alloc = 500;
477 info.symbols = (bfd_byte *) xmalloc (info.symbols_alloc);
479 info.strings = NULL;
480 info.last_string = NULL;
482 info.strings_size = 1;
484 if (!bfd_hash_table_init (&info.strhash.table, string_hash_newfunc,
486 || !bfd_hash_table_init (&info.typedef_hash.table, string_hash_newfunc,
494 info.type_stack = NULL;
495 info.type_index = 1;
496 memset (&info.type_cache, 0, sizeof info.type_cache);
497 info.so_offset = -1;
498 info.fun_offset = -1;
499 info.last_text_address = 0;
500 info.nesting = 0;
501 info.fnaddr = 0;
502 info.pending_lbrac = (bfd_vma) -1;
505 if (! stab_write_symbol (&info, 0, 0, 0, (const char *) NULL))
509 info.so_offset = info.symbols_size;
510 if (! stab_write_symbol (&info, N_SO, 0, 0, bfd_get_filename (abfd)))
513 if (! debug_write (dhandle, &stab_fns, (void *) &info))
516 assert (info.pending_lbrac == (bfd_vma) -1);
519 if (! stab_write_symbol (&info, N_SO, 0, info.last_text_address,
524 bfd_put_32 (abfd, info.strings_size, info.symbols + 8);
526 *psyms = info.symbols;
527 *psymsize = info.symbols_size;
529 *pstringsize = info.strings_size;
530 info.strings_size);
534 for (h = info.strings; h != NULL; h = h->next)
548 struct stab_write_handle *info = (struct stab_write_handle *) p;
555 info->lineno_filename = filename;
557 return stab_write_symbol (info, N_SOL, 0, 0, filename);
565 struct stab_write_handle *info = (struct stab_write_handle *) p;
571 info->lineno_filename = filename;
573 return stab_write_symbol (info, N_SOL, 0, 0, filename);
582 struct stab_write_handle *info = (struct stab_write_handle *) p;
587 if (info->type_cache.void_type != 0)
588 return stab_push_defined_type (info, info->type_cache.void_type, 0);
594 tindex = info->type_index;
595 ++info->type_index;
599 return stab_push_string (info, buf, tindex, FALSE, 0);
608 struct stab_write_handle *info = (struct stab_write_handle *) p;
610 if (info->type_cache.void_type != 0)
611 return stab_push_defined_type (info, info->type_cache.void_type, 0);
617 tindex = info->type_index;
618 ++info->type_index;
620 info->type_cache.void_type = tindex;
624 return stab_push_string (info, buf, tindex, TRUE, 0);
633 struct stab_write_handle *info = (struct stab_write_handle *) p;
643 cache = info->type_cache.signed_integer_types;
645 cache = info->type_cache.unsigned_integer_types;
648 return stab_push_defined_type (info, cache[size - 1], size);
654 tindex = info->type_index;
655 ++info->type_index;
684 return stab_push_string (info, buf, tindex, TRUE, size);
693 struct stab_write_handle *info = (struct stab_write_handle *) p;
696 && size - 1 < (sizeof info->type_cache.float_types
697 / sizeof info->type_cache.float_types[0])
698 && info->type_cache.float_types[size - 1] != 0)
699 return stab_push_defined_type (info,
700 info->type_cache.float_types[size - 1],
709 if (! stab_int_type (info, 4, FALSE))
711 int_type = stab_pop_type (info);
713 tindex = info->type_index;
714 ++info->type_index;
717 && size - 1 < (sizeof info->type_cache.float_types
718 / sizeof info->type_cache.float_types[0]))
719 info->type_cache.float_types[size - 1] = tindex;
725 return stab_push_string (info, buf, tindex, TRUE, size);
734 struct stab_write_handle *info = (struct stab_write_handle *) p;
738 tindex = info->type_index;
739 ++info->type_index;
743 return stab_push_string (info, buf, tindex, TRUE, size * 2);
752 struct stab_write_handle *info = (struct stab_write_handle *) p;
775 return stab_push_defined_type (info, tindex, size);
784 struct stab_write_handle *info = (struct stab_write_handle *) p;
798 if (! stab_push_string (info, buf, 0, FALSE, 4))
816 tindex = info->type_index;
817 ++info->type_index;
828 if (! stab_push_string (info, buf, 0, FALSE, 4))
834 if (! stab_write_symbol (info, N_LSYM, 0, 0, buf)
835 || ! stab_push_defined_type (info, tindex, 4))
848 stab_modify_type (struct stab_write_handle *info, int mod,
855 assert (info->type_stack != NULL);
856 targindex = info->type_stack->index;
866 definition = info->type_stack->definition;
867 s = stab_pop_type (info);
871 if (! stab_push_string (info, buf, 0, definition, size))
893 if (tindex != 0 && ! info->type_stack->definition)
901 free (stab_pop_type (info));
902 if (! stab_push_defined_type (info, tindex, size))
907 tindex = info->type_index;
908 ++info->type_index;
910 s = stab_pop_type (info);
917 if (! stab_push_string (info, buf, tindex, TRUE, size))
932 struct stab_write_handle *info = (struct stab_write_handle *) p;
935 return stab_modify_type (info, '*', 4, &info->type_cache.pointer_types,
936 &info->type_cache.pointer_types_alloc);
945 struct stab_write_handle *info = (struct stab_write_handle *) p;
953 if (! info->type_stack->definition)
954 free (stab_pop_type (info));
959 s = stab_pop_type (info);
965 if (! stab_write_symbol (info, N_LSYM, 0, 0, buf))
972 return stab_modify_type (info, 'f', 0, &info->type_cache.function_types,
973 &info->type_cache.function_types_alloc);
981 struct stab_write_handle *info = (struct stab_write_handle *) p;
984 return stab_modify_type (info, '&', 4, &info->type_cache.reference_types,
985 &info->type_cache.reference_types_alloc);
993 struct stab_write_handle *info = (struct stab_write_handle *) p;
998 definition = info->type_stack->definition;
999 size = info->type_stack->size;
1001 s = stab_pop_type (info);
1006 if (! stab_push_string (info, buf, 0, definition, size))
1020 struct stab_write_handle *info = (struct stab_write_handle *) p;
1027 definition = info->type_stack->definition;
1028 range = stab_pop_type (info);
1030 definition = definition || info->type_stack->definition;
1031 element_size = info->type_stack->size;
1032 element = stab_pop_type (info);
1045 tindex = info->type_index;
1046 ++info->type_index;
1060 if (! stab_push_string (info, buf, tindex, definition, size))
1073 struct stab_write_handle *info = (struct stab_write_handle *) p;
1078 definition = info->type_stack->definition;
1080 s = stab_pop_type (info);
1092 tindex = info->type_index;
1093 ++info->type_index;
1101 if (! stab_push_string (info, buf, tindex, definition, 0))
1114 struct stab_write_handle *info = (struct stab_write_handle *) p;
1118 definition = info->type_stack->definition;
1119 target = stab_pop_type (info);
1121 definition = definition || info->type_stack->definition;
1122 base = stab_pop_type (info);
1129 if (! stab_push_string (info, buf, 0, definition, 0))
1143 struct stab_write_handle *info = (struct stab_write_handle *) p;
1162 definition = info->type_stack->definition;
1163 domain = stab_pop_type (info);
1182 definition = definition || info->type_stack->definition;
1183 args[0] = stab_pop_type (info);
1192 definition = definition || info->type_stack->definition;
1193 args[i] = stab_pop_type (info);
1199 definition = definition || info->type_stack->definition;
1200 args[argcount] = stab_pop_type (info);
1205 definition = definition || info->type_stack->definition;
1206 return_type = stab_pop_type (info);
1228 if (! stab_push_string (info, buf, 0, definition, 0))
1241 struct stab_write_handle *info = (struct stab_write_handle *) p;
1243 return stab_modify_type (info, 'k', info->type_stack->size,
1252 struct stab_write_handle *info = (struct stab_write_handle *) p;
1254 return stab_modify_type (info, 'B', info->type_stack->size,
1262 stab_get_struct_index (struct stab_write_handle *info, const char *tag,
1266 if (id >= info->type_cache.struct_types_alloc)
1270 alloc = info->type_cache.struct_types_alloc;
1275 info->type_cache.struct_types =
1276 (struct stab_tag *) xrealloc (info->type_cache.struct_types,
1278 memset ((info->type_cache.struct_types
1279 + info->type_cache.struct_types_alloc),
1281 ((alloc - info->type_cache.struct_types_alloc)
1283 info->type_cache.struct_types_alloc = alloc;
1286 if (info->type_cache.struct_types[id].index == 0)
1288 info->type_cache.struct_types[id].index = info->type_index;
1289 ++info->type_index;
1290 info->type_cache.struct_types[id].tag = tag;
1291 info->type_cache.struct_types[id].kind = kind;
1297 info->type_cache.struct_types[id].kind = kind;
1298 info->type_cache.struct_types[id].size = *psize;
1301 *psize = info->type_cache.struct_types[id].size;
1303 return info->type_cache.struct_types[id].index;
1313 struct stab_write_handle *info = (struct stab_write_handle *) p;
1326 tindex = stab_get_struct_index (info, tag, id, DEBUG_KIND_ILLEGAL,
1338 if (! stab_push_string (info, buf, tindex, definition, size))
1341 info->type_stack->fields = (char *) xmalloc (1);
1342 info->type_stack->fields[0] = '\0';
1353 struct stab_write_handle *info = (struct stab_write_handle *) p;
1359 definition = info->type_stack->definition;
1360 size = info->type_stack->size;
1361 s = stab_pop_type (info);
1366 assert (info->type_stack->fields != NULL);
1367 n = (char *) xmalloc (strlen (info->type_stack->fields)
1395 bfd_get_filename (info->abfd), name);
1398 sprintf (n, "%s%s:%s%s,%ld,%ld;", info->type_stack->fields, name, vis, s,
1401 free (info->type_stack->fields);
1402 info->type_stack->fields = n;
1405 info->type_stack->definition = TRUE;
1415 struct stab_write_handle *info = (struct stab_write_handle *) p;
1421 assert (info->type_stack != NULL && info->type_stack->fields != NULL);
1423 definition = info->type_stack->definition;
1424 tindex = info->type_stack->index;
1425 size = info->type_stack->size;
1426 fields = info->type_stack->fields;
1427 first = stab_pop_type (info);
1434 if (! stab_push_string (info, buf, tindex, definition, size))
1447 struct stab_write_handle *info = (struct stab_write_handle *) p;
1458 definition = info->type_stack->definition;
1459 vstring = stab_pop_type (info);
1471 assert (info->type_stack->index > 0);
1473 sprintf (vtable, "~%%%ld", info->type_stack->index);
1482 info->type_stack->vtable = vtable;
1486 info->type_stack->definition = TRUE;
1497 struct stab_write_handle *info = (struct stab_write_handle *) p;
1502 definition = info->type_stack->definition;
1503 s = stab_pop_type (info);
1508 assert (info->type_stack->fields != NULL);
1509 n = (char *) xmalloc (strlen (info->type_stack->fields)
1533 sprintf (n, "%s%s:%s%s:%s;", info->type_stack->fields, name, vis, s,
1536 free (info->type_stack->fields);
1537 info->type_stack->fields = n;
1540 info->type_stack->definition = TRUE;
1551 struct stab_write_handle *info = (struct stab_write_handle *) p;
1558 definition = info->type_stack->definition;
1559 s = stab_pop_type (info);
1588 assert (info->type_stack != NULL && info->type_stack->fields != NULL);
1590 if (info->type_stack->baseclasses == NULL)
1595 while (info->type_stack->baseclasses[c] != NULL)
1599 baseclasses = (char **) xrealloc (info->type_stack->baseclasses,
1604 info->type_stack->baseclasses = baseclasses;
1607 info->type_stack->definition = TRUE;
1617 struct stab_write_handle *info = (struct stab_write_handle *) p;
1620 assert (info->type_stack != NULL && info->type_stack->fields != NULL);
1622 if (info->type_stack->methods == NULL)
1629 m = (char *) xrealloc (info->type_stack->methods,
1630 (strlen (info->type_stack->methods)
1637 info->type_stack->methods = m;
1645 stab_class_method_var (struct stab_write_handle *info, const char *physname,
1656 definition = info->type_stack->definition;
1657 type = stab_pop_type (info);
1661 definition = definition || info->type_stack->definition;
1662 context = stab_pop_type (info);
1665 assert (info->type_stack != NULL && info->type_stack->methods != NULL);
1707 info->type_stack->methods =
1708 (char *) xrealloc (info->type_stack->methods,
1709 (strlen (info->type_stack->methods)
1715 sprintf (info->type_stack->methods + strlen (info->type_stack->methods),
1721 sprintf (info->type_stack->methods + strlen (info->type_stack->methods),
1727 info->type_stack->definition = TRUE;
1740 struct stab_write_handle *info = (struct stab_write_handle *) p;
1742 return stab_class_method_var (info, physname, visibility, FALSE, constp,
1753 struct stab_write_handle *info = (struct stab_write_handle *) p;
1755 return stab_class_method_var (info, physname, visibility, TRUE, constp,
1764 struct stab_write_handle *info = (struct stab_write_handle *) p;
1766 assert (info->type_stack != NULL && info->type_stack->methods != NULL);
1768 /* We allocated enough room on info->type_stack->methods to add the
1770 strcat (info->type_stack->methods, ";");
1780 struct stab_write_handle *info = (struct stab_write_handle *) p;
1785 assert (info->type_stack != NULL && info->type_stack->fields != NULL);
1789 len = (strlen (info->type_stack->string)
1790 + strlen (info->type_stack->fields)
1792 if (info->type_stack->baseclasses != NULL)
1795 for (i = 0; info->type_stack->baseclasses[i] != NULL; i++)
1796 len += strlen (info->type_stack->baseclasses[i]);
1798 if (info->type_stack->methods != NULL)
1799 len += strlen (info->type_stack->methods);
1800 if (info->type_stack->vtable != NULL)
1801 len += strlen (info->type_stack->vtable);
1807 strcpy (buf, info->type_stack->string);
1809 if (info->type_stack->baseclasses != NULL)
1812 for (i = 0; info->type_stack->baseclasses[i] != NULL; i++)
1814 strcat (buf, info->type_stack->baseclasses[i]);
1815 free (info->type_stack->baseclasses[i]);
1817 free (info->type_stack->baseclasses);
1818 info->type_stack->baseclasses = NULL;
1821 strcat (buf, info->type_stack->fields);
1822 free (info->type_stack->fields);
1823 info->type_stack->fields = NULL;
1825 if (info->type_stack->methods != NULL)
1827 strcat (buf, info->type_stack->methods);
1828 free (info->type_stack->methods);
1829 info->type_stack->methods = NULL;
1834 if (info->type_stack->vtable != NULL)
1836 strcat (buf, info->type_stack->vtable);
1837 free (info->type_stack->vtable);
1838 info->type_stack->vtable = NULL;
1843 free (info->type_stack->string);
1844 info->type_stack->string = buf;
1854 struct stab_write_handle *info = (struct stab_write_handle *) p;
1857 h = string_hash_lookup (&info->typedef_hash, name, FALSE, FALSE);
1860 return stab_push_defined_type (info, h->index, h->size);
1869 struct stab_write_handle *info = (struct stab_write_handle *) p;
1873 tindex = stab_get_struct_index (info, name, id, kind, &size);
1877 return stab_push_defined_type (info, tindex, size);
1885 struct stab_write_handle *info = (struct stab_write_handle *) p;
1891 tindex = info->type_stack->index;
1892 size = info->type_stack->size;
1893 s = stab_pop_type (info);
1901 tindex = info->type_index;
1902 ++info->type_index;
1908 if (! stab_write_symbol (info, N_LSYM, 0, 0, buf))
1913 h = string_hash_lookup (&info->typedef_hash, name, TRUE, FALSE);
1934 struct stab_write_handle *info = (struct stab_write_handle *) p;
1937 s = stab_pop_type (info);
1944 if (! stab_write_symbol (info, N_LSYM, 0, 0, buf))
1957 struct stab_write_handle *info = (struct stab_write_handle *) p;
1963 if (! stab_write_symbol (info, N_LSYM, 0, 0, buf))
1976 struct stab_write_handle *info = (struct stab_write_handle *) p;
1982 if (! stab_write_symbol (info, N_LSYM, 0, 0, buf))
1995 struct stab_write_handle *info = (struct stab_write_handle *) p;
1998 s = stab_pop_type (info);
2004 if (! stab_write_symbol (info, N_LSYM, 0, 0, buf))
2018 struct stab_write_handle *info = (struct stab_write_handle *) p;
2023 s = stab_pop_type (info);
2055 tindex = info->type_index;
2056 ++info->type_index;
2074 if (! stab_write_symbol (info, stab_type, 0, val, buf))
2087 struct stab_write_handle *info = (struct stab_write_handle *) p;
2090 assert (info->nesting == 0 && info->fun_offset == -1);
2092 rettype = stab_pop_type (info);
2100 info->fun_offset = info->symbols_size;
2102 if (! stab_write_symbol (info, N_FUN, 0, 0, buf))
2115 struct stab_write_handle *info = (struct stab_write_handle *) p;
2120 s = stab_pop_type (info);
2152 if (! stab_write_symbol (info, stab_type, 0, val, buf))
2165 struct stab_write_handle *info = (struct stab_write_handle *) p;
2170 if (info->so_offset != -1)
2172 bfd_put_32 (info->abfd, addr, info->symbols + info->so_offset + 8);
2173 info->so_offset = -1;
2176 if (info->fun_offset != -1)
2178 bfd_put_32 (info->abfd, addr, info->symbols + info->fun_offset + 8);
2179 info->fun_offset = -1;
2182 ++info->nesting;
2188 if (info->nesting == 1)
2190 info->fnaddr = addr;
2199 if (info->pending_lbrac != (bfd_vma) -1)
2201 if (! stab_write_symbol (info, N_LBRAC, 0, info->pending_lbrac,
2208 info->pending_lbrac = addr - info->fnaddr;
2218 struct stab_write_handle *info = (struct stab_write_handle *) p;
2220 if (addr > info->last_text_address)
2221 info->last_text_address = addr;
2224 if (info->pending_lbrac != (bfd_vma) -1)
2226 if (! stab_write_symbol (info, N_LBRAC, 0, info->pending_lbrac,
2229 info->pending_lbrac = (bfd_vma) -1;
2232 assert (info->nesting > 0);
2234 --info->nesting;
2237 if (info->nesting == 0)
2240 return stab_write_symbol (info, N_RBRAC, 0, addr - info->fnaddr,
2257 struct stab_write_handle *info = (struct stab_write_handle *) p;
2259 assert (info->lineno_filename != NULL);
2261 if (addr > info->last_text_address)
2262 info->last_text_address = addr;
2264 if (filename_cmp (file, info->lineno_filename) != 0)
2266 if (! stab_write_symbol (info, N_SOL, 0, addr, file))
2268 info->lineno_filename = file;
2271 return stab_write_symbol (info, N_SLINE, lineno, addr - info->fnaddr,