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;
520 struct pr_handle *info = (struct pr_handle *) p;
522 assert (info->indent == 0);
524 fprintf (info->f, "%s:\n", filename);
534 struct pr_handle *info = (struct pr_handle *) p;
536 assert (info->indent == 0);
538 fprintf (info->f, " %s:\n", filename);
548 struct pr_handle *info = (struct pr_handle *) p;
550 return push_type (info, "<undefined>");
558 struct pr_handle *info = (struct pr_handle *) p;
560 return push_type (info, "void");
568 struct pr_handle *info = (struct pr_handle *) p;
572 return push_type (info, ab);
580 struct pr_handle *info = (struct pr_handle *) p;
584 return push_type (info, "float");
586 return push_type (info, "double");
589 return push_type (info, ab);
597 struct pr_handle *info = (struct pr_handle *) p;
602 return prepend_type (info, "complex ");
610 struct pr_handle *info = (struct pr_handle *) p;
615 return push_type (info, ab);
624 struct pr_handle *info = (struct pr_handle *) p;
628 if (! push_type (info, "enum "))
632 if (! append_type (info, tag)
633 || ! append_type (info, " "))
636 if (! append_type (info, "{ "))
641 if (! append_type (info, "/* undefined */"))
651 if (! append_type (info, ", "))
655 if (! append_type (info, names[i]))
663 if (! append_type (info, " = ")
664 || ! append_type (info, ab))
673 return append_type (info, " }");
681 struct pr_handle *info = (struct pr_handle *) p;
684 assert (info->stack != NULL);
686 s = strchr (info->stack->type, '|');
688 return substitute_type (info, "(*|)");
689 return substitute_type (info, "*|");
697 struct pr_handle *info = (struct pr_handle *) p;
702 assert (info->stack != NULL);
718 if (! substitute_type (info, ""))
720 arg_types[i] = pop_type (info);
758 if (! substitute_type (info, s))
771 struct pr_handle *info = (struct pr_handle *) p;
773 assert (info->stack != NULL);
775 return substitute_type (info, "&|");
783 struct pr_handle *info = (struct pr_handle *) p;
786 assert (info->stack != NULL);
788 if (! substitute_type (info, ""))
794 return (prepend_type (info, "range (")
795 && append_type (info, "):")
796 && append_type (info, abl)
797 && append_type (info, ":")
798 && append_type (info, abu));
807 struct pr_handle *info = (struct pr_handle *) p;
811 range_type = pop_type (info);
832 if (! substitute_type (info, ab))
837 if (! append_type (info, ":")
838 || ! append_type (info, range_type))
844 if (! append_type (info, " /* string */"))
856 struct pr_handle *info = (struct pr_handle *) p;
858 if (! substitute_type (info, ""))
861 if (! prepend_type (info, "set { ")
862 || ! append_type (info, " }"))
867 if (! append_type (info, "/* bitstring */"))
879 struct pr_handle *info = (struct pr_handle *) p;
882 if (! substitute_type (info, ""))
885 t = pop_type (info);
889 return (substitute_type (info, "")
890 && prepend_type (info, " ")
891 && prepend_type (info, t)
892 && append_type (info, "::|"));
900 struct pr_handle *info = (struct pr_handle *) p;
912 if (! substitute_type (info, ""))
914 domain_type = pop_type (info);
939 if (! substitute_type (info, ""))
941 arg_types[i] = pop_type (info);
983 if (! substitute_type (info, s))
996 struct pr_handle *info = (struct pr_handle *) p;
998 return substitute_type (info, "const |");
1006 struct pr_handle *info = (struct pr_handle *) p;
1008 return substitute_type (info, "volatile |");
1017 struct pr_handle *info = (struct pr_handle *) p;
1019 info->indent += 2;
1021 if (! push_type (info, structp ? "struct " : "union "))
1025 if (! append_type (info, tag))
1033 if (! append_type (info, idbuf))
1037 if (! append_type (info, " {"))
1043 if (! append_type (info, " /*"))
1049 if (! append_type (info, ab))
1055 if (! append_type (info, ab))
1058 if (! append_type (info, " */"))
1061 if (! append_type (info, "\n"))
1064 info->stack->visibility = DEBUG_VISIBILITY_PUBLIC;
1066 return indent_type (info);
1072 pr_fix_visibility (struct pr_handle *info, enum debug_visibility visibility)
1078 assert (info->stack != NULL);
1080 if (info->stack->visibility == visibility)
1105 t = info->stack->type;
1110 if (! append_type (info, s)
1111 || ! append_type (info, ":\n")
1112 || ! indent_type (info))
1115 info->stack->visibility = visibility;
1126 struct pr_handle *info = (struct pr_handle *) p;
1130 if (! substitute_type (info, name))
1133 if (! append_type (info, "; /* "))
1139 if (! append_type (info, "bitsize ")
1140 || ! append_type (info, ab)
1141 || ! append_type (info, ", "))
1146 if (! append_type (info, "bitpos ")
1147 || ! append_type (info, ab)
1148 || ! append_type (info, " */\n")
1149 || ! indent_type (info))
1152 t = pop_type (info);
1156 if (! pr_fix_visibility (info, visibility))
1159 return append_type (info, t);
1167 struct pr_handle *info = (struct pr_handle *) p;
1170 assert (info->stack != NULL);
1171 assert (info->indent >= 2);
1173 info->indent -= 2;
1176 s = info->stack->type + strlen (info->stack->type) - 2;
1192 struct pr_handle *info = (struct pr_handle *) p;
1195 info->indent += 2;
1199 tv = pop_type (info);
1204 if (! push_type (info, structp ? "class " : "union class "))
1208 if (! append_type (info, tag))
1216 if (! append_type (info, idbuf))
1220 if (! append_type (info, " {"))
1224 if (! append_type (info, " /*"))
1232 if (! append_type (info, " size ")
1233 || ! append_type (info, ab))
1239 if (! append_type (info, " vtable "))
1243 if (! append_type (info, "self "))
1248 if (! append_type (info, tv)
1249 || ! append_type (info, " "))
1259 if (! append_type (info, ab))
1263 if (! append_type (info, " */"))
1267 info->stack->visibility = DEBUG_VISIBILITY_PRIVATE;
1269 return (append_type (info, "\n")
1270 && indent_type (info));
1279 struct pr_handle *info = (struct pr_handle *) p;
1282 if (! substitute_type (info, name))
1285 if (! prepend_type (info, "static ")
1286 || ! append_type (info, "; /* ")
1287 || ! append_type (info, physname)
1288 || ! append_type (info, " */\n")
1289 || ! indent_type (info))
1292 t = pop_type (info);
1296 if (! pr_fix_visibility (info, visibility))
1299 return append_type (info, t);
1308 struct pr_handle *info = (struct pr_handle *) p;
1314 assert (info->stack != NULL && info->stack->next != NULL);
1316 if (! substitute_type (info, ""))
1319 t = pop_type (info);
1328 if (! push_type (info, t))
1333 if (! prepend_type (info, "virtual "))
1353 if (! prepend_type (info, prefix))
1359 if (! append_type (info, " /* bitpos ")
1360 || ! append_type (info, ab)
1361 || ! append_type (info, " */"))
1369 s = strchr (info->stack->next->type, '{');
1375 for (l = info->stack->next->type; l != s; l++)
1378 if (! prepend_type (info, l == s ? " : " : ", "))
1381 t = pop_type (info);
1385 n = (char *) xmalloc (strlen (info->stack->type) + strlen (t) + 1);
1386 memcpy (n, info->stack->type, s - info->stack->type);
1387 strcpy (n + (s - info->stack->type), t);
1390 free (info->stack->type);
1391 info->stack->type = n;
1403 struct pr_handle *info = (struct pr_handle *) p;
1405 assert (info->stack != NULL);
1406 info->stack->method = name;
1418 struct pr_handle *info = (struct pr_handle *) p;
1422 assert (info->stack != NULL);
1423 assert (info->stack->next != NULL);
1428 if (! append_type (info, " volatile"))
1433 if (! append_type (info, " const"))
1438 if (! substitute_type (info,
1440 ? info->stack->next->next->method
1441 : info->stack->next->method)))
1445 method_type = pop_type (info);
1454 context_type = pop_type (info);
1461 if (! pr_fix_visibility (info, visibility))
1464 if (! append_type (info, method_type)
1465 || ! append_type (info, " /* ")
1466 || ! append_type (info, physname)
1467 || ! append_type (info, " "))
1475 if (! append_type (info, "context ")
1476 || ! append_type (info, context_type)
1477 || ! append_type (info, " "))
1481 if (! append_type (info, "voffset ")
1482 || ! append_type (info, ab))
1486 return (append_type (info, " */;\n")
1487 && indent_type (info));
1497 struct pr_handle *info = (struct pr_handle *) p;
1500 assert (info->stack != NULL);
1501 assert (info->stack->next != NULL);
1502 assert (info->stack->next->method != NULL);
1507 if (! append_type (info, " volatile"))
1512 if (! append_type (info, " const"))
1517 if (! prepend_type (info, "static "))
1521 if (! substitute_type (info, info->stack->next->method))
1525 method_type = pop_type (info);
1531 if (! pr_fix_visibility (info, visibility))
1534 return (append_type (info, method_type)
1535 && append_type (info, " /* ")
1536 && append_type (info, physname)
1537 && append_type (info, " */;\n")
1538 && indent_type (info));
1546 struct pr_handle *info = (struct pr_handle *) p;
1548 info->stack->method = NULL;
1565 struct pr_handle *info = (struct pr_handle *) p;
1567 return push_type (info, name);
1576 struct pr_handle *info = (struct pr_handle *) p;
1602 if (! push_type (info, t))
1612 if (! append_type (info, tag))
1617 if (! append_type (info, idbuf))
1629 struct pr_handle *info = (struct pr_handle *) p;
1632 if (! substitute_type (info, name))
1635 s = pop_type (info);
1639 indent (info);
1640 fprintf (info->f, "typedef %s;\n", s);
1653 struct pr_handle *info = (struct pr_handle *) p;
1656 t = pop_type (info);
1660 indent (info);
1661 fprintf (info->f, "%s;\n", t);
1673 struct pr_handle *info = (struct pr_handle *) p;
1676 indent (info);
1678 fprintf (info->f, "const int %s = %s;\n", name, ab);
1687 struct pr_handle *info = (struct pr_handle *) p;
1689 indent (info);
1690 fprintf (info->f, "const double %s = %g;\n", name, val);
1699 struct pr_handle *info = (struct pr_handle *) p;
1703 t = pop_type (info);
1707 indent (info);
1709 fprintf (info->f, "const %s %s = %s;\n", t, name, ab);
1722 struct pr_handle *info = (struct pr_handle *) p;
1726 if (! substitute_type (info, name))
1729 t = pop_type (info);
1733 indent (info);
1738 fprintf (info->f, "static ");
1741 fprintf (info->f, "register ");
1747 fprintf (info->f, "%s /* %s */;\n", t, ab);
1759 struct pr_handle *info = (struct pr_handle *) p;
1762 if (! substitute_type (info, name))
1765 t = pop_type (info);
1769 indent (info);
1771 fprintf (info->f, "static ");
1772 fprintf (info->f, "%s (", t);
1774 info->parameter = 1;
1785 struct pr_handle *info = (struct pr_handle *) p;
1796 if (! substitute_type (info, name))
1799 t = pop_type (info);
1803 if (info->parameter != 1)
1804 fprintf (info->f, ", ");
1807 fprintf (info->f, "register ");
1810 fprintf (info->f, "%s /* %s */", t, ab);
1814 ++info->parameter;
1824 struct pr_handle *info = (struct pr_handle *) p;
1827 if (info->parameter > 0)
1829 fprintf (info->f, ")\n");
1830 info->parameter = 0;
1833 indent (info);
1835 fprintf (info->f, "{ /* %s */\n", ab);
1837 info->indent += 2;
1847 struct pr_handle *info = (struct pr_handle *) p;
1850 indent (info);
1852 fprintf (info->f, "/* file %s line %lu addr %s */\n", filename, lineno, ab);
1862 struct pr_handle *info = (struct pr_handle *) p;
1865 info->indent -= 2;
1867 indent (info);
1869 fprintf (info->f, "} /* %s */\n", ab);
1938 struct pr_handle *info = (struct pr_handle *) p;
1942 free (info->filename);
1944 info->filename = strdup (filename);
1954 struct pr_handle *info = (struct pr_handle *) p;
1956 free (info->filename);
1958 info->filename = strdup (filename);
1969 struct pr_handle *info = (struct pr_handle *) p;
1980 fprintf (info->f, "%s\t%s\t0;\"\tkind:e\ttype:%s\n", tag,
1981 info->filename, info->stack->type);
1989 fprintf (info->f, "%s\t%s\t0;\"\tkind:g\tenum:%s\tvalue:%s\n",
1990 names[i], info->filename, name, ab);
2004 struct pr_handle *info = (struct pr_handle *) p;
2016 if (! push_type (info, name))
2019 info->stack->flavor = structp ? "struct" : "union";
2021 fprintf (info->f, "%s\t%s\t0;\"\tkind:%c\n", name, info->filename,
2022 info->stack->flavor[0]);
2024 info->stack->visibility = DEBUG_VISIBILITY_PUBLIC;
2026 return indent_type (info);
2032 tg_fix_visibility (struct pr_handle *info, enum debug_visibility visibility)
2034 assert (info->stack != NULL);
2036 if (info->stack->visibility == visibility)
2039 assert (info->stack->visibility != DEBUG_VISIBILITY_IGNORE);
2041 info->stack->visibility = visibility;
2053 struct pr_handle *info = (struct pr_handle *) p;
2056 t = pop_type (info);
2060 if (! tg_fix_visibility (info, visibility))
2067 fprintf (info->f, "%s\t%s\t0;\"\tkind:m\ttype:%s\t%s:%s\taccess:%s\n",
2068 name, info->filename, t, info->stack->flavor, info->stack->type,
2079 struct pr_handle *info = (struct pr_handle *) p;
2080 assert (info->stack != NULL);
2092 struct pr_handle *info = (struct pr_handle *) p;
2096 info->indent += 2;
2100 tv = pop_type (info);
2115 if (! push_type (info, name))
2118 info->stack->flavor = structp ? "class" : "union class";
2119 info->stack->parents = NULL;
2120 info->stack->num_parents = 0;
2126 if (! append_type (info, " vtable "))
2130 if (! append_type (info, "self "))
2135 if (! append_type (info, tv)
2136 || ! append_type (info, " "))
2142 info->stack->visibility = DEBUG_VISIBILITY_PRIVATE;
2154 struct pr_handle *info = (struct pr_handle *) p;
2160 len_class = strlen (info->stack->next->type);
2164 sprintf (full_name, "%s::%s", info->stack->next->type, name);
2166 if (! substitute_type (info, full_name))
2169 if (! prepend_type (info, "static "))
2172 t = pop_type (info);
2176 if (! tg_fix_visibility (info, visibility))
2179 fprintf (info->f, "%s\t%s\t0;\"\tkind:x\ttype:%s\tclass:%s\taccess:%s\n",
2180 name, info->filename, t, info->stack->type,
2194 struct pr_handle *info = (struct pr_handle *) p;
2198 assert (info->stack != NULL && info->stack->next != NULL);
2200 t = pop_type (info);
2209 if (! push_type (info, t))
2214 if (! prepend_type (info, "virtual "))
2234 if (! prepend_type (info, prefix))
2237 t = pop_type (info);
2241 if (info->stack->num_parents && ! append_parent (info, ", "))
2244 if (! append_parent (info, t))
2246 info->stack->num_parents++;
2262 struct pr_handle *info = (struct pr_handle *) p;
2267 assert (info->stack != NULL);
2268 assert (info->stack->next != NULL);
2273 if (! append_type (info, " volatile"))
2278 if (! append_type (info, " const"))
2282 method_name = strdup (context ? info->stack->next->next->method
2283 : info->stack->next->method);
2286 if (! substitute_type (info, method_name))
2290 method_type = pop_type (info);
2299 context_type = pop_type (info);
2305 if (! tg_fix_visibility (info, visibility))
2308 fprintf (info->f, "%s\t%s\t0;\"\tkind:p\ttype:%s\tclass:%s\n",
2309 method_name, info->filename, method_type, info->stack->type);
2325 struct pr_handle *info = (struct pr_handle *) p;
2329 assert (info->stack != NULL);
2330 assert (info->stack->next != NULL);
2331 assert (info->stack->next->method != NULL);
2336 if (! append_type (info, " volatile"))
2341 if (! append_type (info, " const"))
2346 if (! prepend_type (info, "static "))
2349 method_name = strdup (info->stack->next->method);
2351 if (! substitute_type (info, info->stack->next->method))
2355 method_type = pop_type (info);
2360 if (! tg_fix_visibility (info, visibility))
2363 fprintf (info->f, "%s\t%s\t0;\"\tkind:p\ttype:%s\tclass:%s\taccess:%s\n",
2364 method_name, info->filename, method_type, info->stack->type,
2377 struct pr_handle *info = (struct pr_handle *) p;
2379 fprintf (info->f, "%s\t%s\t0;\"\tkind:c\ttype:%s", info->stack->type,
2380 info->filename, info->stack->flavor);
2381 if (info->stack->num_parents)
2383 fprintf (info->f, "\tinherits:%s", info->stack->parents);
2384 free (info->stack->parents);
2386 fputc ('\n', info->f);
2397 struct pr_handle *info = (struct pr_handle *) p;
2423 if (! push_type (info, t))
2433 if (! append_type (info, tag))
2444 struct pr_handle *info = (struct pr_handle *) p;
2447 s = pop_type (info);
2451 fprintf (info->f, "%s\t%s\t0;\"\tkind:t\ttype:%s\n", name,
2452 info->filename, s);
2465 struct pr_handle *info = (struct pr_handle *) p;
2468 t = pop_type (info);
2481 struct pr_handle *info = (struct pr_handle *) p;
2484 indent (info);
2486 fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const int\tvalue:%s\n",
2487 name, info->filename, ab);
2496 struct pr_handle *info = (struct pr_handle *) p;
2498 indent (info);
2499 fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const double\tvalue:%g\n",
2500 name, info->filename, val);
2509 struct pr_handle *info = (struct pr_handle *) p;
2513 t = pop_type (info);
2517 indent (info);
2519 fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const %s\tvalue:%s\n",
2520 name, info->filename, t, ab);
2533 struct pr_handle *info = (struct pr_handle *) p;
2536 t = pop_type (info);
2541 if (info->demangler)
2542 dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS);
2560 fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:%s", name, info->filename, t);
2566 fprintf (info->f, "\tfile:");
2569 fprintf (info->f, "\tregister:");
2576 fprintf (info->f, "\tclass:%s", from_class);
2581 fprintf (info->f, "\n");
2593 struct pr_handle *info = (struct pr_handle *) p;
2597 info->stack->flavor = "static";
2599 info->stack->flavor = NULL;
2602 if (info->demangler)
2603 dname = info->demangler (info->abfd, name, DMGL_ANSI | DMGL_PARAMS);
2605 if (! substitute_type (info, dname ? dname : name))
2608 info->stack->method = NULL;
2615 info->stack->method = dname;
2621 info->stack->method = "";
2630 info->stack->parents = strdup (name);
2632 if (! info->stack->method && ! append_type (info, "("))
2635 info->parameter = 1;
2646 struct pr_handle *info = (struct pr_handle *) p;
2656 if (! substitute_type (info, name))
2659 t = pop_type (info);
2663 if (! info->stack->method)
2665 if (info->parameter != 1 && ! append_type (info, ", "))
2669 if (! append_type (info, "register "))
2672 if (! append_type (info, t))
2678 ++info->parameter;
2688 struct pr_handle *info = (struct pr_handle *) p;
2693 if (info->parameter > 0)
2695 info->parameter = 0;
2698 fprintf (info->f, "%s\t%s\t", info->stack->parents, info->filename);
2699 free (info->stack->parents);
2702 translate_addresses (info->abfd, ab, info->f, info->syms);
2703 local = info->stack->flavor != NULL;
2704 if (info->stack->method && *info->stack->method)
2707 partof = (char *) info->stack->method;
2713 if (! info->stack->method && ! append_type (info, ")"))
2716 t = pop_type (info);
2719 fprintf (info->f, ";\"\tkind:%c\ttype:%s", kind, t);
2721 fputs ("\tfile:", info->f);
2724 fprintf (info->f, "\tclass:%s", partof);
2727 fputc ('\n', info->f);