Home | History | Annotate | Download | only in binutils

Lines Matching refs:info

300   struct pr_handle info;
302 info.f = f;
303 info.indent = 0;
304 info.stack = NULL;
305 info.parameter = 0;
306 info.filename = NULL;
307 info.abfd = abfd;
308 info.syms = syms;
309 info.demangler = demangler;
319 return as_tags ? debug_write (dhandle, &tg_fns, (void *) & info)
320 : debug_write (dhandle, &pr_fns, (void *) & info);
327 indent (struct pr_handle *info)
331 for (i = 0; i < info->indent; i++)
332 putc (' ', info->f);
338 push_type (struct pr_handle *info, const char *type)
351 n->next = info->stack;
352 info->stack = n;
360 prepend_type (struct pr_handle *info, const char *s)
364 assert (info->stack != NULL);
366 n = (char *) xmalloc (strlen (s) + strlen (info->stack->type) + 1);
367 sprintf (n, "%s%s", s, info->stack->type);
368 free (info->stack->type);
369 info->stack->type = n;
377 append_type (struct pr_handle *info, const char *s)
384 assert (info->stack != NULL);
386 len = strlen (info->stack->type);
387 info->stack->type = (char *) xrealloc (info->stack->type,
389 strcpy (info->stack->type + len, s);
397 append_parent (struct pr_handle *info, const char *s)
404 assert (info->stack != NULL);
406 len = info->stack->parents ? strlen (info->stack->parents) : 0;
407 info->stack->parents = (char *) xrealloc (info->stack->parents,
409 strcpy (info->stack->parents + len, s);
419 substitute_type (struct pr_handle *info, const char *s)
423 assert (info->stack != NULL);
425 u = strchr (info->stack->type, '|');
430 n = (char *) xmalloc (strlen (info->stack->type) + strlen (s));
432 memcpy (n, info->stack->type, u - info->stack->type);
433 strcpy (n + (u - info->stack->type), s);
436 free (info->stack->type);
437 info->stack->type = n;
443 && (strchr (info->stack->type, '{') != NULL
444 || strchr (info->stack->type, '(') != NULL))
446 if (! prepend_type (info, "(")
447 || ! append_type (info, ")"))
454 return (append_type (info, " ")
455 && append_type (info, s));
461 indent_type (struct pr_handle *info)
465 for (i = 0; i < info->indent; i++)
467 if (! append_type (info, " "))
477 pop_type (struct pr_handle *info)
482 assert (info->stack != NULL);
484 o = info->stack;
485 info->stack = o->next;
540 struct pr_handle *info = (struct pr_handle *) p;
542 assert (info->indent == 0);
544 fprintf (info->f, "%s:\n", filename);
554 struct pr_handle *info = (struct pr_handle *) p;
556 assert (info->indent == 0);
558 fprintf (info->f, " %s:\n", filename);
568 struct pr_handle *info = (struct pr_handle *) p;
570 return push_type (info, "<undefined>");
578 struct pr_handle *info = (struct pr_handle *) p;
580 return push_type (info, "void");
588 struct pr_handle *info = (struct pr_handle *) p;
592 return push_type (info, ab);
600 struct pr_handle *info = (struct pr_handle *) p;
604 return push_type (info, "float");
606 return push_type (info, "double");
609 return push_type (info, ab);
617 struct pr_handle *info = (struct pr_handle *) p;
622 return prepend_type (info, "complex ");
630 struct pr_handle *info = (struct pr_handle *) p;
635 return push_type (info, ab);
644 struct pr_handle *info = (struct pr_handle *) p;
648 if (! push_type (info, "enum "))
652 if (! append_type (info, tag)
653 || ! append_type (info, " "))
656 if (! append_type (info, "{ "))
661 if (! append_type (info, "/* undefined */"))
671 if (! append_type (info, ", "))
675 if (! append_type (info, names[i]))
683 if (! append_type (info, " = ")
684 || ! append_type (info, ab))
693 return append_type (info, " }");
701 struct pr_handle *info = (struct pr_handle *) p;
704 assert (info->stack != NULL);
706 s = strchr (info->stack->type, '|');
708 return substitute_type (info, "(*|)");
709 return substitute_type (info, "*|");
717 struct pr_handle *info = (struct pr_handle *) p;
722 assert (info->stack != NULL);
738 if (! substitute_type (info, ""))
743 arg_types[i] = pop_type (info);
784 if (! substitute_type (info, s))
797 struct pr_handle *info = (struct pr_handle *) p;
799 assert (info->stack != NULL);
801 return substitute_type (info, "&|");
809 struct pr_handle *info = (struct pr_handle *) p;
812 assert (info->stack != NULL);
814 if (! substitute_type (info, ""))
820 return (prepend_type (info, "range (")
821 && append_type (info, "):")
822 && append_type (info, abl)
823 && append_type (info, ":")
824 && append_type (info, abu));
833 struct pr_handle *info = (struct pr_handle *) p;
837 range_type = pop_type (info);
858 if (! substitute_type (info, ab))
863 if (! append_type (info, ":")
864 || ! append_type (info, range_type))
870 if (! append_type (info, " /* string */"))
882 struct pr_handle *info = (struct pr_handle *) p;
884 if (! substitute_type (info, ""))
887 if (! prepend_type (info, "set { ")
888 || ! append_type (info, " }"))
893 if (! append_type (info, "/* bitstring */"))
905 struct pr_handle *info = (struct pr_handle *) p;
908 if (! substitute_type (info, ""))
911 t = pop_type (info);
915 return (substitute_type (info, "")
916 && prepend_type (info, " ")
917 && prepend_type (info, t)
918 && append_type (info, "::|"));
926 struct pr_handle *info = (struct pr_handle *) p;
938 if (! substitute_type (info, ""))
940 domain_type = pop_type (info);
965 if (! substitute_type (info, ""))
970 arg_types[i] = pop_type (info);
1015 if (! substitute_type (info, s))
1028 struct pr_handle *info = (struct pr_handle *) p;
1030 return substitute_type (info, "const |");
1038 struct pr_handle *info = (struct pr_handle *) p;
1040 return substitute_type (info, "volatile |");
1049 struct pr_handle *info = (struct pr_handle *) p;
1051 info->indent += 2;
1053 if (! push_type (info, structp ? "struct " : "union "))
1057 if (! append_type (info, tag))
1065 if (! append_type (info, idbuf))
1069 if (! append_type (info, " {"))
1075 if (! append_type (info, " /*"))
1081 if (! append_type (info, ab))
1087 if (! append_type (info, ab))
1090 if (! append_type (info, " */"))
1093 if (! append_type (info, "\n"))
1096 info->stack->visibility = DEBUG_VISIBILITY_PUBLIC;
1098 return indent_type (info);
1104 pr_fix_visibility (struct pr_handle *info, enum debug_visibility visibility)
1110 assert (info->stack != NULL);
1112 if (info->stack->visibility == visibility)
1137 t = info->stack->type;
1142 if (! append_type (info, s)
1143 || ! append_type (info, ":\n")
1144 || ! indent_type (info))
1147 info->stack->visibility = visibility;
1158 struct pr_handle *info = (struct pr_handle *) p;
1162 if (! substitute_type (info, name))
1165 if (! append_type (info, "; /* "))
1171 if (! append_type (info, "bitsize ")
1172 || ! append_type (info, ab)
1173 || ! append_type (info, ", "))
1178 if (! append_type (info, "bitpos ")
1179 || ! append_type (info, ab)
1180 || ! append_type (info, " */\n")
1181 || ! indent_type (info))
1184 t = pop_type (info);
1188 if (! pr_fix_visibility (info, visibility))
1191 return append_type (info, t);
1199 struct pr_handle *info = (struct pr_handle *) p;
1202 assert (info->stack != NULL);
1203 assert (info->indent >= 2);
1205 info->indent -= 2;
1208 s = info->stack->type + strlen (info->stack->type) - 2;
1224 struct pr_handle *info = (struct pr_handle *) p;
1227 info->indent += 2;
1231 tv = pop_type (info);
1236 if (! push_type (info, structp ? "class " : "union class "))
1240 if (! append_type (info, tag))
1248 if (! append_type (info, idbuf))
1252 if (! append_type (info, " {"))
1256 if (! append_type (info, " /*"))
1264 if (! append_type (info, " size ")
1265 || ! append_type (info, ab))
1271 if (! append_type (info, " vtable "))
1275 if (! append_type (info, "self "))
1280 if (! append_type (info, tv)
1281 || ! append_type (info, " "))
1291 if (! append_type (info, ab))
1295 if (! append_type (info, " */"))
1299 info->stack->visibility = DEBUG_VISIBILITY_PRIVATE;
1301 return (append_type (info, "\n")
1302 && indent_type (info));
1311 struct pr_handle *info = (struct pr_handle *) p;
1314 if (! substitute_type (info, name))
1317 if (! prepend_type (info, "static ")
1318 || ! append_type (info, "; /* ")
1319 || ! append_type (info, physname)
1320 || ! append_type (info, " */\n")
1321 || ! indent_type (info))
1324 t = pop_type (info);
1328 if (! pr_fix_visibility (info, visibility))
1331 return append_type (info, t);
1340 struct pr_handle *info = (struct pr_handle *) p;
1346 assert (info->stack != NULL && info->stack->next != NULL);
1348 if (! substitute_type (info, ""))
1351 t = pop_type (info);
1360 if (! push_type (info, t))
1365 if (! prepend_type (info, "virtual "))
1385 if (! prepend_type (info, prefix))
1391 if (! append_type (info, " /* bitpos ")
1392 || ! append_type (info, ab)
1393 || ! append_type (info, " */"))
1401 s = strchr (info->stack->next->type, '{');
1407 for (l = info->stack->next->type; l != s; l++)
1410 if (! prepend_type (info, l == s ? " : " : ", "))
1413 t = pop_type (info);
1417 n = (char *) xmalloc (strlen (info->stack->type) + strlen (t) + 1);
1418 memcpy (n, info->stack->type, s - info->stack->type);
1419 strcpy (n + (s - info->stack->type), t);
1422 free (info->stack->type);
1423 info->stack->type = n;
1435 struct pr_handle *info = (struct pr_handle *) p;
1437 assert (info->stack != NULL);
1438 info->stack->method = name;
1450 struct pr_handle *info = (struct pr_handle *) p;
1454 assert (info->stack != NULL);
1455 assert (info->stack->next != NULL);
1460 if (! append_type (info, " volatile"))
1465 if (! append_type (info, " const"))
1470 if (! substitute_type (info,
1472 ? info->stack->next->next->method
1473 : info->stack->next->method)))
1477 method_type = pop_type (info);
1486 context_type = pop_type (info);
1493 if (! pr_fix_visibility (info, visibility))
1496 if (! append_type (info, method_type)
1497 || ! append_type (info, " /* ")
1498 || ! append_type (info, physname)
1499 || ! append_type (info, " "))
1507 if (! append_type (info, "context ")
1508 || ! append_type (info, context_type)
1509 || ! append_type (info, " "))
1513 if (! append_type (info, "voffset ")
1514 || ! append_type (info, ab))
1518 return (append_type (info, " */;\n")
1519 && indent_type (info));
1529 struct pr_handle *info = (struct pr_handle *) p;
1532 assert (info->stack != NULL);
1533 assert (info->stack->next != NULL);
1534 assert (info->stack->next->method != NULL);
1539 if (! append_type (info, " volatile"))
1544 if (! append_type (info, " const"))
1549 if (! prepend_type (info, "static "))
1553 if (! substitute_type (info, info->stack->next->method))
1557 method_type = pop_type (info);
1563 if (! pr_fix_visibility (info, visibility))
1566 return (append_type (info, method_type)
1567 && append_type (info, " /* ")
1568 && append_type (info, physname)
1569 && append_type (info, " */;\n")
1570 && indent_type (info));
1578 struct pr_handle *info = (struct pr_handle *) p;
1580 info->stack->method = NULL;
1597 struct pr_handle *info = (struct pr_handle *) p;
1599 return push_type (info, name);
1608 struct pr_handle *info = (struct pr_handle *) p;
1634 if (! push_type (info, t))
1644 if (! append_type (info, tag))
1649 if (! append_type (info, idbuf))
1661 struct pr_handle *info = (struct pr_handle *) p;
1664 if (! substitute_type (info, name))
1667 s = pop_type (info);
1671 indent (info);
1672 fprintf (info->f, "typedef %s;\n", s);
1685 struct pr_handle *info = (struct pr_handle *) p;
1688 t = pop_type (info);
1692 indent (info);
1693 fprintf (info->f, "%s;\n", t);
1705 struct pr_handle *info = (struct pr_handle *) p;
1708 indent (info);
1710 fprintf (info->f, "const int %s = %s;\n", name, ab);
1719 struct pr_handle *info = (struct pr_handle *) p;
1721 indent (info);
1722 fprintf (info->f, "const double %s = %g;\n", name, val);
1731 struct pr_handle *info = (struct pr_handle *) p;
1735 t = pop_type (info);
1739 indent (info);
1741 fprintf (info->f, "const %s %s = %s;\n", t, name, ab);
1754 struct pr_handle *info = (struct pr_handle *) p;
1758 if (! substitute_type (info, name))
1761 t = pop_type (info);
1765 indent (info);
1770 fprintf (info->f, "static ");
1773 fprintf (info->f, "register ");
1779 fprintf (info->f, "%s /* %s */;\n", t, ab);
1791 struct pr_handle *info = (struct pr_handle *) p;
1794 if (! substitute_type (info, name))
1797 t = pop_type (info);
1801 indent (info);
1803 fprintf (info->f, "static ");
1804 fprintf (info->f, "%s (", t);
1806 info->parameter = 1;
1817 struct pr_handle *info = (struct pr_handle *) p;
1828 if (! substitute_type (info, name))
1831 t = pop_type (info);
1835 if (info->parameter != 1)
1836 fprintf (info->f, ", ");
1839 fprintf (info->f, "register ");
1842 fprintf (info->f, "%s /* %s */", t, ab);
1846 ++info->parameter;
1856 struct pr_handle *info = (struct pr_handle *) p;
1859 if (info->parameter > 0)
1861 fprintf (info->f, ")\n");
1862 info->parameter = 0;
1865 indent (info);
1867 fprintf (info->f, "{ /* %s */\n", ab);
1869 info->indent += 2;
1879 struct pr_handle *info = (struct pr_handle *) p;
1882 indent (info);
1884 fprintf (info->f, "/* file %s line %lu addr %s */\n", filename, lineno, ab);
1894 struct pr_handle *info = (struct pr_handle *) p;
1897 info->indent -= 2;
1899 indent (info);
1901 fprintf (info->f, "} /* %s */\n", ab);
1970 struct pr_handle *info = (struct pr_handle *) p;
1972 free (info->filename);
1974 info->filename = strdup (fname);
1984 struct pr_handle *info = (struct pr_handle *) p;
1986 free (info->filename);
1988 info->filename = strdup (fname);
1999 struct pr_handle *info = (struct pr_handle *) p;
2010 fprintf (info->f, "%s\t%s\t0;\"\tkind:e\ttype:%s\n", tag,
2011 info->filename, info->stack->type);
2019 fprintf (info->f, "%s\t%s\t0;\"\tkind:g\tenum:%s\tvalue:%s\n",
2020 names[i], info->filename, name, ab);
2034 struct pr_handle *info = (struct pr_handle *) p;
2046 if (! push_type (info, name))
2049 info->stack->flavor = structp ? "struct" : "union";
2051 fprintf (info->f, "%s\t%s\t0;\"\tkind:%c\n", name, info->filename,
2052 info->stack->flavor[0]);
2054 info->stack->visibility = DEBUG_VISIBILITY_PUBLIC;
2056 return indent_type (info);
2062 tg_fix_visibility (struct pr_handle *info, enum debug_visibility visibility)
2064 assert (info->stack != NULL);
2066 if (info->stack->visibility == visibility)
2069 assert (info->stack->visibility != DEBUG_VISIBILITY_IGNORE);
2071 info->stack->visibility = visibility;
2083 struct pr_handle *info = (struct pr_handle *) p;
2086 t = pop_type (info);
2090 if (! tg_fix_visibility (info, visibility))
2097 fprintf (info->f, "%s\t%s\t0;\"\tkind:m\ttype:%s\t%s:%s\taccess:%s\n",
2098 name, info->filename, t, info->stack->flavor, info->stack->type,
2121 struct pr_handle *info = (struct pr_handle *) p;
2125 info->indent += 2;
2129 tv = pop_type (info);
2144 if (! push_type (info, name))
2147 info->stack->flavor = structp ? "class" : "union class";
2148 info->stack->parents = NULL;
2149 info->stack->num_parents = 0;
2155 if (! append_type (info, " vtable "))
2159 if (! append_type (info, "self "))
2164 if (! append_type (info, tv)
2165 || ! append_type (info, " "))
2171 info->stack->visibility = DEBUG_VISIBILITY_PRIVATE;
2183 struct pr_handle *info = (struct pr_handle *) p;
2189 len_class = strlen (info->stack->next->type);
2193 sprintf (full_name, "%s::%s", info->stack->next->type, name);
2195 if (! substitute_type (info, full_name))
2201 if (! prepend_type (info, "static "))
2207 t = pop_type (info);
2214 if (! tg_fix_visibility (info, visibility))
2221 fprintf (info->f, "%s\t%s\t0;\"\tkind:x\ttype:%s\tclass:%s\taccess:%s\n",
2222 name, info->filename, t, info->stack->type,
2236 struct pr_handle *info = (struct pr_handle *) p;
2240 assert (info->stack != NULL && info->stack->next != NULL);
2242 t = pop_type (info);
2251 if (! push_type (info, t))
2256 if (! prepend_type (info, "virtual "))
2276 if (! prepend_type (info, prefix))
2279 t = pop_type (info);
2283 if (info->stack->num_parents && ! append_parent (info, ", "))
2286 if (! append_parent (info, t))
2288 info->stack->num_parents++;
2304 struct pr_handle *info = (struct pr_handle *) p;
2309 assert (info->stack != NULL);
2310 assert (info->stack->next != NULL);
2315 if (! append_type (info, " volatile"))
2320 if (! append_type (info, " const"))
2324 method_name = strdup (context ? info->stack->next->next->method
2325 : info->stack->next->method);
2328 if (! substitute_type (info, method_name))
2335 method_type = pop_type (info);
2347 context_type = pop_type (info);
2357 if (! tg_fix_visibility (info, visibility))
2365 fprintf (info->f, "%s\t%s\t0;\"\tkind:p\ttype:%s\tclass:%s\n",
2366 method_name, info->filename, method_type, info->stack->type);
2382 struct pr_handle *info = (struct pr_handle *) p;
2386 assert (info->stack != NULL);
2387 assert (info->stack->next != NULL);
2388 assert (info->stack->next->method != NULL);
2393 if (! append_type (info, " volatile"))
2398 if (! append_type (info, " const"))
2403 if (! prepend_type (info, "static "))
2406 method_name = strdup (info->stack->next->method);
2408 if (! substitute_type (info, info->stack->next->method))
2415 method_type = pop_type (info);
2423 if (! tg_fix_visibility (info, visibility))
2430 fprintf (info->f, "%s\t%s\t0;\"\tkind:p\ttype:%s\tclass:%s\taccess:%s\n",
2431 method_name, info->filename, method_type, info->stack->type,
2444 struct pr_handle *info = (struct pr_handle *) p;
2446 fprintf (info->f, "%s\t%s\t0;\"\tkind:c\ttype:%s", info->stack->type,
2447 info->filename, info->stack->flavor);
2448 if (info->stack->num_parents)
2450 fprintf (info->f, "\tinherits:%s", info->stack->parents);
2451 free (info->stack->parents);
2453 fputc ('\n', info->f);
2464 struct pr_handle *info = (struct pr_handle *) p;
2490 if (! push_type (info, t))
2500 if (! append_type (info, tag))
2511 struct pr_handle *info = (struct pr_handle *) p;
2514 s = pop_type (info);
2518 fprintf (info->f, "%s\t%s\t0;\"\tkind:t\ttype:%s\n", name,
2519 info->filename, s);
2532 struct pr_handle *info = (struct pr_handle *) p;
2535 t = pop_type (info);
2548 struct pr_handle *info = (struct pr_handle *) p;
2551 indent (info);
2553 fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const int\tvalue:%s\n",
2554 name, info->filename, ab);
2563 struct pr_handle *info = (struct pr_handle *) p;
2565 indent (info);
2566 fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const double\tvalue:%g\n",
2567 name, info->filename, val);
2576 struct pr_handle *info = (struct pr_handle *) p;
2580 t = pop_type (info);
2584 indent (info);
2586 fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const %s\tvalue:%s\n",
2587 name, info->filename, t, ab);
2600 struct pr_handle *info = (struct pr_handle *) p;
2603 t = pop_type (info);
2608 if (info->demangler)
2609 dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS);
2627 fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:%s", name, info->filename, t);
2633 fprintf (info->f, "\tfile:");
2636 fprintf (info->f, "\tregister:");
2643 fprintf (info->f, "\tclass:%s", from_class);
2648 fprintf (info->f, "\n");
2660 struct pr_handle *info = (struct pr_handle *) p;
2664 info->stack->flavor = "static";
2666 info->stack->flavor = NULL;
2669 if (info->demangler)
2670 dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS);
2672 if (! substitute_type (info, dname ? dname : name))
2675 info->stack->method = NULL;
2682 info->stack->method = dname;
2688 info->stack->method = "";
2697 info->stack->parents = strdup (name);
2699 if (! info->stack->method && ! append_type (info, "("))
2702 info->parameter = 1;
2713 struct pr_handle *info = (struct pr_handle *) p;
2723 if (! substitute_type (info, name))
2726 t = pop_type (info);
2730 if (! info->stack->method)
2732 if (info->parameter != 1 && ! append_type (info, ", "))
2736 if (! append_type (info, "register "))
2739 if (! append_type (info, t))
2745 ++info->parameter;
2755 struct pr_handle *info = (struct pr_handle *) p;
2760 if (info->parameter > 0)
2762 info->parameter = 0;
2765 fprintf (info->f, "%s\t%s\t", info->stack->parents, info->filename);
2766 free (info->stack->parents);
2769 translate_addresses (info->abfd, ab, info->f, info->syms);
2770 local = info->stack->flavor != NULL;
2771 if (info->stack->method && *info->stack->method)
2774 partof = (char *) info->stack->method;
2780 if (! info->stack->method && ! append_type (info, ")"))
2783 t = pop_type (info);
2786 fprintf (info->f, ";\"\tkind:%c\ttype:%s", kind, t);
2788 fputs ("\tfile:", info->f);
2791 fprintf (info->f, "\tclass:%s", partof);
2794 fputc ('\n', info->f);