842 PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_NODENAME), nodename);
843 PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_RELEASE), release);
844 PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_VERSION), version);
845 PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_MACHINE), machine);
846
847 indent_exit(state);
848 }
849
850
851 /*
852 * Dump register contents
853 */
854 static void
855 dump_prgregset(note_state_t *state, const char *title)
856 {
857 sl_field_t fdesc1, fdesc2;
858 sl_fmtbuf_t buf1, buf2;
859 Conv_inv_buf_t inv_buf1, inv_buf2;
860 Word w;
861
862 indent_enter(state, title, &fdesc1);
863
864 fdesc1 = fdesc2 = state->ns_arch->prgregset->elt0;
865 for (w = 0; w < fdesc1.slf_nelts; ) {
866 if (w == (fdesc1.slf_nelts - 1)) {
867 /* One last register is left */
868 if (!data_present(state, &fdesc1))
869 break;
870 dbg_print(0, MSG_ORIG(MSG_CNOTE_FMT_LINE),
871 INDENT, state->ns_vcol - state->ns_indent,
872 conv_cnote_pr_regname(state->ns_mach, w,
873 CONV_FMT_DECIMAL, &inv_buf1),
874 fmt_num(state, &fdesc1, SL_FMT_NUM_ZHEX, buf1));
875 fdesc1.slf_offset += fdesc1.slf_eltlen;
876 w++;
877 continue;
878 }
879
880 /* There are at least 2 more registers left. Show 2 up */
881 fdesc2.slf_offset = fdesc1.slf_offset + fdesc1.slf_eltlen;
882 if (!(data_present(state, &fdesc1) &&
883 data_present(state, &fdesc2)))
884 break;
910 int32_t i;
911 union {
912 Conv_inv_buf_t inv;
913 Conv_cnote_pr_flags_buf_t flags;
914 } conv_buf;
915
916 indent_enter(state, title, &layout->pr_flags);
917
918 if (data_present(state, &layout->pr_flags)) {
919 w = extract_as_word(state, &layout->pr_flags);
920 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAGS),
921 conv_cnote_pr_flags(w, 0, &conv_buf.flags));
922 }
923
924 PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_LWPID), pr_lwpid);
925
926 if (data_present(state, &layout->pr_why)) {
927 w = extract_as_word(state, &layout->pr_why);
928 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHY),
929 conv_cnote_pr_why(w, 0, &conv_buf.inv));
930 }
931
932 if (data_present(state, &layout->pr_what)) {
933 w2 = extract_as_word(state, &layout->pr_what);
934 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHAT),
935 conv_cnote_pr_what(w, w2, 0, &conv_buf.inv));
936 }
937
938 if (data_present(state, &layout->pr_cursig)) {
939 w = extract_as_word(state, &layout->pr_cursig);
940 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_CURSIG),
941 conv_cnote_signal(w, CONV_FMT_DECIMAL, &conv_buf.inv));
942 }
943
944 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_INFO), pr_info, dump_siginfo);
945 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_LWPPEND), pr_lwppend,
946 dump_sigset);
947 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_LWPHOLD), pr_lwphold,
948 dump_sigset);
949 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_ACTION), pr_action,
950 dump_sigaction);
951 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_ALTSTACK), pr_altstack,
952 dump_stack);
953
954 PRINT_ZHEX(MSG_ORIG(MSG_CNOTE_T_PR_OLDCONTEXT), pr_oldcontext);
955
956 if (data_present(state, &layout->pr_syscall)) {
1115 const sl_prstatus_layout_t *layout = state->ns_arch->prstatus;
1116 Word w, w2;
1117 int i;
1118 union {
1119 Conv_inv_buf_t inv;
1120 Conv_cnote_old_pr_flags_buf_t flags;
1121 } conv_buf;
1122
1123 indent_enter(state, title, &layout->pr_flags);
1124
1125 if (data_present(state, &layout->pr_flags)) {
1126 w = extract_as_word(state, &layout->pr_flags);
1127 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAGS),
1128 conv_cnote_old_pr_flags(w, 0, &conv_buf.flags));
1129 }
1130
1131 if (data_present(state, &layout->pr_why)) {
1132 w = extract_as_word(state, &layout->pr_why);
1133 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHY),
1134 conv_cnote_pr_why(w, 0, &conv_buf.inv));
1135 }
1136
1137 if (data_present(state, &layout->pr_what)) {
1138 w2 = extract_as_word(state, &layout->pr_what);
1139 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHAT),
1140 conv_cnote_pr_what(w, w2, 0, &conv_buf.inv));
1141 }
1142
1143 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_INFO), pr_info, dump_siginfo);
1144
1145 if (data_present(state, &layout->pr_cursig)) {
1146 w = extract_as_word(state, &layout->pr_cursig);
1147 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_CURSIG),
1148 conv_cnote_signal(w, CONV_FMT_DECIMAL, &conv_buf.inv));
1149 }
1150
1151 PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_NLWP), pr_nlwp);
1152 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_SIGPEND), pr_sigpend,
1153 dump_sigset);
1154 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_SIGHOLD), pr_sighold,
1155 dump_sigset);
1156 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_ALTSTACK), pr_altstack,
1157 dump_stack);
1158 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_ACTION), pr_action,
1159 dump_sigaction);
1160 PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_PID), pr_pid,
1161 MSG_ORIG(MSG_CNOTE_T_PR_PPID), pr_ppid);
|
842 PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_NODENAME), nodename);
843 PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_RELEASE), release);
844 PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_VERSION), version);
845 PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_MACHINE), machine);
846
847 indent_exit(state);
848 }
849
850
851 /*
852 * Dump register contents
853 */
854 static void
855 dump_prgregset(note_state_t *state, const char *title)
856 {
857 sl_field_t fdesc1, fdesc2;
858 sl_fmtbuf_t buf1, buf2;
859 Conv_inv_buf_t inv_buf1, inv_buf2;
860 Word w;
861
862 fdesc1 = fdesc2 = state->ns_arch->prgregset->elt0;
863 indent_enter(state, title, &fdesc1);
864
865 for (w = 0; w < fdesc1.slf_nelts; ) {
866 if (w == (fdesc1.slf_nelts - 1)) {
867 /* One last register is left */
868 if (!data_present(state, &fdesc1))
869 break;
870 dbg_print(0, MSG_ORIG(MSG_CNOTE_FMT_LINE),
871 INDENT, state->ns_vcol - state->ns_indent,
872 conv_cnote_pr_regname(state->ns_mach, w,
873 CONV_FMT_DECIMAL, &inv_buf1),
874 fmt_num(state, &fdesc1, SL_FMT_NUM_ZHEX, buf1));
875 fdesc1.slf_offset += fdesc1.slf_eltlen;
876 w++;
877 continue;
878 }
879
880 /* There are at least 2 more registers left. Show 2 up */
881 fdesc2.slf_offset = fdesc1.slf_offset + fdesc1.slf_eltlen;
882 if (!(data_present(state, &fdesc1) &&
883 data_present(state, &fdesc2)))
884 break;
910 int32_t i;
911 union {
912 Conv_inv_buf_t inv;
913 Conv_cnote_pr_flags_buf_t flags;
914 } conv_buf;
915
916 indent_enter(state, title, &layout->pr_flags);
917
918 if (data_present(state, &layout->pr_flags)) {
919 w = extract_as_word(state, &layout->pr_flags);
920 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAGS),
921 conv_cnote_pr_flags(w, 0, &conv_buf.flags));
922 }
923
924 PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_LWPID), pr_lwpid);
925
926 if (data_present(state, &layout->pr_why)) {
927 w = extract_as_word(state, &layout->pr_why);
928 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHY),
929 conv_cnote_pr_why(w, 0, &conv_buf.inv));
930
931 if (data_present(state, &layout->pr_what)) {
932 w2 = extract_as_word(state, &layout->pr_what);
933 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHAT),
934 conv_cnote_pr_what(w, w2, 0, &conv_buf.inv));
935 }
936 }
937
938 if (data_present(state, &layout->pr_cursig)) {
939 w = extract_as_word(state, &layout->pr_cursig);
940 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_CURSIG),
941 conv_cnote_signal(w, CONV_FMT_DECIMAL, &conv_buf.inv));
942 }
943
944 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_INFO), pr_info, dump_siginfo);
945 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_LWPPEND), pr_lwppend,
946 dump_sigset);
947 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_LWPHOLD), pr_lwphold,
948 dump_sigset);
949 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_ACTION), pr_action,
950 dump_sigaction);
951 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_ALTSTACK), pr_altstack,
952 dump_stack);
953
954 PRINT_ZHEX(MSG_ORIG(MSG_CNOTE_T_PR_OLDCONTEXT), pr_oldcontext);
955
956 if (data_present(state, &layout->pr_syscall)) {
1115 const sl_prstatus_layout_t *layout = state->ns_arch->prstatus;
1116 Word w, w2;
1117 int i;
1118 union {
1119 Conv_inv_buf_t inv;
1120 Conv_cnote_old_pr_flags_buf_t flags;
1121 } conv_buf;
1122
1123 indent_enter(state, title, &layout->pr_flags);
1124
1125 if (data_present(state, &layout->pr_flags)) {
1126 w = extract_as_word(state, &layout->pr_flags);
1127 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FLAGS),
1128 conv_cnote_old_pr_flags(w, 0, &conv_buf.flags));
1129 }
1130
1131 if (data_present(state, &layout->pr_why)) {
1132 w = extract_as_word(state, &layout->pr_why);
1133 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHY),
1134 conv_cnote_pr_why(w, 0, &conv_buf.inv));
1135
1136
1137 if (data_present(state, &layout->pr_what)) {
1138 w2 = extract_as_word(state, &layout->pr_what);
1139 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_WHAT),
1140 conv_cnote_pr_what(w, w2, 0, &conv_buf.inv));
1141 }
1142 }
1143
1144 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_INFO), pr_info, dump_siginfo);
1145
1146 if (data_present(state, &layout->pr_cursig)) {
1147 w = extract_as_word(state, &layout->pr_cursig);
1148 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_CURSIG),
1149 conv_cnote_signal(w, CONV_FMT_DECIMAL, &conv_buf.inv));
1150 }
1151
1152 PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_NLWP), pr_nlwp);
1153 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_SIGPEND), pr_sigpend,
1154 dump_sigset);
1155 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_SIGHOLD), pr_sighold,
1156 dump_sigset);
1157 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_ALTSTACK), pr_altstack,
1158 dump_stack);
1159 PRINT_SUBTYPE(MSG_ORIG(MSG_CNOTE_T_PR_ACTION), pr_action,
1160 dump_sigaction);
1161 PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_PID), pr_pid,
1162 MSG_ORIG(MSG_CNOTE_T_PR_PPID), pr_ppid);
|