Lines Matching refs:state

61 #define	INDENT state->ns_indent, MSG_ORIG(MSG_STR_EMPTY)
80 print_num(state, _title, &layout->_field, SL_FMT_NUM_DEC)
82 print_num_2up(state, _title1, &layout->_field1, SL_FMT_NUM_DEC, \
85 print_num(state, _title, &layout->_field, SL_FMT_NUM_HEX)
87 print_num_2up(state, _title1, &layout->_field1, SL_FMT_NUM_HEX, \
90 print_num(state, _title, &layout->_field, SL_FMT_NUM_ZHEX)
92 print_num_2up(state, _title1, &layout->_field1, SL_FMT_NUM_ZHEX, \
95 print_subtype(state, _title, &layout->_field, _func)
97 print_strbuf(state, _title, &layout->_field)
121 typedef void (* dump_func_t)(note_state_t *state, const char *title);
201 extract_as_word(note_state_t *state, const sl_field_t *fdesc) in extract_as_word() argument
203 return (sl_extract_as_word(state->ns_data, state->ns_swap, fdesc)); in extract_as_word()
206 extract_as_lword(note_state_t *state, const sl_field_t *fdesc) in extract_as_lword() argument
208 return (sl_extract_as_lword(state->ns_data, state->ns_swap, fdesc)); in extract_as_lword()
211 extract_as_sword(note_state_t *state, const sl_field_t *fdesc) in extract_as_sword() argument
213 return (sl_extract_as_sword(state->ns_data, state->ns_swap, fdesc)); in extract_as_sword()
216 fmt_num(note_state_t *state, const sl_field_t *fdesc, in fmt_num() argument
219 return (sl_fmt_num(state->ns_data, state->ns_swap, fdesc, in fmt_num()
228 data_present(note_state_t *state, const sl_field_t *fdesc) in data_present() argument
230 return ((fdesc->slf_offset + fdesc->slf_eltlen) <= state->ns_len); in data_present()
240 indent_enter(note_state_t *state, const char *title, in indent_enter() argument
249 if (data_present(state, first_fdesc)) in indent_enter()
252 state->ns_indent += INDENT_STEP; in indent_enter()
255 indent_exit(note_state_t *state) in indent_exit() argument
257 state->ns_indent -= INDENT_STEP; in indent_exit()
267 print_num(note_state_t *state, const char *title, in print_num() argument
278 if (!data_present(state, fdesc)) in print_num()
282 state->ns_vcol - state->ns_indent, title, in print_num()
283 fmt_num(state, fdesc, fmt_type, buf)); in print_num()
292 print_num_2up(note_state_t *state, const char *title1, in print_num_2up() argument
304 if (!(data_present(state, fdesc1) && in print_num_2up()
305 data_present(state, fdesc2))) in print_num_2up()
309 state->ns_vcol - state->ns_indent, title1, in print_num_2up()
310 state->ns_t2col - state->ns_vcol, in print_num_2up()
311 fmt_num(state, fdesc1, fmt_type1, buf1), in print_num_2up()
312 state->ns_v2col - state->ns_t2col, title2, in print_num_2up()
313 fmt_num(state, fdesc2, fmt_type2, buf2)); in print_num_2up()
323 print_strbuf(note_state_t *state, const char *title, in print_strbuf() argument
336 if (fdesc->slf_offset >= state->ns_len) in print_strbuf()
344 n = state->ns_len - fdesc->slf_offset; in print_strbuf()
349 state->ns_vcol - state->ns_indent, in print_strbuf()
350 title, safe_str(fdesc->slf_offset + state->ns_data, n)); in print_strbuf()
360 print_str(note_state_t *state, const char *title, const char *str) in print_str() argument
363 state->ns_vcol - state->ns_indent, title, str); in print_str()
374 print_subtype(note_state_t *state, const char *title, in print_subtype() argument
385 if (fdesc->slf_offset >= state->ns_len) in print_subtype()
391 sub_state = *state; in print_subtype()
416 print_array(note_state_t *state, const sl_field_t *base_desc, in print_array() argument
428 indent_enter(state, title, base_desc); in print_array()
434 if (!data_present(state, &fdesc1)) in print_array()
438 print_num(state, index1, &fdesc1, fmt_type); in print_array()
446 if (!(data_present(state, &fdesc1) && in print_array()
447 data_present(state, &fdesc2))) in print_array()
453 print_num_2up(state, index1, &fdesc1, fmt_type, in print_array()
459 indent_exit(state); in print_array()
467 dump_auxv(note_state_t *state, const char *title) in dump_auxv() argument
469 const sl_auxv_layout_t *layout = state->ns_arch->auxv; in dump_auxv()
485 indent_enter(state, title, &layout->sizeof_struct); in dump_auxv()
493 indent_exit(state); in dump_auxv()
496 while (state->ns_len > sizeof_auxv) { in dump_auxv()
504 type = extract_as_word(state, &layout->a_type); in dump_auxv()
510 while ((state->ns_len - sizeof_auxv) >= sizeof_auxv) { in dump_auxv()
511 type = extract_as_word(state, &a_type_next); in dump_auxv()
515 state->ns_data += sizeof_auxv; in dump_auxv()
516 state->ns_len -= sizeof_auxv; in dump_auxv()
543 w = extract_as_word(state, &layout->a_val); in dump_auxv()
544 vstr = conv_ehdr_flags(state->ns_mach, w, in dump_auxv()
549 w = extract_as_word(state, &layout->a_val); in dump_auxv()
550 vstr = conv_cap_val_hw1(w, state->ns_mach, in dump_auxv()
570 w = extract_as_word(state, &layout->a_val); in dump_auxv()
571 vstr = conv_cap_val_hw2(w, state->ns_mach, in dump_auxv()
591 w = extract_as_word(state, &layout->a_val); in dump_auxv()
592 vstr = conv_cap_val_hw3(w, state->ns_mach, in dump_auxv()
613 w = extract_as_word(state, &layout->a_val); in dump_auxv()
628 vstr = fmt_num(state, &layout->a_val, num_fmt, buf); in dump_auxv()
630 state->ns_vcol - state->ns_indent, in dump_auxv()
634 state->ns_data += sizeof_auxv; in dump_auxv()
635 state->ns_len -= sizeof_auxv; in dump_auxv()
645 dump_fltset(note_state_t *state, const char *title) in dump_fltset() argument
649 const sl_fltset_layout_t *layout = state->ns_arch->fltset; in dump_fltset()
655 if (!data_present(state, &layout->sizeof_struct)) in dump_fltset()
663 mask[i] = extract_as_word(state, &fdesc); in dump_fltset()
667 print_str(state, title, conv_cnote_fltset(mask, nelts, 0, &buf)); in dump_fltset()
677 dump_sigset(note_state_t *state, const char *title) in dump_sigset() argument
681 const sl_sigset_layout_t *layout = state->ns_arch->sigset; in dump_sigset()
687 if (!data_present(state, &layout->sizeof_struct)) in dump_sigset()
695 mask[i] = extract_as_word(state, &fdesc); in dump_sigset()
699 print_str(state, title, conv_cnote_sigset(mask, nelts, 0, &buf)); in dump_sigset()
709 dump_sigaction(note_state_t *state, const char *title) in dump_sigaction() argument
711 const sl_sigaction_layout_t *layout = state->ns_arch->sigaction; in dump_sigaction()
715 indent_enter(state, title, &layout->sa_flags); in dump_sigaction()
717 if (data_present(state, &layout->sa_flags)) { in dump_sigaction()
718 w = extract_as_word(state, &layout->sa_flags); in dump_sigaction()
719 print_str(state, MSG_ORIG(MSG_CNOTE_T_SA_FLAGS), in dump_sigaction()
727 indent_exit(state); in dump_sigaction()
735 dump_siginfo(note_state_t *state, const char *title) in dump_siginfo() argument
737 const sl_siginfo_layout_t *layout = state->ns_arch->siginfo; in dump_siginfo()
742 if (!data_present(state, &layout->sizeof_struct)) in dump_siginfo()
745 indent_enter(state, title, &layout->f_si_signo); in dump_siginfo()
747 v_si_signo = extract_as_sword(state, &layout->f_si_signo); in dump_siginfo()
748 print_str(state, MSG_ORIG(MSG_CNOTE_T_SI_SIGNO), in dump_siginfo()
751 w = extract_as_word(state, &layout->f_si_errno); in dump_siginfo()
752 print_str(state, MSG_ORIG(MSG_CNOTE_T_SI_ERRNO), in dump_siginfo()
755 v_si_code = extract_as_sword(state, &layout->f_si_code); in dump_siginfo()
756 print_str(state, MSG_ORIG(MSG_CNOTE_T_SI_CODE), in dump_siginfo()
757 conv_cnote_si_code(state->ns_mach, v_si_signo, v_si_code, in dump_siginfo()
761 indent_exit(state); in dump_siginfo()
776 indent_enter(state, MSG_ORIG(MSG_CNOTE_T_SI_VALUE), in dump_siginfo()
782 indent_exit(state); in dump_siginfo()
785 indent_exit(state); in dump_siginfo()
811 indent_exit(state); in dump_siginfo()
819 dump_stack(note_state_t *state, const char *title) in dump_stack() argument
821 const sl_stack_layout_t *layout = state->ns_arch->stack; in dump_stack()
825 indent_enter(state, title, &layout->ss_size); in dump_stack()
827 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_SS_SP), &layout->ss_sp, in dump_stack()
831 if (data_present(state, &layout->ss_flags)) { in dump_stack()
832 w = extract_as_word(state, &layout->ss_flags); in dump_stack()
833 print_str(state, MSG_ORIG(MSG_CNOTE_T_SS_FLAGS), in dump_stack()
837 indent_exit(state); in dump_stack()
845 dump_sysset(note_state_t *state, const char *title) in dump_sysset() argument
849 const sl_sysset_layout_t *layout = state->ns_arch->sysset; in dump_sysset()
855 if (!data_present(state, &layout->sizeof_struct)) in dump_sysset()
863 mask[i] = extract_as_word(state, &fdesc); in dump_sysset()
867 print_str(state, title, conv_cnote_sysset(mask, nelts, 0, &buf)); in dump_sysset()
877 dump_timestruc(note_state_t *state, const char *title) in dump_timestruc() argument
879 const sl_timestruc_layout_t *layout = state->ns_arch->timestruc; in dump_timestruc()
881 indent_enter(state, title, &layout->tv_sec); in dump_timestruc()
886 indent_exit(state); in dump_timestruc()
893 dump_secflags(note_state_t *state, const char *title) in dump_secflags() argument
895 const sl_prsecflags_layout_t *layout = state->ns_arch->prsecflags; in dump_secflags()
900 indent_enter(state, title, &layout->pr_version); in dump_secflags()
902 w = extract_as_word(state, &layout->pr_version); in dump_secflags()
906 dump_hex_bytes(state->ns_data, state->ns_len, state->ns_indent, in dump_secflags()
910 lw = extract_as_lword(state, &layout->pr_effective); in dump_secflags()
911 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_EFFECTIVE), in dump_secflags()
914 lw = extract_as_lword(state, &layout->pr_inherit); in dump_secflags()
915 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_INHERIT), in dump_secflags()
918 lw = extract_as_lword(state, &layout->pr_lower); in dump_secflags()
919 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_LOWER), in dump_secflags()
922 lw = extract_as_lword(state, &layout->pr_upper); in dump_secflags()
923 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_UPPER), in dump_secflags()
927 indent_exit(state); in dump_secflags()
934 dump_utsname(note_state_t *state, const char *title) in dump_utsname() argument
936 const sl_utsname_layout_t *layout = state->ns_arch->utsname; in dump_utsname()
938 indent_enter(state, title, &layout->sysname); in dump_utsname()
946 indent_exit(state); in dump_utsname()
954 dump_prgregset(note_state_t *state, const char *title) in dump_prgregset() argument
961 fdesc1 = fdesc2 = state->ns_arch->prgregset->elt0; in dump_prgregset()
962 indent_enter(state, title, &fdesc1); in dump_prgregset()
967 if (!data_present(state, &fdesc1)) in dump_prgregset()
970 INDENT, state->ns_vcol - state->ns_indent, in dump_prgregset()
971 conv_cnote_pr_regname(state->ns_mach, w, in dump_prgregset()
973 fmt_num(state, &fdesc1, SL_FMT_NUM_ZHEX, buf1)); in dump_prgregset()
981 if (!(data_present(state, &fdesc1) && in dump_prgregset()
982 data_present(state, &fdesc2))) in dump_prgregset()
985 state->ns_vcol - state->ns_indent, in dump_prgregset()
986 conv_cnote_pr_regname(state->ns_mach, w, in dump_prgregset()
988 state->ns_t2col - state->ns_vcol, in dump_prgregset()
989 fmt_num(state, &fdesc1, SL_FMT_NUM_ZHEX, buf1), in dump_prgregset()
990 state->ns_v2col - state->ns_t2col, in dump_prgregset()
991 conv_cnote_pr_regname(state->ns_mach, w + 1, in dump_prgregset()
993 fmt_num(state, &fdesc2, SL_FMT_NUM_ZHEX, buf2)); in dump_prgregset()
998 indent_exit(state); in dump_prgregset()
1005 dump_lwpstatus(note_state_t *state, const char *title) in dump_lwpstatus() argument
1007 const sl_lwpstatus_layout_t *layout = state->ns_arch->lwpstatus; in dump_lwpstatus()
1015 indent_enter(state, title, &layout->pr_flags); in dump_lwpstatus()
1017 if (data_present(state, &layout->pr_flags)) { in dump_lwpstatus()
1018 w = extract_as_word(state, &layout->pr_flags); in dump_lwpstatus()
1019 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAGS), in dump_lwpstatus()
1025 if (data_present(state, &layout->pr_why)) { in dump_lwpstatus()
1026 w = extract_as_word(state, &layout->pr_why); in dump_lwpstatus()
1027 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHY), in dump_lwpstatus()
1030 if (data_present(state, &layout->pr_what)) { in dump_lwpstatus()
1031 w2 = extract_as_word(state, &layout->pr_what); in dump_lwpstatus()
1032 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHAT), in dump_lwpstatus()
1037 if (data_present(state, &layout->pr_cursig)) { in dump_lwpstatus()
1038 w = extract_as_word(state, &layout->pr_cursig); in dump_lwpstatus()
1039 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_CURSIG), in dump_lwpstatus()
1055 if (data_present(state, &layout->pr_syscall)) { in dump_lwpstatus()
1056 w = extract_as_word(state, &layout->pr_syscall); in dump_lwpstatus()
1057 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_SYSCALL), in dump_lwpstatus()
1063 if (data_present(state, &layout->pr_errno)) { in dump_lwpstatus()
1064 w = extract_as_word(state, &layout->pr_errno); in dump_lwpstatus()
1065 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_ERRNO), in dump_lwpstatus()
1069 if (data_present(state, &layout->pr_nsysarg)) { in dump_lwpstatus()
1070 w2 = extract_as_word(state, &layout->pr_nsysarg); in dump_lwpstatus()
1071 print_array(state, &layout->pr_sysarg, SL_FMT_NUM_ZHEX, w2, 1, in dump_lwpstatus()
1083 if (data_present(state, &layout->pr_errpriv)) { in dump_lwpstatus()
1084 i = extract_as_sword(state, &layout->pr_errpriv); in dump_lwpstatus()
1085 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_ERRPRIV), in dump_lwpstatus()
1099 state->ns_vcol += 3; in dump_lwpstatus()
1100 state->ns_t2col += 3; in dump_lwpstatus()
1101 state->ns_v2col += 2; in dump_lwpstatus()
1103 state->ns_vcol -= 3; in dump_lwpstatus()
1104 state->ns_t2col -= 3; in dump_lwpstatus()
1105 state->ns_v2col -= 2; in dump_lwpstatus()
1113 if (data_present(state, &layout->pr_fpreg)) { in dump_lwpstatus()
1114 indent_enter(state, MSG_ORIG(MSG_CNOTE_T_PR_FPREG), in dump_lwpstatus()
1116 dump_hex_bytes(layout->pr_fpreg.slf_offset + state->ns_data, in dump_lwpstatus()
1117 layout->pr_fpreg.slf_eltlen, state->ns_indent, 4, 3); in dump_lwpstatus()
1118 indent_exit(state); in dump_lwpstatus()
1121 indent_exit(state); in dump_lwpstatus()
1129 dump_pstatus(note_state_t *state, const char *title) in dump_pstatus() argument
1131 const sl_pstatus_layout_t *layout = state->ns_arch->pstatus; in dump_pstatus()
1138 indent_enter(state, title, &layout->pr_flags); in dump_pstatus()
1140 if (data_present(state, &layout->pr_flags)) { in dump_pstatus()
1141 w = extract_as_word(state, &layout->pr_flags); in dump_pstatus()
1142 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAGS), in dump_pstatus()
1155 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_BRKBASE), in dump_pstatus()
1159 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_STKBASE), in dump_pstatus()
1178 if (data_present(state, &layout->pr_dmodel)) { in dump_pstatus()
1179 w = extract_as_word(state, &layout->pr_dmodel); in dump_pstatus()
1180 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_DMODEL), in dump_pstatus()
1196 state->ns_vcol += 5; in dump_pstatus()
1197 state->ns_t2col += 5; in dump_pstatus()
1198 state->ns_v2col += 5; in dump_pstatus()
1201 state->ns_vcol -= 5; in dump_pstatus()
1202 state->ns_t2col -= 5; in dump_pstatus()
1203 state->ns_v2col -= 5; in dump_pstatus()
1205 indent_exit(state); in dump_pstatus()
1213 dump_prstatus(note_state_t *state, const char *title) in dump_prstatus() argument
1215 const sl_prstatus_layout_t *layout = state->ns_arch->prstatus; in dump_prstatus()
1223 indent_enter(state, title, &layout->pr_flags); in dump_prstatus()
1225 if (data_present(state, &layout->pr_flags)) { in dump_prstatus()
1226 w = extract_as_word(state, &layout->pr_flags); in dump_prstatus()
1227 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAGS), in dump_prstatus()
1231 if (data_present(state, &layout->pr_why)) { in dump_prstatus()
1232 w = extract_as_word(state, &layout->pr_why); in dump_prstatus()
1233 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHY), in dump_prstatus()
1237 if (data_present(state, &layout->pr_what)) { in dump_prstatus()
1238 w2 = extract_as_word(state, &layout->pr_what); in dump_prstatus()
1239 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHAT), in dump_prstatus()
1246 if (data_present(state, &layout->pr_cursig)) { in dump_prstatus()
1247 w = extract_as_word(state, &layout->pr_cursig); in dump_prstatus()
1248 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_CURSIG), in dump_prstatus()
1273 if (data_present(state, &layout->pr_syscall)) { in dump_prstatus()
1274 w = extract_as_word(state, &layout->pr_syscall); in dump_prstatus()
1275 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_SYSCALL), in dump_prstatus()
1281 if (data_present(state, &layout->pr_nsysarg)) { in dump_prstatus()
1282 w2 = extract_as_word(state, &layout->pr_nsysarg); in dump_prstatus()
1283 print_array(state, &layout->pr_sysarg, SL_FMT_NUM_ZHEX, w2, 1, in dump_prstatus()
1291 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_BRKBASE), in dump_prstatus()
1295 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_STKBASE), in dump_prstatus()
1301 if (data_present(state, &layout->pr_bind)) { in dump_prstatus()
1302 i = extract_as_sword(state, &layout->pr_bind); in dump_prstatus()
1303 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_BIND), in dump_prstatus()
1310 indent_exit(state); in dump_prstatus()
1315 dump_lwpname(note_state_t *state, const char *title) in dump_lwpname() argument
1317 const sl_prlwpname_layout_t *layout = state->ns_arch->prlwpname; in dump_lwpname()
1319 indent_enter(state, title, &layout->pr_lwpid); in dump_lwpname()
1324 indent_exit(state); in dump_lwpname()
1335 prtpct_value(note_state_t *state, const sl_field_t *fdesc, in prtpct_value() argument
1340 value = extract_as_word(state, fdesc); in prtpct_value()
1357 prtpct_2up(note_state_t *state, const sl_field_t *fdesc1, in prtpct_2up() argument
1362 if (!(data_present(state, fdesc1) && in prtpct_2up()
1363 data_present(state, fdesc2))) in prtpct_2up()
1367 state->ns_vcol - state->ns_indent, title1, in prtpct_2up()
1368 state->ns_t2col - state->ns_vcol, in prtpct_2up()
1369 prtpct_value(state, fdesc1, buf1), in prtpct_2up()
1370 state->ns_v2col - state->ns_t2col, title2, in prtpct_2up()
1371 prtpct_value(state, fdesc2, buf2)); in prtpct_2up()
1381 print_state_sname_2up(note_state_t *state, in print_state_sname_2up() argument
1394 if (!(data_present(state, state_fdesc) && in print_state_sname_2up()
1395 data_present(state, sname_fdesc))) in print_state_sname_2up()
1398 sname = extract_as_sword(state, sname_fdesc); in print_state_sname_2up()
1403 state->ns_vcol - state->ns_indent, MSG_ORIG(MSG_CNOTE_T_PR_STATE), in print_state_sname_2up()
1404 state->ns_t2col - state->ns_vcol, in print_state_sname_2up()
1405 fmt_num(state, state_fdesc, SL_FMT_NUM_DEC, buf1), in print_state_sname_2up()
1406 state->ns_v2col - state->ns_t2col, MSG_ORIG(MSG_CNOTE_T_PR_SNAME), in print_state_sname_2up()
1414 dump_lwpsinfo(note_state_t *state, const char *title) in dump_lwpsinfo() argument
1416 const sl_lwpsinfo_layout_t *layout = state->ns_arch->lwpsinfo; in dump_lwpsinfo()
1424 indent_enter(state, title, &layout->pr_flag); in dump_lwpsinfo()
1426 if (data_present(state, &layout->pr_flag)) { in dump_lwpsinfo()
1427 w = extract_as_word(state, &layout->pr_flag); in dump_lwpsinfo()
1428 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAG), in dump_lwpsinfo()
1432 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_LWPID), &layout->pr_lwpid, in dump_lwpsinfo()
1437 if (data_present(state, &layout->pr_stype)) { in dump_lwpsinfo()
1438 w = extract_as_word(state, &layout->pr_stype); in dump_lwpsinfo()
1439 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_STYPE), in dump_lwpsinfo()
1443 print_state_sname_2up(state, &layout->pr_state, &layout->pr_sname); in dump_lwpsinfo()
1447 if (data_present(state, &layout->pr_syscall)) { in dump_lwpsinfo()
1448 w = extract_as_word(state, &layout->pr_syscall); in dump_lwpsinfo()
1449 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_SYSCALL), in dump_lwpsinfo()
1456 if (data_present(state, &layout->pr_pri) && in dump_lwpsinfo()
1457 data_present(state, &layout->pr_pctcpu)) { in dump_lwpsinfo()
1461 state->ns_vcol - state->ns_indent, in dump_lwpsinfo()
1463 state->ns_t2col - state->ns_vcol, in dump_lwpsinfo()
1464 fmt_num(state, &layout->pr_pri, SL_FMT_NUM_DEC, buf1), in dump_lwpsinfo()
1465 state->ns_v2col - state->ns_t2col, in dump_lwpsinfo()
1467 prtpct_value(state, &layout->pr_pctcpu, buf2)); in dump_lwpsinfo()
1477 if (data_present(state, &layout->pr_bindpset)) { in dump_lwpsinfo()
1478 i = extract_as_sword(state, &layout->pr_bindpset); in dump_lwpsinfo()
1479 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_BINDPSET), in dump_lwpsinfo()
1485 indent_exit(state); in dump_lwpsinfo()
1493 dump_psinfo(note_state_t *state, const char *title) in dump_psinfo() argument
1495 const sl_psinfo_layout_t *layout = state->ns_arch->psinfo; in dump_psinfo()
1502 indent_enter(state, title, &layout->pr_flag); in dump_psinfo()
1504 if (data_present(state, &layout->pr_flag)) { in dump_psinfo()
1505 w = extract_as_word(state, &layout->pr_flag); in dump_psinfo()
1506 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAG), in dump_psinfo()
1519 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_ADDR), &layout->pr_addr, in dump_psinfo()
1522 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_RSSIZE), in dump_psinfo()
1525 prtpct_2up(state, &layout->pr_pctcpu, MSG_ORIG(MSG_CNOTE_T_PR_PCTCPU), in dump_psinfo()
1532 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_WSTAT), &layout->pr_wstat, in dump_psinfo()
1538 if (data_present(state, &layout->pr_dmodel)) { in dump_psinfo()
1539 w = extract_as_word(state, &layout->pr_dmodel); in dump_psinfo()
1540 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_DMODEL), in dump_psinfo()
1553 indent_exit(state); in dump_psinfo()
1560 dump_prpsinfo(note_state_t *state, const char *title) in dump_prpsinfo() argument
1562 const sl_prpsinfo_layout_t *layout = state->ns_arch->prpsinfo; in dump_prpsinfo()
1569 indent_enter(state, title, &layout->pr_state); in dump_prpsinfo()
1571 print_state_sname_2up(state, &layout->pr_state, &layout->pr_sname); in dump_prpsinfo()
1575 if (data_present(state, &layout->pr_flag)) { in dump_prpsinfo()
1576 w = extract_as_word(state, &layout->pr_flag); in dump_prpsinfo()
1577 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAG), in dump_prpsinfo()
1588 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_ADDR), &layout->pr_addr, in dump_prpsinfo()
1604 if (data_present(state, &layout->pr_syscall)) { in dump_prpsinfo()
1605 w = extract_as_word(state, &layout->pr_syscall); in dump_prpsinfo()
1606 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_SYSCALL), in dump_prpsinfo()
1613 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_ARGC), &layout->pr_argc, in dump_prpsinfo()
1616 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PR_ENVP), &layout->pr_envp, in dump_prpsinfo()
1619 prtpct_2up(state, &layout->pr_pctcpu, MSG_ORIG(MSG_CNOTE_T_PR_PCTCPU), in dump_prpsinfo()
1625 if (data_present(state, &layout->pr_dmodel)) { in dump_prpsinfo()
1626 w = extract_as_word(state, &layout->pr_dmodel); in dump_prpsinfo()
1627 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_DMODEL), in dump_prpsinfo()
1631 indent_exit(state); in dump_prpsinfo()
1639 dump_prcred(note_state_t *state, const char *title) in dump_prcred() argument
1641 const sl_prcred_layout_t *layout = state->ns_arch->prcred; in dump_prcred()
1644 indent_enter(state, title, &layout->pr_euid); in dump_prcred()
1654 if (data_present(state, &layout->pr_ngroups)) { in dump_prcred()
1655 ngroups = extract_as_word(state, &layout->pr_ngroups); in dump_prcred()
1656 print_array(state, &layout->pr_groups, SL_FMT_NUM_DEC, ngroups, in dump_prcred()
1660 indent_exit(state); in dump_prcred()
1668 dump_prpriv(note_state_t *state, const char *title) in dump_prpriv() argument
1670 const sl_prpriv_layout_t *layout = state->ns_arch->prpriv; in dump_prpriv()
1673 indent_enter(state, title, &layout->pr_nsets); in dump_prpriv()
1679 if (data_present(state, &layout->pr_nsets)) { in dump_prpriv()
1680 nsets = extract_as_word(state, &layout->pr_nsets); in dump_prpriv()
1681 print_array(state, &layout->pr_sets, SL_FMT_NUM_ZHEX, nsets, in dump_prpriv()
1685 indent_exit(state); in dump_prpriv()
1689 dump_prfdinfo(note_state_t *state, const char *title) in dump_prfdinfo() argument
1691 const sl_prfdinfo_layout_t *layout = state->ns_arch->prfdinfo; in dump_prfdinfo()
1695 indent_enter(state, title, &layout->pr_fd); in dump_prfdinfo()
1698 mode = extract_as_word(state, &layout->pr_mode); in dump_prfdinfo()
1700 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_MODE), in dump_prfdinfo()
1716 fileflags = extract_as_word(state, &layout->pr_fileflags); in dump_prfdinfo()
1718 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FILEFLAGS), in dump_prfdinfo()
1725 indent_exit(state); in dump_prfdinfo()
1732 dump_priv_impl_info(note_state_t *state, const char *title) in dump_priv_impl_info() argument
1736 layout = state->ns_arch->priv_impl_info; in dump_priv_impl_info()
1737 indent_enter(state, title, &layout->priv_headersize); in dump_priv_impl_info()
1742 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PRIV_NSETS), in dump_priv_impl_info()
1746 print_num_2up(state, MSG_ORIG(MSG_CNOTE_T_PRIV_MAX), &layout->priv_max, in dump_priv_impl_info()
1752 indent_exit(state); in dump_priv_impl_info()
1768 dump_asrset(note_state_t *state, const char *title) in dump_asrset() argument
1779 nelts = state->ns_len / ftemplate.slf_eltlen; in dump_asrset()
1783 indent_enter(state, title, &fdesc1); in dump_asrset()
1792 INDENT, state->ns_vcol - state->ns_indent, index1, in dump_asrset()
1793 fmt_num(state, &fdesc1, SL_FMT_NUM_ZHEX, buf1)); in dump_asrset()
1805 state->ns_vcol - state->ns_indent, index1, in dump_asrset()
1806 state->ns_t2col - state->ns_vcol, in dump_asrset()
1807 fmt_num(state, &fdesc1, SL_FMT_NUM_ZHEX, buf1), in dump_asrset()
1808 state->ns_v2col - state->ns_t2col, index2, in dump_asrset()
1809 fmt_num(state, &fdesc2, SL_FMT_NUM_ZHEX, buf2)); in dump_asrset()
1814 indent_exit(state); in dump_asrset()
1818 dump_upanic(note_state_t *state, const char *title) in dump_upanic() argument
1820 const sl_prupanic_layout_t *layout = state->ns_arch->prupanic; in dump_upanic()
1824 indent_enter(state, title, &layout->pru_version); in dump_upanic()
1825 w = extract_as_word(state, &layout->pru_version); in dump_upanic()
1828 dump_hex_bytes(state->ns_data, state->ns_len, state->ns_indent, in dump_upanic()
1832 w = extract_as_word(state, &layout->pru_flags); in dump_upanic()
1833 print_str(state, MSG_ORIG(MSG_CNOTE_T_PRU_FLAGS), in dump_upanic()
1845 print_strbuf(state, MSG_ORIG(MSG_CNOTE_T_PRU_DATA), in dump_upanic()
1855 note_state_t state; in corenote() local
1860 state.ns_mach = mach; in corenote()
1861 state.ns_arch = sl_mach(state.ns_mach); in corenote()
1862 if (sl_mach(state.ns_mach) == NULL) in corenote()
1865 state.ns_swap = do_swap; in corenote()
1866 state.ns_indent = 4; in corenote()
1867 state.ns_t2col = state.ns_v2col = 0; in corenote()
1868 state.ns_data = desc; in corenote()
1869 state.ns_len = descsz; in corenote()
1873 state.ns_vcol = 26; in corenote()
1874 state.ns_t2col = 46; in corenote()
1875 state.ns_v2col = 60; in corenote()
1876 dump_prstatus(&state, MSG_ORIG(MSG_CNOTE_DESC_PRSTATUS_T)); in corenote()
1883 state.ns_vcol = 20; in corenote()
1884 state.ns_t2col = 41; in corenote()
1885 state.ns_v2col = 54; in corenote()
1886 dump_prpsinfo(&state, MSG_ORIG(MSG_CNOTE_DESC_PRPSINFO_T)); in corenote()
1898 state.ns_vcol = 18; in corenote()
1899 dump_auxv(&state, MSG_ORIG(MSG_CNOTE_DESC_AUXV_T)); in corenote()
1906 state.ns_vcol = 18; in corenote()
1907 state.ns_t2col = 38; in corenote()
1908 state.ns_v2col = 46; in corenote()
1909 dump_asrset(&state, MSG_ORIG(MSG_CNOTE_DESC_ASRSET_T)); in corenote()
1916 state.ns_vcol = 22; in corenote()
1917 state.ns_t2col = 42; in corenote()
1918 state.ns_v2col = 54; in corenote()
1919 dump_pstatus(&state, MSG_ORIG(MSG_CNOTE_DESC_PSTATUS_T)); in corenote()
1923 state.ns_vcol = 25; in corenote()
1924 state.ns_t2col = 45; in corenote()
1925 state.ns_v2col = 58; in corenote()
1926 dump_psinfo(&state, MSG_ORIG(MSG_CNOTE_DESC_PSINFO_T)); in corenote()
1930 state.ns_vcol = 20; in corenote()
1931 state.ns_t2col = 34; in corenote()
1932 state.ns_v2col = 44; in corenote()
1933 dump_prcred(&state, MSG_ORIG(MSG_CNOTE_DESC_PRCRED_T)); in corenote()
1937 state.ns_vcol = 18; in corenote()
1938 dump_utsname(&state, MSG_ORIG(MSG_CNOTE_DESC_STRUCT_UTSNAME)); in corenote()
1942 state.ns_vcol = 24; in corenote()
1943 state.ns_t2col = 44; in corenote()
1944 state.ns_v2col = 54; in corenote()
1945 dump_lwpstatus(&state, MSG_ORIG(MSG_CNOTE_DESC_LWPSTATUS_T)); in corenote()
1949 state.ns_vcol = 22; in corenote()
1950 state.ns_t2col = 42; in corenote()
1951 state.ns_v2col = 54; in corenote()
1952 dump_lwpsinfo(&state, MSG_ORIG(MSG_CNOTE_DESC_LWPSINFO_T)); in corenote()
1956 state.ns_vcol = 21; in corenote()
1957 state.ns_t2col = 34; in corenote()
1958 state.ns_v2col = 38; in corenote()
1959 dump_prpriv(&state, MSG_ORIG(MSG_CNOTE_DESC_PRPRIV_T)); in corenote()
1963 state.ns_vcol = 29; in corenote()
1964 state.ns_t2col = 41; in corenote()
1965 state.ns_v2col = 56; in corenote()
1966 dump_priv_impl_info(&state, in corenote()
1978 state.ns_vcol = 8; in corenote()
1979 indent_enter(&state, in corenote()
1982 content = extract_as_lword(&state, &fdesc); in corenote()
1983 print_str(&state, MSG_ORIG(MSG_STR_EMPTY), in corenote()
1985 indent_exit(&state); in corenote()
1996 state.ns_vcol = 22; in corenote()
1997 state.ns_t2col = 41; in corenote()
1998 state.ns_v2col = 54; in corenote()
1999 dump_prfdinfo(&state, MSG_ORIG(MSG_CNOTE_DESC_PRFDINFO_T)); in corenote()
2003 state.ns_vcol = 25; in corenote()
2004 state.ns_t2col = 45; in corenote()
2005 state.ns_v2col = 58; in corenote()
2006 dump_psinfo(&state, MSG_ORIG(MSG_CNOTE_DESC_PSINFO_T)); in corenote()
2010 state.ns_vcol = 23; in corenote()
2011 state.ns_t2col = 41; in corenote()
2012 state.ns_v2col = 54; in corenote()
2013 dump_secflags(&state, MSG_ORIG(MSG_CNOTE_DESC_PRSECFLAGS_T)); in corenote()
2017 state.ns_vcol = 20; in corenote()
2018 dump_lwpname(&state, MSG_ORIG(MSG_CNOTE_DESC_PRLWPNAME_T)); in corenote()
2022 state.ns_vcol = 23; in corenote()
2023 dump_upanic(&state, MSG_ORIG(MSG_CNOTE_DESC_PRUPANIC_T)); in corenote()