Lines Matching refs:d
71 #define VEC_PUSH_STR(d,s) vector_str_push((d), (s), strlen((s))) argument
100 struct demangle_data d; in cpp_demangle_ARM() local
108 if (init_demangle_data(&d) == false) in cpp_demangle_ARM()
114 d.p = org; in cpp_demangle_ARM()
115 if (read_func_name(&d) == false) in cpp_demangle_ARM()
118 if (d.type == ENCODE_OP_CT) { in cpp_demangle_ARM()
119 if (push_CTDT("::", 2, &d.vec) == false) in cpp_demangle_ARM()
125 if (d.type == ENCODE_OP_DT) { in cpp_demangle_ARM()
126 if (push_CTDT("::~", 3, &d.vec) == false) in cpp_demangle_ARM()
132 if (d.type == ENCODE_OP_USER) in cpp_demangle_ARM()
136 if (*d.p != 'F') in cpp_demangle_ARM()
138 ++d.p; in cpp_demangle_ARM()
141 if (VEC_PUSH_STR(&d.vec, "(") == false) in cpp_demangle_ARM()
145 if (*d.p == 'T') { in cpp_demangle_ARM()
146 const int rtn_subst = read_subst(&d); in cpp_demangle_ARM()
156 if (*d.p == 'N') { in cpp_demangle_ARM()
157 const int rtn_subst_iter = read_subst_iter(&d); in cpp_demangle_ARM()
167 arg_begin = d.vec.size; in cpp_demangle_ARM()
169 if (read_type(&d) == false) in cpp_demangle_ARM()
172 if (d.ptr == true) { in cpp_demangle_ARM()
173 if (VEC_PUSH_STR(&d.vec, "*") == false) in cpp_demangle_ARM()
176 d.ptr = false; in cpp_demangle_ARM()
179 if (d.ref == true) { in cpp_demangle_ARM()
180 if (VEC_PUSH_STR(&d.vec, "&") == false) in cpp_demangle_ARM()
183 d.ref = false; in cpp_demangle_ARM()
186 if (d.cnst == true) { in cpp_demangle_ARM()
187 if (VEC_PUSH_STR(&d.vec, " const") == false) in cpp_demangle_ARM()
190 d.cnst = false; in cpp_demangle_ARM()
193 if (d.array == true) { in cpp_demangle_ARM()
194 if (vector_str_push(&d.vec, d.array_str.buf, in cpp_demangle_ARM()
195 d.array_str.size) == false) in cpp_demangle_ARM()
198 dest_cstring(&d.array_str); in cpp_demangle_ARM()
199 d.array = false; in cpp_demangle_ARM()
202 if (*d.p == '\0') in cpp_demangle_ARM()
205 if ((arg = vector_str_substr(&d.vec, arg_begin, d.vec.size - 1, in cpp_demangle_ARM()
209 if (vector_str_push(&d.arg, arg, arg_len) == false) { in cpp_demangle_ARM()
216 if (VEC_PUSH_STR(&d.vec, ", ") == false) in cpp_demangle_ARM()
224 if (VEC_PUSH_STR(&d.vec, ")") == false) in cpp_demangle_ARM()
228 rtn = vector_str_get_flat(&d.vec, NULL); in cpp_demangle_ARM()
230 dest_demangle_data(&d); in cpp_demangle_ARM()
263 dest_demangle_data(struct demangle_data *d) in dest_demangle_data() argument
266 if (d != NULL) { in dest_demangle_data()
267 vector_str_dest(&d->arg); in dest_demangle_data()
268 vector_str_dest(&d->vec); in dest_demangle_data()
270 dest_cstring(&d->array_str); in dest_demangle_data()
290 init_demangle_data(struct demangle_data *d) in init_demangle_data() argument
293 if (d == NULL) in init_demangle_data()
296 d->ptr = false; in init_demangle_data()
297 d->ref = false; in init_demangle_data()
298 d->cnst = false; in init_demangle_data()
299 d->array = false; in init_demangle_data()
301 d->array_str.buf = NULL; in init_demangle_data()
302 d->array_str.size = 0; in init_demangle_data()
304 d->type = ENCODE_FUNC; in init_demangle_data()
306 if (!vector_str_init(&d->vec)) in init_demangle_data()
309 if (!vector_str_init(&d->arg)) { in init_demangle_data()
310 vector_str_dest(&d->vec); in init_demangle_data()
338 read_array(struct demangle_data *d) in read_array() argument
343 if (d == NULL || d->p == NULL) in read_array()
346 end = d->p; in read_array()
362 len = end - d->p; in read_array()
365 dest_cstring(&d->array_str); in read_array()
366 if (init_cstring(&d->array_str, len + 3) == false) in read_array()
369 strncpy(d->array_str.buf + 1, d->p, len); in read_array()
370 *d->array_str.buf = '['; in read_array()
371 *(d->array_str.buf + len + 1) = ']'; in read_array()
373 d->array = true; in read_array()
374 d->p = end + 1; in read_array()
380 read_class(struct demangle_data *d) in read_class() argument
385 if (d == NULL) in read_class()
388 len = strtol(d->p, &str, 10); in read_class()
395 if (vector_str_push(&d->vec, str, len) == false) in read_class()
398 d->p = str + len; in read_class()
404 read_func(struct demangle_data *d) in read_func() argument
410 if (d == NULL) in read_func()
413 assert(d->p != NULL && "d->p (org str) is NULL"); in read_func()
414 if ((delim = strstr(d->p, "__")) == NULL) in read_func()
417 len = delim - d->p; in read_func()
420 name = d->p; in read_func()
422 d->p = delim + 2; in read_func()
424 if (*d->p == 'Q' && ELFTC_ISDIGIT(*(d->p + 1))) { in read_func()
425 ++d->p; in read_func()
427 if (read_qual_name(d) == false) in read_func()
429 } else if (ELFTC_ISDIGIT(*d->p)) { in read_func()
430 if (read_class(d) == false) in read_func()
433 if (VEC_PUSH_STR(&d->vec, "::") == false) in read_func()
437 if (vector_str_push(&d->vec, name, len) == false) in read_func()
444 read_func_name(struct demangle_data *d) in read_func_name() argument
450 if (d == NULL) in read_func_name()
456 assert(d->p != NULL && "d->p (org str) is NULL"); in read_func_name()
458 if (*d->p == '_' && *(d->p + 1) == '_') { in read_func_name()
459 d->p += 2; in read_func_name()
461 d->type = ENCODE_OP; in read_func_name()
462 if (read_op(d) == false) in read_func_name()
465 if (d->type == ENCODE_OP_CT || d->type == ENCODE_OP_DT || in read_func_name()
466 d->type == ENCODE_OP_USER) in read_func_name()
470 d->p += 2; in read_func_name()
473 if (*d->p == 'Q' && ELFTC_ISDIGIT(*(d->p + 1))) { in read_func_name()
474 ++d->p; in read_func_name()
476 assert(d->vec.size > 0); in read_func_name()
478 len = strlen(d->vec.container[d->vec.size - 1]); in read_func_name()
484 d->vec.container[d->vec.size - 1]); in read_func_name()
485 vector_str_pop(&d->vec); in read_func_name()
487 if (read_qual_name(d) == false) in read_func_name()
490 if (VEC_PUSH_STR(&d->vec, "::") == false) in read_func_name()
493 if (vector_str_push(&d->vec, op_name, len) == false) in read_func_name()
497 } else if (ELFTC_ISDIGIT(*d->p)) { in read_func_name()
498 assert(d->vec.size > 0); in read_func_name()
500 len = strlen(d->vec.container[d->vec.size - 1]); in read_func_name()
506 d->vec.container[d->vec.size - 1]); in read_func_name()
507 vector_str_pop(&d->vec); in read_func_name()
509 if (read_class(d) == false) in read_func_name()
512 if (VEC_PUSH_STR(&d->vec, "::") == false) in read_func_name()
515 if (vector_str_push(&d->vec, op_name, len) == false) in read_func_name()
521 return (read_func(d)); in read_func_name()
531 read_func_ptr(struct demangle_data *d) in read_func_ptr() argument
538 if (d == NULL) in read_func_ptr()
544 fptr.p = d->p + 1; in read_func_ptr()
605 d->p = fptr.p + 1; in read_func_ptr()
615 fptr.p = d->p; in read_func_ptr()
626 d->p = fptr.p; in read_func_ptr()
631 if (vector_str_push(&d->vec, rtn_type, rtn_len) == false) { in read_func_ptr()
640 if (VEC_PUSH_STR(&d->vec, " (*)(") == false) { in read_func_ptr()
646 if (vector_str_push(&d->vec, arg_type, arg_len) == false) { in read_func_ptr()
654 return (VEC_PUSH_STR(&d->vec, ")")); in read_func_ptr()
658 read_memptr(struct demangle_data *d) in read_memptr() argument
665 if (d == NULL || d->p == NULL) in read_memptr()
674 mptr.p = d->p; in read_memptr()
685 d->p = mptr.p; in read_memptr()
690 if (vector_str_push(&d->vec, mptr_str, len) == false) in read_memptr()
693 if (VEC_PUSH_STR(&d->vec, "::*") == false) in read_memptr()
705 read_op(struct demangle_data *d) in read_op() argument
708 if (d == NULL) in read_op()
711 assert(d->p != NULL && "d->p (org str) is NULL"); in read_op()
713 switch (SIMPLE_HASH(*(d->p), *(d->p+1))) { in read_op()
715 d->p += 2; in read_op()
716 return (VEC_PUSH_STR(&d->vec, "operator*")); in read_op()
718 d->p += 2; in read_op()
719 return (VEC_PUSH_STR(&d->vec, "operator/")); in read_op()
721 d->p += 2; in read_op()
722 return (VEC_PUSH_STR(&d->vec, "operator%")); in read_op()
724 d->p += 2; in read_op()
725 return (VEC_PUSH_STR(&d->vec, "operator+")); in read_op()
727 d->p += 2; in read_op()
728 return (VEC_PUSH_STR(&d->vec, "operator-")); in read_op()
730 d->p += 2; in read_op()
731 return (VEC_PUSH_STR(&d->vec, "operator<<")); in read_op()
733 d->p += 2; in read_op()
734 return (VEC_PUSH_STR(&d->vec, "operator>>")); in read_op()
736 d->p += 2; in read_op()
737 return (VEC_PUSH_STR(&d->vec, "operator==")); in read_op()
739 d->p += 2; in read_op()
740 return (VEC_PUSH_STR(&d->vec, "operator!=")); in read_op()
742 d->p += 2; in read_op()
743 return (VEC_PUSH_STR(&d->vec, "operator<")); in read_op()
745 d->p += 2; in read_op()
746 return (VEC_PUSH_STR(&d->vec, "operator>")); in read_op()
748 d->p += 2; in read_op()
749 return (VEC_PUSH_STR(&d->vec, "operator<=")); in read_op()
751 d->p += 2; in read_op()
752 return (VEC_PUSH_STR(&d->vec, "operator>=")); in read_op()
754 d->p += 2; in read_op()
755 if (*d->p == 'v') { in read_op()
756 ++d->p; in read_op()
757 return (VEC_PUSH_STR(&d->vec, "operator/=")); in read_op()
759 return (VEC_PUSH_STR(&d->vec, "operator&")); in read_op()
761 d->p += 2; in read_op()
762 return (VEC_PUSH_STR(&d->vec, "operator|")); in read_op()
764 d->p += 2; in read_op()
765 return (VEC_PUSH_STR(&d->vec, "operator^")); in read_op()
767 d->p += 2; in read_op()
768 if (*d->p == 'd') { in read_op()
769 ++d->p; in read_op()
770 return (VEC_PUSH_STR(&d->vec, "operator&=")); in read_op()
772 return (VEC_PUSH_STR(&d->vec, "operator&&")); in read_op()
774 d->p += 2; in read_op()
775 return (VEC_PUSH_STR(&d->vec, "operator||")); in read_op()
777 d->p += 2; in read_op()
778 return (VEC_PUSH_STR(&d->vec, "operator!")); in read_op()
780 d->p += 2; in read_op()
781 return (VEC_PUSH_STR(&d->vec, "operator~")); in read_op()
783 d->p += 2; in read_op()
784 return (VEC_PUSH_STR(&d->vec, "operator++")); in read_op()
786 d->p += 2; in read_op()
787 return (VEC_PUSH_STR(&d->vec, "operator--")); in read_op()
789 d->p += 2; in read_op()
790 return (VEC_PUSH_STR(&d->vec, "operator=")); in read_op()
792 d->p += 2; in read_op()
793 return (VEC_PUSH_STR(&d->vec, "operator->")); in read_op()
796 if (*(d->p + 2) != 'l') in read_op()
799 d->p += 3; in read_op()
800 return (VEC_PUSH_STR(&d->vec, "operator+=")); in read_op()
802 d->p += 2; in read_op()
803 if (*d->p == 'i') { in read_op()
804 ++d->p; in read_op()
805 return (VEC_PUSH_STR(&d->vec, "operator-=")); in read_op()
806 } else if (*d->p == 'u') { in read_op()
807 ++d->p; in read_op()
808 return (VEC_PUSH_STR(&d->vec, "operator*=")); in read_op()
809 } else if (*d->p == 'd') { in read_op()
810 ++d->p; in read_op()
811 return (VEC_PUSH_STR(&d->vec, "operator%=")); in read_op()
817 if (*(d->p + 2) != 's') in read_op()
820 d->p += 3; in read_op()
821 return (VEC_PUSH_STR(&d->vec, "operator<<=")); in read_op()
824 if (*(d->p + 2) != 's') in read_op()
827 d->p += 3; in read_op()
828 return (VEC_PUSH_STR(&d->vec, "operator>>=")); in read_op()
831 if (*(d->p + 2) != 'r') in read_op()
834 d->p += 3; in read_op()
835 return (VEC_PUSH_STR(&d->vec, "operator|=")); in read_op()
838 if (*(d->p + 2) != 'r') in read_op()
841 d->p += 3; in read_op()
842 return (VEC_PUSH_STR(&d->vec, "operator^=")); in read_op()
844 d->p += 2; in read_op()
845 return (VEC_PUSH_STR(&d->vec, "operator,")); in read_op()
847 d->p += 2; in read_op()
848 return (VEC_PUSH_STR(&d->vec, "operator->*")); in read_op()
850 d->p += 2; in read_op()
851 return (VEC_PUSH_STR(&d->vec, "()")); in read_op()
853 d->p += 2; in read_op()
854 return (VEC_PUSH_STR(&d->vec, "[]")); in read_op()
856 d->p += 4; in read_op()
857 d->type = ENCODE_OP_CT; in read_op()
859 if (*d->p == 'Q' && ELFTC_ISDIGIT(*(d->p + 1))) { in read_op()
860 ++d->p; in read_op()
862 return (read_qual_name(d)); in read_op()
863 } else if (ELFTC_ISDIGIT(*d->p)) in read_op()
864 return (read_class(d)); in read_op()
868 d->p += 4; in read_op()
869 d->type = ENCODE_OP_DT; in read_op()
871 if (*d->p == 'Q' && ELFTC_ISDIGIT(*(d->p + 1))) { in read_op()
872 ++d->p; in read_op()
874 return (read_qual_name(d)); in read_op()
875 } else if (ELFTC_ISDIGIT(*d->p)) in read_op()
876 return (read_class(d)); in read_op()
880 d->p += 2; in read_op()
881 return (VEC_PUSH_STR(&d->vec, "operator new()")); in read_op()
883 d->p += 2; in read_op()
884 return (VEC_PUSH_STR(&d->vec, "operator delete()")); in read_op()
887 d->p += 2; in read_op()
889 d->type = ENCODE_OP_USER; in read_op()
891 return (read_op_user(d)); in read_op()
898 read_op_user(struct demangle_data *d) in read_op_user() argument
905 if (d == NULL) in read_op_user()
917 to.p = d->p; in read_op_user()
956 if (vector_str_push(&d->vec, from_str, from_len) == false) in read_op_user()
959 if (VEC_PUSH_STR(&d->vec, "::operator ") == false) in read_op_user()
962 if (vector_str_push(&d->vec, to_str, to_len) == false) in read_op_user()
965 rtn = VEC_PUSH_STR(&d->vec, "()"); in read_op_user()
977 read_qual_name(struct demangle_data *d) in read_qual_name() argument
982 if (d == NULL) in read_qual_name()
985 assert(d->p != NULL && "d->p (org str) is NULL"); in read_qual_name()
986 assert(*d->p > 48 && *d->p < 58 && "*d->p not in ASCII numeric range"); in read_qual_name()
988 num = *d->p - 48; in read_qual_name()
992 ++d->p; in read_qual_name()
994 if (read_class(d) == false) in read_qual_name()
997 if (VEC_PUSH_STR(&d->vec, "::") == false) in read_qual_name()
1001 if (*d->p != '\0') in read_qual_name()
1002 d->p = d->p + 2; in read_qual_name()
1009 read_subst(struct demangle_data *d) in read_subst() argument
1014 if (d == NULL) in read_subst()
1017 idx = strtol(d->p + 1, &str, 10); in read_subst()
1024 d->p = str; in read_subst()
1026 if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false) in read_subst()
1029 if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false) in read_subst()
1032 if (*d->p == '\0') in read_subst()
1039 read_subst_iter(struct demangle_data *d) in read_subst_iter() argument
1046 if (d == NULL) in read_subst_iter()
1049 ++d->p; in read_subst_iter()
1050 assert(*d->p > 48 && *d->p < 58 && "*d->p not in ASCII numeric range"); in read_subst_iter()
1052 repeat = *d->p - 48; in read_subst_iter()
1056 ++d->p; in read_subst_iter()
1058 idx = strtol(d->p, &str, 10); in read_subst_iter()
1065 d->p = str; in read_subst_iter()
1068 if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false) in read_subst_iter()
1071 if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false) in read_subst_iter()
1075 VEC_PUSH_STR(&d->vec, ", ") == false) in read_subst_iter()
1079 if (*d->p == '\0') in read_subst_iter()
1086 read_type(struct demangle_data *d) in read_type() argument
1089 if (d == NULL) in read_type()
1092 assert(d->p != NULL && "d->p (org str) is NULL"); in read_type()
1094 while (*d->p == 'U' || *d->p == 'C' || *d->p == 'V' || *d->p == 'S' || in read_type()
1095 *d->p == 'P' || *d->p == 'R' || *d->p == 'A' || *d->p == 'F' || in read_type()
1096 *d->p == 'M') { in read_type()
1097 switch (*d->p) { in read_type()
1099 ++d->p; in read_type()
1101 if (VEC_PUSH_STR(&d->vec, "unsigned ") == false) in read_type()
1106 ++d->p; in read_type()
1108 if (*d->p == 'P') in read_type()
1109 d->cnst = true; in read_type()
1111 if (VEC_PUSH_STR(&d->vec, "const ") == in read_type()
1118 ++d->p; in read_type()
1120 if (VEC_PUSH_STR(&d->vec, "volatile ") == false) in read_type()
1125 ++d->p; in read_type()
1127 if (VEC_PUSH_STR(&d->vec, "signed ") == false) in read_type()
1132 ++d->p; in read_type()
1134 if (*d->p == 'F') in read_type()
1135 return (read_func_ptr(d)); in read_type()
1137 d->ptr = true; in read_type()
1141 ++d->p; in read_type()
1143 d->ref = true; in read_type()
1149 ++d->p; in read_type()
1151 if (read_array(d) == false) in read_type()
1156 ++d->p; in read_type()
1158 if (read_memptr(d) == false) in read_type()
1167 if (ELFTC_ISDIGIT(*d->p)) in read_type()
1168 return (read_class(d)); in read_type()
1170 switch (*d->p) { in read_type()
1172 ++d->p; in read_type()
1174 return (read_qual_name(d)); in read_type()
1176 ++d->p; in read_type()
1178 return (VEC_PUSH_STR(&d->vec, "void")); in read_type()
1180 ++d->p; in read_type()
1182 return (VEC_PUSH_STR(&d->vec, "char")); in read_type()
1184 ++d->p; in read_type()
1186 return (VEC_PUSH_STR(&d->vec, "short")); in read_type()
1188 ++d->p; in read_type()
1190 return (VEC_PUSH_STR(&d->vec, "int")); in read_type()
1192 ++d->p; in read_type()
1194 return (VEC_PUSH_STR(&d->vec, "long")); in read_type()
1196 ++d->p; in read_type()
1198 return (VEC_PUSH_STR(&d->vec, "float")); in read_type()
1200 ++d->p; in read_type()
1202 return (VEC_PUSH_STR(&d->vec, "double")); in read_type()
1204 ++d->p; in read_type()
1206 return (VEC_PUSH_STR(&d->vec, "long double")); in read_type()
1208 ++d->p; in read_type()
1210 return (VEC_PUSH_STR(&d->vec, "...")); in read_type()