diff options
-rw-r--r-- | tecdebug.c | 55 | ||||
-rw-r--r-- | tecdisp.c | 37 | ||||
-rw-r--r-- | tecmem.c | 9 | ||||
-rw-r--r-- | tecparse.c | 38 |
4 files changed, 51 insertions, 88 deletions
@@ -131,11 +131,7 @@ register int count; if(curbuf != NULL && saw_curbuf == 0){ restore_tty(); - fprintf( - stderr, - "?curbuf 0x%x not on buff_headers list\n", - (unsigned int)curbuf - ); + fprintf(stderr, "?curbuf %p not on buff_headers list\n", curbuf); CAUSE_BUS_ERROR(); }/* End IF */ @@ -295,13 +291,9 @@ register struct format_line *fbp; if(sbp->companion == NULL) continue; if(sbp->companion->fmt_saved_line != sbp){ restore_tty(); - fprintf( - stderr, - "?saved_screen[%d] companion 0x%08x ->fmt_saved_line 0x%08x\n", - i, - (unsigned int)sbp->companion, - (unsigned int)sbp->companion->fmt_saved_line - ); + fprintf(stderr, + "?saved_screen[%d] companion %p ->fmt_saved_line %p\n", + i, sbp->companion, sbp->companion->fmt_saved_line); CAUSE_BUS_ERROR(); }/* End IF */ }/* End FOR */ @@ -315,13 +307,8 @@ register struct format_line *fbp; while(fbp){ if(fbp->fmt_saved_line && fbp->fmt_saved_line->companion != fbp){ restore_tty(); - fprintf( - stderr, - "?fbp 0x%08x fbp->fmt_saved 0x%08x ->companion 0x%08x\n", - (unsigned int)fbp, - (unsigned int)fbp->fmt_saved_line, - (unsigned int)fbp->fmt_saved_line->companion - ); + fprintf(stderr, "?fbp %p fbp->fmt_saved %p ->companion %p\n", + fbp, fbp->fmt_saved_line, fbp->fmt_saved_line->companion); CAUSE_BUS_ERROR(); }/* End IF */ fbp = fbp->fmt_next_alloc; @@ -362,35 +349,27 @@ char saw_our_format_line; if(fl_temp == fbp) saw_our_format_line = 1; if(fl_temp->fmt_window_ptr != wptr){ restore_tty(); - fprintf( - stderr, - "?wrong window in fmt chain format_line 0x%08x format_line->wptr 0x%08x wptr 0x%08x\n", - (unsigned int)fl_temp, - (unsigned int)fl_temp->fmt_window_ptr, - (unsigned int)wptr - ); + fprintf(stderr, + "?wrong window in fmt chain format_line %p " + "format_line->wptr %p wptr %p\n", + fl_temp, fl_temp->fmt_window_ptr, wptr); CAUSE_BUS_ERROR(); }/* End IF */ if(fl_temp->fmt_buffer_line != blp){ restore_tty(); - fprintf( - stderr, - "?wrong buffer_line in fmt chain fmt 0x%08x fmt->fmt_buffer_line 0x%08x lbp 0x%08x\n", - (unsigned int)fl_temp, - (unsigned int)fl_temp->fmt_buffer_line, - (unsigned int)blp - ); + fprintf(stderr, + "?wrong buffer_line in fmt chain fmt %p " + "fmt->fmt_buffer_line %p lbp %p\n", + fl_temp, fl_temp->fmt_buffer_line, blp); CAUSE_BUS_ERROR(); }/* End IF */ }/* End FOR */ }/* End FOR */ if(saw_our_format_line == 0){ restore_tty(); - fprintf( - stderr, - "?never encountered our format line 0x%08x in format list\n", - (unsigned int)fbp - ); + fprintf(stderr, + "?never encountered our format line %p in format list\n", + fbp); CAUSE_BUS_ERROR(); }/* End IF */ }/* End FOR */ @@ -278,12 +278,9 @@ register struct screen_line *lp; for(lp = saved_screen, i = 0; i < term_lines; i++,lp++){ if(lp->companion){ if(lp->companion->fmt_saved_line != lp){ - fprintf( - stderr, - "lp->companion 0x%x != ->fmt_saved_line 0x%x\n", - (unsigned int)lp->companion, - (unsigned int)lp->companion->fmt_saved_line - ); + fprintf(stderr, + "lp->companion %p != ->fmt_saved_line %p\n", + lp->companion, lp->companion->fmt_saved_line); CAUSE_BUS_ERROR(); }/* End IF */ lp->companion->fmt_saved_line = NULL; @@ -1447,12 +1444,9 @@ register struct screen_line *lp; for(lp = saved_screen, i = 0; i < term_lines; i++,lp++){ if(lp->companion){ if(lp->companion->fmt_saved_line != lp){ - fprintf( - stderr, - "lp->companion 0x%x != ->fmt_saved_line 0x%x\n", - (unsigned int)lp->companion, - (unsigned int)lp->companion->fmt_saved_line - ); + fprintf(stderr, + "lp->companion %p != ->fmt_saved_line %p\n", + lp->companion, lp->companion->fmt_saved_line); CAUSE_BUS_ERROR(); }/* End IF */ if( lp->companion->fmt_permanent ) continue; @@ -2019,12 +2013,9 @@ register struct format_line *next_win; */ if(sbp->fmt_saved_line){ if(sbp->fmt_saved_line->companion != sbp){ - fprintf( - stderr, - "sbp->fmt_saved_line 0x%x != sbp->...companion 0x%x\n", - (unsigned int)sbp->fmt_saved_line, - (unsigned int)sbp->fmt_saved_line->companion - ); + fprintf(stderr, + "sbp->fmt_saved_line %p != sbp->...companion %p\n", + sbp->fmt_saved_line, sbp->fmt_saved_line->companion); CAUSE_BUS_ERROR(); }/* End IF */ sbp->fmt_saved_line->companion = NULL; @@ -2088,13 +2079,9 @@ screen_check_format_lines( struct format_line *sbp, int who ) */ if(sbp->fmt_saved_line){ if(sbp->fmt_saved_line->companion != sbp){ - fprintf( - stderr, - "w%d sbp->fmt_saved_line 0x%x != sbp->...companion 0x%x\n", - who, - (unsigned int)sbp->fmt_saved_line, - (unsigned int)sbp->fmt_saved_line->companion - ); + fprintf(stderr, + "w%d sbp->fmt_saved_line %p != sbp->...companion %p\n", + who, sbp->fmt_saved_line, sbp->fmt_saved_line->companion); CAUSE_BUS_ERROR(); }/* End IF */ }/* End IF */ @@ -227,8 +227,8 @@ register int i; mp = (struct memblock *)( addr - sizeof(struct memblock) ); if(mp->type != type){ - printf("\nTEC_RELEASE: TYPE Mismatch: Supplied %d Stored %d addr 0x%x\n", - type,mp->type,(unsigned int)addr); + printf("\nTEC_RELEASE: TYPE Mismatch: Supplied %d Stored %d addr %p\n", + type, mp->type, addr); #ifdef UNIX kill(getpid(),SIGQUIT); #endif @@ -278,9 +278,8 @@ register int i; mp = (struct memblock *)( addr - sizeof(struct memblock) ); if(mp->type != type){ - printf( - "\nTYPE Mismatch: Supplied %d Stored %d addr %x '%s'\n", - type,mp->type,(unsigned int)addr,message); + printf("\nTYPE Mismatch: Supplied %d Stored %d addr %p '%s'\n", + type, mp->type, addr, message); exit(1); }/* End IF */ @@ -1547,11 +1547,10 @@ register char *state_name; case TRACE_C_PARSE: state_name = trace_convert_opcode_to_name(ct0->opcode); if(state_name == NULL) state_name = "UNKNOWN"; - sprintf(tmp_message,"PARSE: 0x%08X Opcode %s %c", - (unsigned int)ct0, - state_name, -/* ct0->opcode == TOK_C_INPUTCHAR ? ct0->input_byte : ' '); */ - ct0->flags & TOK_M_EAT_TOKEN ? ct0->input_byte : ' '); + sprintf(tmp_message, "PARSE: %p Opcode %s %c", + ct0, state_name, +/* ct0->opcode == TOK_C_INPUTCHAR ? ct0->input_byte : ' '); */ + ct0->flags & TOK_M_EAT_TOKEN ? ct0->input_byte : ' '); if(ct0->flags & TOK_M_EAT_TOKEN){ strcat(tmp_message," TOK_M_EAT_TOKEN"); }/* End IF */ @@ -1607,7 +1606,7 @@ register char *state_name; ct0->ctx.iarg2_flag,ct0->ctx.iarg2,ct0->ctx.iarg2); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); - sprintf(tmp_message," carg 0x%x\n",(unsigned int)ct0->ctx.carg); + sprintf(tmp_message," carg %p\n",ct0->ctx.carg); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); sprintf(tmp_message," tmpval %d (0x%x)\n", @@ -1621,8 +1620,8 @@ register char *state_name; trace_convert_state_to_name(ct0->ctx.return_state); if(state_name == NULL) state_name = "UNKNOWN"; }/* End IF */ - sprintf(tmp_message," return_state %s caller_token 0x%x\n", - state_name,(unsigned int)ct0->ctx.caller_token); + sprintf(tmp_message, " return_state %s caller_token %p\n", + state_name, ct0->ctx.caller_token); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); }/* End IF */ break; @@ -1630,8 +1629,8 @@ register char *state_name; case TRACE_C_EXEC: state_name = trace_convert_exec_state_to_name(ct0->execute_state); if(state_name == NULL) state_name = "UNKNOWN"; - sprintf(tmp_message,"EXEC: 0x%08X Exec State: %s\n", - (unsigned int)ct1,state_name); + sprintf(tmp_message, "EXEC: %p Exec State: %s\n", + ct1, state_name); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); sprintf(tmp_message," iarg1_flag %d iarg1 %d (0x%x)", @@ -1652,11 +1651,11 @@ register char *state_name; ct1->ctx.iarg2_flag,ct1->ctx.iarg2,ct1->ctx.iarg2); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); - sprintf(tmp_message," carg 0x%x",(unsigned int)ct0->ctx.carg); + sprintf(tmp_message," carg %p",ct0->ctx.carg); while(strlen(tmp_message) < 39) strcat(tmp_message," "); strcat(tmp_message," "); cp = &tmp_message[strlen(tmp_message)]; - sprintf(cp," carg 0x%x\n",(unsigned int)ct1->ctx.carg); + sprintf(cp," carg %p\n",ct1->ctx.carg); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); sprintf(tmp_message," tmpval %d (0x%x)", @@ -1672,11 +1671,10 @@ register char *state_name; case TRACE_C_MACRO: state_name = trace_convert_opcode_to_name(ct0->opcode); if(state_name == NULL) state_name = "UNKNOWN"; - sprintf(tmp_message,"MACRO PLACEHOLDER: 0x%08X Opcode %s %c", - (unsigned int)ct0, - state_name, -/* ct0->opcode == TOK_C_INPUTCHAR ? ct0->input_byte : ' '); */ - ct0->flags & TOK_M_EAT_TOKEN ? ct0->input_byte : ' '); + sprintf(tmp_message, "MACRO PLACEHOLDER: %p Opcode %s %c", + ct0, state_name, +/* ct0->opcode == TOK_C_INPUTCHAR ? ct0->input_byte : ' '); */ + ct0->flags & TOK_M_EAT_TOKEN ? ct0->input_byte : ' '); if(ct0->flags & TOK_M_EAT_TOKEN){ strcat(tmp_message," TOK_M_EAT_TOKEN"); }/* End IF */ @@ -1732,7 +1730,7 @@ register char *state_name; ct0->ctx.iarg2_flag,ct0->ctx.iarg2,ct0->ctx.iarg2); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); - sprintf(tmp_message," carg 0x%x\n",(unsigned int)ct0->ctx.carg); + sprintf(tmp_message," carg %p\n",ct0->ctx.carg); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); sprintf(tmp_message," tmpval %d (0x%x)\n", @@ -1746,8 +1744,8 @@ register char *state_name; trace_convert_state_to_name(ct0->ctx.return_state); if(state_name == NULL) state_name = "UNKNOWN"; }/* End IF */ - sprintf(tmp_message," return_state %s caller_token 0x%x\n", - state_name,(unsigned int)ct0->ctx.caller_token); + sprintf(tmp_message, " return_state %s caller_token %p\n", + state_name, ct0->ctx.caller_token); buff_insert(qbp,qbp->zee,tmp_message,strlen(tmp_message)); }/* End IF */ break; |