default:
VG_(printf)("Error:\n unknown AddrCheck error code %d\n", e1->ekind);
- VG_(panic)("unknown error code in SK_(eq_SkinError)");
+ VG_(skin_panic)("unknown error code in SK_(eq_SkinError)");
}
}
break;
}
default:
- VG_(panic)("pp_AcAddrInfo");
+ VG_(skin_panic)("pp_AcAddrInfo");
}
}
"stated on the next line");
break;
default:
- VG_(panic)("pp_SkinError(axskind)");
+ VG_(skin_panic)("pp_SkinError(axskind)");
}
pp_ExeContext();
pp_AcAddrInfo(err->addr, &err_extra->addrinfo);
default:
VG_(printf)("Error:\n unknown AddrCheck error code %d\n", err->ekind);
- VG_(panic)("unknown error code in SK_(pp_SkinError)");
+ VG_(skin_panic)("unknown error code in SK_(pp_SkinError)");
}
}
{
AddrCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_AddrCheckError( &err_extra );
err_extra.addrinfo.akind = Undescribed;
err_extra.isWrite = isWrite;
{
AddrCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_AddrCheckError( &err_extra );
err_extra.axskind = ExecAxs;
{
AddrCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_AddrCheckError( &err_extra );
err_extra.addrinfo.akind = Undescribed;
{
AddrCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_AddrCheckError( &err_extra );
err_extra.addrinfo.akind = Undescribed;
{
AddrCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_AddrCheckError( &err_extra );
err_extra.addrinfo.akind = Undescribed;
default:
VG_(printf)("Error:\n"
" unknown AddrCheck suppression type %d\n", su->skind);
- VG_(panic)("unknown suppression type in "
- "SK_(error_matches_suppression)");
+ VG_(skin_panic)("unknown suppression type in "
+ "SK_(error_matches_suppression)");
}
}
}
#define PROF_EVENT(ev) \
- do { vg_assert((ev) >= 0 && (ev) < N_PROF_EVENTS); \
+ do { sk_assert((ev) >= 0 && (ev) < N_PROF_EVENTS); \
event_ctr[ev]++; \
} while (False);
/* It just happens that a AcSecMap occupies exactly 18 pages --
although this isn't important, so the following assert is
spurious. */
- vg_assert(0 == (sizeof(AcSecMap) % VKI_BYTES_PER_PAGE));
+ sk_assert(0 == (sizeof(AcSecMap) % VKI_BYTES_PER_PAGE));
map = VG_(get_memory_from_mmap)( sizeof(AcSecMap), caller );
for (i = 0; i < 8192; i++)
UChar abits8;
PROF_EVENT(24);
# ifdef VG_DEBUG_MEMORY
- vg_assert(IS_ALIGNED4_ADDR(a));
+ sk_assert(IS_ALIGNED4_ADDR(a));
# endif
sm = primary_map[a >> 16];
sm_off = a & 0xFFFF;
indicate bugs in our machinery. 30,000,000 is arbitrary, but so
far all legitimate requests have fallen beneath that size. */
/* 4 Mar 02: this is just stupid; get rid of it. */
- /* vg_assert(len < 30000000); */
+ /* sk_assert(len < 30000000); */
/* Check the permissions make sense. */
- vg_assert(example_a_bit == VGM_BIT_VALID
+ sk_assert(example_a_bit == VGM_BIT_VALID
|| example_a_bit == VGM_BIT_INVALID);
/* In order that we can charge through the address space at 8
VGP_POPCC(VgpSetMem);
return;
}
- vg_assert((a % 8) == 0 && len > 0);
+ sk_assert((a % 8) == 0 && len > 0);
/* Once aligned, go fast. */
while (True) {
VGP_POPCC(VgpSetMem);
return;
}
- vg_assert((a % 8) == 0 && len > 0 && len < 8);
+ sk_assert((a % 8) == 0 && len > 0 && len < 8);
/* Finish the upper fragment. */
while (True) {
/* Check that zero page and highest page have not been written to
-- this could happen with buggy syscall wrappers. Today
(2001-04-26) had precisely such a problem with __NR_setitimer. */
- vg_assert(SK_(cheap_sanity_check)());
+ sk_assert(SK_(cheap_sanity_check)());
VGP_POPCC(VgpSetMem);
}
PROF_EVENT(50);
# ifdef VG_DEBUG_MEMORY
- vg_assert(IS_ALIGNED4_ADDR(a));
- vg_assert(IS_ALIGNED4_ADDR(len));
+ sk_assert(IS_ALIGNED4_ADDR(a));
+ sk_assert(IS_ALIGNED4_ADDR(len));
# endif
for ( ; a < a_past_end; a += 4) {
PROF_EVENT(51);
# ifdef VG_DEBUG_MEMORY
- vg_assert(IS_ALIGNED4_ADDR(a));
- vg_assert(IS_ALIGNED4_ADDR(len));
+ sk_assert(IS_ALIGNED4_ADDR(a));
+ sk_assert(IS_ALIGNED4_ADDR(len));
# endif
for ( ; a < a_past_end; a += 4) {
break;
default:
- VG_(panic)("check_is_readable: Unknown or unexpected CorePart");
+ VG_(skin_panic)("check_is_readable: Unknown or unexpected CorePart");
}
}
break;
default:
- VG_(panic)("check_is_readable: Unknown or unexpected CorePart");
+ VG_(skin_panic)("check_is_readable: Unknown or unexpected CorePart");
}
}
VGP_POPCC(VgpCheckMem);
VGP_PUSHCC(VgpCheckMem);
- vg_assert(part == Vg_CoreSysCall);
+ sk_assert(part == Vg_CoreSysCall);
ok = SK_(check_readable_asciiz) ( (Addr)str, &bad_addr );
if (!ok) {
SK_(record_param_error) ( tst, bad_addr, /*is_writable =*/False, s );
(which is the default), and the address is 4-aligned.
If not, Case 2 will have applied.
*/
- vg_assert(SK_(clo_partial_loads_ok));
+ sk_assert(SK_(clo_partial_loads_ok));
{
return;
}
}
VG_(printf)("size is %d\n", size);
- VG_(panic)("fpu_ACCESS_check: unhandled size");
+ VG_(skin_panic)("fpu_ACCESS_check: unhandled size");
# endif
}
/* VG_(printf)("freelist sanity\n"); */
for (sc = vg_freed_list_start; sc != NULL; sc = sc->next)
n += sc->size;
- vg_assert(n == vg_freed_list_volume);
+ sk_assert(n == vg_freed_list_volume);
}
/* Put a shadow chunk on the freed blocks queue, possibly freeing up
/* Put it at the end of the freed list */
if (vg_freed_list_end == NULL) {
- vg_assert(vg_freed_list_start == NULL);
+ sk_assert(vg_freed_list_start == NULL);
vg_freed_list_end = vg_freed_list_start = sc;
vg_freed_list_volume = sc->size;
} else {
- vg_assert(vg_freed_list_end->next == NULL);
+ sk_assert(vg_freed_list_end->next == NULL);
vg_freed_list_end->next = sc;
vg_freed_list_end = sc;
vg_freed_list_volume += sc->size;
while (vg_freed_list_volume > SK_(clo_freelist_vol)) {
/* freelist_sanity(); */
- vg_assert(vg_freed_list_start != NULL);
- vg_assert(vg_freed_list_end != NULL);
+ sk_assert(vg_freed_list_start != NULL);
+ sk_assert(vg_freed_list_end != NULL);
sc1 = vg_freed_list_start;
vg_freed_list_volume -= sc1->size;
/* VG_(printf)("volume now %d\n", vg_freed_list_volume); */
- vg_assert(vg_freed_list_volume >= 0);
+ sk_assert(vg_freed_list_volume >= 0);
if (vg_freed_list_start == vg_freed_list_end) {
vg_freed_list_start = vg_freed_list_end = NULL;
case 1: uCCall(cb, (Addr)&SK_(helperc_ACCESS1), 1, 1, False );
break;
default:
- VG_(panic)("addrcheck::SK_(instrument):LOAD/STORE");
+ VG_(skin_panic)("addrcheck::SK_(instrument):LOAD/STORE");
}
VG_(copy_UInstr)(cb, u_in);
break;
sigbus_new.ksa_flags = VKI_SA_ONSTACK | VKI_SA_RESTART;
sigbus_new.ksa_restorer = NULL;
res = VG_(ksigemptyset)( &sigbus_new.ksa_mask );
- vg_assert(res == 0);
+ sk_assert(res == 0);
sigsegv_new.ksa_handler = vg_scan_all_valid_memory_sighandler;
sigsegv_new.ksa_flags = VKI_SA_ONSTACK | VKI_SA_RESTART;
sigsegv_new.ksa_restorer = NULL;
res = VG_(ksigemptyset)( &sigsegv_new.ksa_mask );
- vg_assert(res == 0+0);
+ sk_assert(res == 0+0);
res = VG_(ksigemptyset)( &unblockmask_new );
res |= VG_(ksigaddset)( &unblockmask_new, VKI_SIGBUS );
res |= VG_(ksigaddset)( &unblockmask_new, VKI_SIGSEGV );
res |= VG_(ksigaddset)( &unblockmask_new, VKI_SIGTERM );
- vg_assert(res == 0+0+0);
+ sk_assert(res == 0+0+0);
res = VG_(ksigaction)( VKI_SIGBUS, &sigbus_new, &sigbus_saved );
- vg_assert(res == 0+0+0+0);
+ sk_assert(res == 0+0+0+0);
res = VG_(ksigaction)( VKI_SIGSEGV, &sigsegv_new, &sigsegv_saved );
- vg_assert(res == 0+0+0+0+0);
+ sk_assert(res == 0+0+0+0+0);
res = VG_(ksigprocmask)( VKI_SIG_UNBLOCK, &unblockmask_new, &blockmask_saved );
- vg_assert(res == 0+0+0+0+0+0);
+ sk_assert(res == 0+0+0+0+0+0);
/* The signal handlers are installed. Actually do the memory scan. */
numPages = 1 << (32-VKI_BYTES_PER_PAGE_BITS);
- vg_assert(numPages == 1048576);
- vg_assert(4096 == (1 << VKI_BYTES_PER_PAGE_BITS));
+ sk_assert(numPages == 1048576);
+ sk_assert(4096 == (1 << VKI_BYTES_PER_PAGE_BITS));
nWordsNotified = 0;
/* Restore signal state to whatever it was before. */
res = VG_(ksigaction)( VKI_SIGBUS, &sigbus_saved, NULL );
- vg_assert(res == 0 +0);
+ sk_assert(res == 0 +0);
res = VG_(ksigaction)( VKI_SIGSEGV, &sigsegv_saved, NULL );
- vg_assert(res == 0 +0 +0);
+ sk_assert(res == 0 +0 +0);
res = VG_(ksigprocmask)( VKI_SIG_SETMASK, &blockmask_saved, NULL );
- vg_assert(res == 0 +0 +0 +0);
+ sk_assert(res == 0 +0 +0 +0);
return nWordsNotified;
}
lo = mid+1;
continue;
}
- vg_assert(ptr >= a_mid_lo && ptr <= a_mid_hi);
+ sk_assert(ptr >= a_mid_lo && ptr <= a_mid_hi);
retVal = mid;
break;
}
# ifdef VG_DEBUG_LEAKCHECK
- vg_assert(retVal == find_shadow_for_OLD ( ptr, shadows, n_shadows ));
+ sk_assert(retVal == find_shadow_for_OLD ( ptr, shadows, n_shadows ));
# endif
/* VG_(printf)("%d\n", retVal); */
return retVal;
sh_no = find_shadow_for ( ptr, vglc_shadows, vglc_n_shadows );
if (sh_no != -1) {
/* Found a block at/into which ptr points. */
- vg_assert(sh_no >= 0 && sh_no < vglc_n_shadows);
- vg_assert(ptr < vglc_shadows[sh_no]->data
+ sk_assert(sh_no >= 0 && sh_no < vglc_n_shadows);
+ sk_assert(ptr < vglc_shadows[sh_no]->data
+ vglc_shadows[sh_no]->size);
/* Decide whether Proper-ly or Interior-ly reached. */
if (ptr == vglc_shadows[sh_no]->data) {
/* VG_(get_malloc_shadows) allocates storage for shadows */
vglc_shadows = VG_(get_malloc_shadows)( &vglc_n_shadows );
if (vglc_n_shadows == 0) {
- vg_assert(vglc_shadows == NULL);
+ sk_assert(vglc_shadows == NULL);
VG_(message)(Vg_UserMsg,
"No malloc'd blocks -- no leaks are possible.\n");
return;
/* Sanity check; assert that the blocks are now in order and that
they don't overlap. */
for (i = 0; i < vglc_n_shadows-1; i++) {
- vg_assert( ((Addr)vglc_shadows[i]->data)
+ sk_assert( ((Addr)vglc_shadows[i]->data)
< ((Addr)vglc_shadows[i+1]->data) );
- vg_assert( ((Addr)vglc_shadows[i]->data) + vglc_shadows[i]->size
+ sk_assert( ((Addr)vglc_shadows[i]->data) + vglc_shadows[i]->size
< ((Addr)vglc_shadows[i+1]->data) );
}
p_min = p;
}
}
- vg_assert(p_min != NULL);
+ sk_assert(p_min != NULL);
if ( (!SK_(clo_show_reachable)) && p_min->loss_mode == Proper) {
p_min->num_blocks = 0;
str[w++] = ' ';
}
str[w++] = 0;
- vg_assert(w == 36);
+ sk_assert(w == 36);
}
/* Caution! Not vthread-safe; looks in VG_(baseBlock), not the thread
VG_(message)(Vg_DebugMsg,
"probable sanity check failure for syscall number %d\n",
syscallno );
- VG_(panic)("aborting due to the above ... bye!");
+ VG_(skin_panic)("aborting due to the above ... bye!");
}
}
{
needs->name = "addrcheck";
needs->description = "a fine-grained address checker";
+ needs->bug_reports_to = "jseward@acm.org";
needs->core_errors = True;
needs->skin_errors = True;
}
if (curr_BBCC == NULL) {
- vg_assert(False == remove);
+ sk_assert(False == remove);
curr_fn_node->BBCCs[BBCC_hash] = curr_BBCC =
new_BBCC(bb_orig_addr, cb, curr_fn_node->BBCCs[BBCC_hash]);
*BB_seen_before = False;
} else {
- vg_assert(bb_orig_addr == curr_BBCC->orig_addr);
- vg_assert(curr_BBCC->array_size > 0 && curr_BBCC->array_size < 1000000);
+ sk_assert(bb_orig_addr == curr_BBCC->orig_addr);
+ sk_assert(curr_BBCC->array_size > 0 && curr_BBCC->array_size < 1000000);
if (VG_(clo_verbosity) > 2) {
VG_(message)(Vg_DebugMsg,
"BB retranslation, retrieving from BBCC table");
case LOAD:
/* Two LDBs are possible for a single instruction */
/* Also, a STORE can come after a LOAD for bts/btr/btc */
- vg_assert(/*!is_LOAD &&*/ /* !is_STORE && */
+ sk_assert(/*!is_LOAD &&*/ /* !is_STORE && */
!is_FPU_R && !is_FPU_W);
t_read = u_in->val1;
is_LOAD = True;
case STORE:
/* Multiple STOREs are possible for 'pushal' */
- vg_assert( /*!is_STORE &&*/ !is_FPU_R && !is_FPU_W);
+ sk_assert( /*!is_STORE &&*/ !is_FPU_R && !is_FPU_W);
t_write = u_in->val2;
is_STORE = True;
break;
case FPU_R:
- vg_assert(!is_LOAD && !is_STORE && !is_FPU_R && !is_FPU_W);
+ sk_assert(!is_LOAD && !is_STORE && !is_FPU_R && !is_FPU_W);
t_read = u_in->val2;
is_FPU_R = True;
break;
case FPU_W:
- vg_assert(!is_LOAD && !is_STORE && !is_FPU_R && !is_FPU_W);
+ sk_assert(!is_LOAD && !is_STORE && !is_FPU_R && !is_FPU_W);
t_write = u_in->val2;
is_FPU_W = True;
break;
I = &( ((iddCC*)cc)->I );
break;
default:
- VG_(panic)("Unknown CC type in log_1I_0D_cache_access_JIFZ()\n");
+ VG_(skin_panic)("Unknown CC type in log_1I_0D_cache_access_JIFZ()\n");
break;
}
cachesim_I1_doref(instr_addr, instr_size, &I->m1, &I->m2);
* The instrumentation is just a call to the appropriate helper function,
* passing it the address of the instruction's CC.
*/
- if (instrumented_Jcond) vg_assert(u_in->opcode == JMP);
+ if (instrumented_Jcond) sk_assert(u_in->opcode == JMP);
switch (u_in->opcode) {
case NOP: case CALLM_E: case CALLM_S:
/* JMP: insert instrumentation if the first JMP */
case JMP:
if (instrumented_Jcond) {
- vg_assert(CondAlways == u_in->cond);
- vg_assert(i+1 == cb_in->used);
+ sk_assert(CondAlways == u_in->cond);
+ sk_assert(i+1 == cb_in->used);
VG_(copy_UInstr)(cb, u_in);
instrumented_Jcond = False; /* reset */
break;
}
/* The first JMP... instrument. */
if (CondAlways != u_in->cond) {
- vg_assert(i+2 == cb_in->used);
+ sk_assert(i+2 == cb_in->used);
instrumented_Jcond = True;
} else {
- vg_assert(i+1 == cb_in->used);
+ sk_assert(i+1 == cb_in->used);
}
/* Get x86 instr size from final JMP. */
* function, passing it the CC address. */
stack_used = 0;
- vg_assert(x86_instr_size >= 1 &&
+ sk_assert(x86_instr_size >= 1 &&
x86_instr_size <= MAX_x86_INSTR_SIZE);
#define IS_(X) (INVALID_TEMPREG != t_##X##_addr)
if (!IS_(read) && !IS_(write)) {
- vg_assert(INVALID_DATA_SIZE == data_size);
- vg_assert(INVALID_TEMPREG == t_read_addr &&
+ sk_assert(INVALID_DATA_SIZE == data_size);
+ sk_assert(INVALID_TEMPREG == t_read_addr &&
INVALID_TEMPREG == t_read &&
INVALID_TEMPREG == t_write_addr &&
INVALID_TEMPREG == t_write);
argc = 1;
} else {
- vg_assert(4 == data_size || 2 == data_size || 1 == data_size ||
+ sk_assert(4 == data_size || 2 == data_size || 1 == data_size ||
8 == data_size || 10 == data_size ||
MIN_LINE_SIZE == data_size);
if (!BB_seen_before)
init_idCC(ReadCC, (idCC*)BBCC_ptr, x86_instr_addr,
x86_instr_size, data_size);
- vg_assert(INVALID_TEMPREG != t_read_addr &&
+ sk_assert(INVALID_TEMPREG != t_read_addr &&
INVALID_TEMPREG != t_read &&
INVALID_TEMPREG == t_write_addr &&
INVALID_TEMPREG == t_write);
if (!BB_seen_before)
init_idCC(WriteCC, (idCC*)BBCC_ptr, x86_instr_addr,
x86_instr_size, data_size);
- vg_assert(INVALID_TEMPREG == t_read_addr &&
+ sk_assert(INVALID_TEMPREG == t_read_addr &&
INVALID_TEMPREG == t_read &&
INVALID_TEMPREG != t_write_addr &&
INVALID_TEMPREG != t_write);
t_data_addr1 = t_write_addr;
} else {
- vg_assert(IS_(read) && IS_(write));
- vg_assert(INVALID_TEMPREG != t_read_addr &&
+ sk_assert(IS_(read) && IS_(write));
+ sk_assert(INVALID_TEMPREG != t_read_addr &&
INVALID_TEMPREG != t_read &&
INVALID_TEMPREG != t_write_addr &&
INVALID_TEMPREG != t_write);
TempReg, t_data_addr1,
TempReg, t_data_addr2);
else
- VG_(panic)("argc... not 1 or 2 or 3?");
+ VG_(skin_panic)("argc... not 1 or 2 or 3?");
uCCall(cb, helper, argc, argc, False);
}
}
/* Just check everything looks ok */
- vg_assert(BBCC_ptr - BBCC_ptr0 == BBCC_node->array_size);
+ sk_assert(BBCC_ptr - BBCC_ptr0 == BBCC_node->array_size);
VG_(free_UCodeBlock)(cb_in);
return cb;
case 0x90: case 0x96: case 0x9b:
VG_(message)(Vg_DebugMsg,
"error: IA-64 cache stats! Cachegrind doesn't run on IA-64...");
- VG_(panic)("IA-64 detected");
+ VG_(skin_panic)("IA-64 detected");
case 0x22: case 0x23: case 0x25: case 0x29:
VG_(message)(Vg_DebugMsg,
sigill_new.ksa_flags = 0;
sigill_new.ksa_restorer = NULL;
res = VG_(ksigemptyset)( &sigill_new.ksa_mask );
- vg_assert(res == 0);
+ sk_assert(res == 0);
res = VG_(ksigaction)( VKI_SIGILL, &sigill_new, &sigill_saved );
- vg_assert(res == 0);
+ sk_assert(res == 0);
/* Trap for illegal instruction, in case it's a really old processor that
* doesn't support CPUID. */
/* Restore old SIGILL handler */
res = VG_(ksigaction)( VKI_SIGILL, &sigill_saved, NULL );
- vg_assert(res == 0);
+ sk_assert(res == 0);
} else {
VG_(message)(Vg_DebugMsg, "CPUID instruction not supported");
/* Restore old SIGILL handler */
res = VG_(ksigaction)( VKI_SIGILL, &sigill_saved, NULL );
- vg_assert(res == 0);
+ sk_assert(res == 0);
return -1;
}
break;
default:
- VG_(panic)("Unknown CC type in fprint_BBCC()\n");
+ VG_(skin_panic)("Unknown CC type in fprint_BBCC()\n");
break;
}
distinct_instrs++;
/* Mark end of basic block */
/* VG_(write)(fd, (void*)"#}\n", 3); */
- vg_assert(BBCC_ptr - BBCC_ptr0 == BBCC_node->array_size);
+ sk_assert(BBCC_ptr - BBCC_ptr0 == BBCC_node->array_size);
}
static void fprint_BBCC_table_and_calc_totals(void)
BBCC_node = get_BBCC(a, NULL, /*remove=*/True, &BB_seen_before);
BBCC_ptr0 = BBCC_ptr = (Addr)(BBCC_node->array);
- vg_assert(True == BB_seen_before);
+ sk_assert(True == BB_seen_before);
while (BBCC_ptr - BBCC_ptr0 < BBCC_node->array_size) {
break;
default:
- VG_(panic)("Unknown CC type in VG_(discard_basic_block_info)()\n");
+ VG_(skin_panic)("Unknown CC type in VG_(discard_basic_block_info)()\n");
break;
}
}
{
needs->name = "cachegrind";
needs->description = "an I1/D1/L2 cache profiler";
+ needs->bug_reports_to = "njn25@cam.ac.uk";
needs->basic_block_discards = True;
needs->command_line_options = True;
\
} else { \
VG_(printf)("addr: %x size: %u sets: %d %d", a, size, set1, set2); \
- VG_(panic)("item straddles more than two cache sets"); \
+ VG_(skin_panic)("item straddles more than two cache sets"); \
} \
return; \
}
void SK_(pre_clo_init)(VgNeeds* needs, VgTrackEvents* track)
{
- needs->name = "coregrind";
- needs->description = "a rudimentary error detector";
+ needs->name = "coregrind";
+ needs->description = "a rudimentary error detector";
+ needs->bug_reports_to = "njn25@cam.ac.uk";
- needs->core_errors = True;
+ needs->core_errors = True;
/* No core events to track */
}
dyn_string_t src;
{
if (dest == src)
- VG_(panic) ("dyn_string_copy: src==dest");
+ VG_(core_panic) ("dyn_string_copy: src==dest");
/* Make room in DEST. */
if (dyn_string_resize (dest, src->length) == NULL)
int i;
if (src == dest)
- VG_(panic)( "dyn_string_insert: src==dest" );
+ VG_(core_panic)( "dyn_string_insert: src==dest" );
if (dyn_string_resize (dest, dest->length + src->length) == NULL)
return 0;
/* Bomb out if we get any of these. */
-/* HACK: We shouldn't call VG_(panic) or VG_(message) on the simulated
+/* HACK: We shouldn't call VG_(core_panic) or VG_(message) on the simulated
CPU. Really we should pass the request in the usual way, and
Valgrind itself can do the panic. Too tedious, however.
*/
void pvalloc ( void )
-{ VG_(panic)("call to pvalloc\n"); }
+{ VG_(core_panic)("call to pvalloc\n"); }
void malloc_stats ( void )
-{ VG_(panic)("call to malloc_stats\n"); }
+{ VG_(core_panic)("call to malloc_stats\n"); }
void malloc_usable_size ( void )
-{ VG_(panic)("call to malloc_usable_size\n"); }
+{ VG_(core_panic)("call to malloc_usable_size\n"); }
void malloc_trim ( void )
-{ VG_(panic)("call to malloc_trim\n"); }
+{ VG_(core_panic)("call to malloc_trim\n"); }
void malloc_get_state ( void )
-{ VG_(panic)("call to malloc_get_state\n"); }
+{ VG_(core_panic)("call to malloc_get_state\n"); }
void malloc_set_state ( void )
-{ VG_(panic)("call to malloc_set_state\n"); }
+{ VG_(core_panic)("call to malloc_set_state\n"); }
/* Yet another ugly hack. Cannot include <malloc.h> because we
" The skin you have selected is missing the function `%s',\n"
" which is required.\n\n",
fn);
- VG_(skin_error)("Missing skin function");
+ VG_(skin_panic)("Missing skin function");
}
static __attribute__ ((noreturn))
" The skin you have selected is missing the function `%s'\n"
" required by one of its needs.\n\n",
fn);
- VG_(skin_error)("Missing skin function");
+ VG_(skin_panic)("Missing skin function");
}
/* ---------------------------------------------------------------------
/* ebp has an invalid value ... crap out. */
pushl $panic_msg_ebp
- call VG_(panic)
+ call VG_(core_panic)
/* (never returns) */
dispatch_syscall:
void VGP_(done_profiling) ( void )
{
- VG_(panic)("done_profiling");
+ VG_(core_panic)("done_profiling");
}
void VGP_(pushcc) ( UInt cc )
{
- VG_(panic)("pushcc");
+ VG_(core_panic)("pushcc");
}
void VGP_(popcc) ( UInt cc )
{
- VG_(panic)("popcc");
+ VG_(core_panic)("popcc");
}
/*--------------------------------------------------------------------*/
VG_(printf)("\nUnhandled error type: %u. VG_(needs).skin_errors\n"
"probably needs to be set.\n",
e1->skin_err.ekind);
- VG_(skin_error)("unhandled error type");
+ VG_(skin_panic)("unhandled error type");
}
}
}
VG_(printf)("\nUnhandled error type: %u. VG_(needs).skin_errors\n"
"probably needs to be set?\n",
err->skin_err.ekind);
- VG_(skin_error)("unhandled error type");
+ VG_(skin_panic)("unhandled error type");
}
}
}
p_min = p;
}
}
- if (p_min == NULL) VG_(panic)("show_all_errors()");
+ if (p_min == NULL) VG_(skin_panic)("show_all_errors()");
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "%d errors in context %d of %d:",
"\nUnhandled suppression type: %u. VG_(needs).skin_errors\n"
"probably needs to be set.\n",
err->skin_err.ekind);
- VG_(skin_error)("unhandled suppression type");
+ VG_(skin_panic)("unhandled suppression type");
}
}
}
case FunName: if (VG_(string_match)(su->caller[i],
caller_fun[i])) break;
return False;
- default: VG_(panic)("is_suppressible_error");
+ default: VG_(skin_panic)("is_suppressible_error");
}
}
return True;
default:
- VG_(panic)("VG_(eq_ExeContext): unrecognised VgRes");
+ VG_(core_panic)("VG_(eq_ExeContext): unrecognised VgRes");
}
}
case 2: shift = 1; break;
case 4: shift = 2; break;
case 8: shift = 3; break;
- default: VG_(panic)( "mkSIB" );
+ default: VG_(core_panic)( "mkSIB" );
}
return ((shift & 3) << 6) | ((regindex & 7) << 3) | (regbase & 7);
}
{
/* (regmem), reg */
if (regmem == R_ESP)
- VG_(panic)("emit_amode_regmem_reg");
+ VG_(core_panic)("emit_amode_regmem_reg");
if (regmem == R_EBP) {
VG_(emitB) ( mkModRegRM(1, reg, 5) );
VG_(emitB) ( 0x00 );
void VG_(emit_amode_offregmem_reg) ( Int off, Int regmem, Int reg )
{
if (regmem == R_ESP)
- VG_(panic)("emit_amode_offregmem_reg(ESP)");
+ VG_(core_panic)("emit_amode_offregmem_reg(ESP)");
if (off < -128 || off > 127) {
/* Use a large offset */
/* d32(regmem), reg */
Int regindex, Int reg )
{
if (regindex == R_ESP)
- VG_(panic)("emit_amode_sib_reg(ESP)");
+ VG_(core_panic)("emit_amode_sib_reg(ESP)");
if (off < -128 || off > 127) {
/* Use a 32-bit offset */
VG_(emitB) ( mkModRegRM(2, reg, 4) ); /* SIB with 32-bit displacement */
case AND: return 4;
case SUB: return 5;
case XOR: return 6;
- default: VG_(panic)("mkGrp1opcode");
+ default: VG_(core_panic)("mkGrp1opcode");
}
}
case SHL: return 4;
case SHR: return 5;
case SAR: return 7;
- default: VG_(panic)("mkGrp2opcode");
+ default: VG_(core_panic)("mkGrp2opcode");
}
}
switch (opc) {
case NOT: return 2;
case NEG: return 3;
- default: VG_(panic)("mkGrp3opcode");
+ default: VG_(core_panic)("mkGrp3opcode");
}
}
switch (opc) {
case INC: return 0;
case DEC: return 1;
- default: VG_(panic)("mkGrp4opcode");
+ default: VG_(core_panic)("mkGrp4opcode");
}
}
switch (opc) {
case CALLM: return 2;
case JMP: return 4;
- default: VG_(panic)("mkGrp5opcode");
+ default: VG_(core_panic)("mkGrp5opcode");
}
}
case OR: return 0x08;
case SBB: return 0x18;
case SUB: return 0x28;
- default: VG_(panic)("mkPrimaryOpcode");
+ default: VG_(core_panic)("mkPrimaryOpcode");
}
}
nameISize(sz), nameIReg(sz,reg));
break;
default:
- VG_(panic)("VG_(emit_unaryopv_reg)");
+ VG_(core_panic)("VG_(emit_unaryopv_reg)");
}
}
VG_(printf)( "\n\t\tnegb\t%s\n", nameIReg(1,reg));
break;
default:
- VG_(panic)("VG_(emit_unaryopb_reg)");
+ VG_(core_panic)("VG_(emit_unaryopb_reg)");
}
}
void VG_(emit_add_lit_to_esp) ( Int lit )
{
- if (lit < -128 || lit > 127) VG_(panic)("VG_(emit_add_lit_to_esp)");
+ if (lit < -128 || lit > 127) VG_(core_panic)("VG_(emit_add_lit_to_esp)");
VG_(new_emit)();
VG_(emitB) ( 0x83 );
VG_(emitB) ( 0xC4 );
VG_(printf)("%p ", VG_(noncompact_helper_addrs)[i]);
VG_(printf)("\n");
- VG_(skin_error)("Unfound helper");
+ VG_(skin_panic)("Unfound helper");
}
/*----------------------------------------------------*/
ccall_arg_setup_instrs++;
}
else
- VG_(panic)("emit_movl_litOrReg_reg: unexpected tag");
+ VG_(core_panic)("emit_movl_litOrReg_reg: unexpected tag");
}
static
emit_swapl_arg_regs ( dst1, dst2 );
} else {
- VG_(panic)("impossible 3-cycle");
+ VG_(core_panic)("impossible 3-cycle");
}
}
}
break;
default:
VG_(printf)("tag=%d\n", tagv[i]);
- VG_(panic)("VG_(synth_ccall): bad tag");
+ VG_(core_panic)("VG_(synth_ccall): bad tag");
}
stack_used += 4;
ccall_arg_setup_instrs++;
break;
default:
- VG_(panic)("VG_(synth_call): regparms_n value not in range 0..3");
+ VG_(core_panic)("VG_(synth_call): regparms_n value not in range 0..3");
}
/* Call the function */
VG_(emit_movv_lit_reg) ( 4, VG_TRC_EBP_JMP_CLIENTREQ, R_EBP );
break;
default:
- VG_(panic)("load_ebp_from_JmpKind");
+ VG_(core_panic)("load_ebp_from_JmpKind");
}
}
case 4: emit_movv_regmem_reg ( 4, reg1, reg2 ); break;
case 2: emit_movzwl_regmem_reg ( reg1, reg2 ); break;
case 1: emit_movzbl_regmem_reg ( reg1, reg2 ); break;
- default: VG_(panic)("synth_mov_regmem_reg");
+ default: VG_(core_panic)("synth_mov_regmem_reg");
}
}
case 4: VG_(emit_movv_offregmem_reg) ( 4, off, areg, reg ); break;
case 2: VG_(emit_movzwl_offregmem_reg) ( off, areg, reg ); break;
case 1: VG_(emit_movzbl_offregmem_reg) ( off, areg, reg ); break;
- default: VG_(panic)("synth_mov_offregmem_reg");
+ default: VG_(core_panic)("synth_mov_offregmem_reg");
}
}
VG_(emit_swapl_reg_EAX) ( reg );
}
break;
- default: VG_(panic)("synth_mov_reg_offregmem");
+ default: VG_(core_panic)("synth_mov_reg_offregmem");
}
}
emit_swapl_reg_reg ( s1, reg1 );
}
break;
- default: VG_(panic)("synth_mov_reg_litmem");
+ default: VG_(core_panic)("synth_mov_reg_litmem");
}
}
VG_(emit_swapl_reg_EAX) ( reg );
}
break;
- default: VG_(panic)("synth_unaryop_reg");
+ default: VG_(core_panic)("synth_unaryop_reg");
}
}
emit_swapl_reg_reg ( reg1, s1 );
break;
}
- VG_(panic)("synth_nonshiftopb_reg_reg");
+ VG_(core_panic)("synth_nonshiftopb_reg_reg");
}
- default: VG_(panic)("synth_nonshiftop_reg_reg");
+ default: VG_(core_panic)("synth_nonshiftop_reg_reg");
}
}
}
break;
default:
- VG_(panic)("synth_nonshiftop_offregmem_reg");
+ VG_(core_panic)("synth_nonshiftop_offregmem_reg");
}
}
VG_(emit_swapl_reg_EAX) ( reg );
}
break;
- default: VG_(panic)("synth_nonshiftop_lit_reg");
+ default: VG_(core_panic)("synth_nonshiftop_lit_reg");
}
}
if (reg != R_EAX) VG_(emit_swapl_reg_EAX) ( reg );
break;
default:
- VG_(panic)("synth_push_reg");
+ VG_(core_panic)("synth_push_reg");
}
}
if (reg != R_EAX) VG_(emit_swapl_reg_EAX) ( reg );
VG_(emit_add_lit_to_esp)(1);
break;
- default: VG_(panic)("synth_pop_reg");
+ default: VG_(core_panic)("synth_pop_reg");
}
}
case 4: emit_shiftopv_cl_stack0 ( 4, opcode ); break;
case 2: emit_shiftopv_cl_stack0 ( 2, opcode ); break;
case 1: emit_shiftopb_cl_stack0 ( opcode ); break;
- default: VG_(panic)("synth_shiftop_reg_reg");
+ default: VG_(core_panic)("synth_shiftop_reg_reg");
}
if (wr_cc) emit_put_eflags();
if (regs != R_ECX) emit_swapl_reg_ECX ( regs );
VG_(emit_swapl_reg_EAX) ( reg );
}
break;
- default: VG_(panic)("synth_shiftop_lit_reg");
+ default: VG_(core_panic)("synth_shiftop_lit_reg");
}
}
else return 4 * VGOFF_(m_edi);
}
}
- VG_(panic)("spillOrArchOffset");
+ VG_(core_panic)("spillOrArchOffset");
}
static Int eflagsOffset ( void )
case R_ES: return 4 * VGOFF_(m_es);
case R_FS: return 4 * VGOFF_(m_fs);
case R_GS: return 4 * VGOFF_(m_gs);
- default: VG_(panic)("segRegOffset");
+ default: VG_(core_panic)("segRegOffset");
}
}
case R_EBP: return 4 * VGOFF_(sh_ebp);
case R_ESI: return 4 * VGOFF_(sh_esi);
case R_EDI: return 4 * VGOFF_(sh_edi);
- default: VG_(panic)( "shadowOffset");
+ default: VG_(core_panic)( "shadowOffset");
}
}
VG_(emit_shiftopv_lit_reg) ( 2, SAR, 8, reg );
}
else
- VG_(panic)("synth_WIDEN");
+ VG_(core_panic)("synth_WIDEN");
}
break;
case Literal: synth_mov_lit_reg ( u->size, u->lit32, u->val2 );
break;
- default: VG_(panic)("emitUInstr:mov");
+ default: VG_(core_panic)("emitUInstr:mov");
}
break;
}
R_EBP,
u->val2 );
break;
- default: VG_(panic)("emitUInstr:non-shift-op");
+ default: VG_(core_panic)("emitUInstr:non-shift-op");
}
break;
}
readFlagUse(u), writeFlagUse(u),
u->opcode, u->size, u->val1, u->val2 );
break;
- default: VG_(panic)("emitUInstr:non-shift-op");
+ default: VG_(core_panic)("emitUInstr:non-shift-op");
}
break;
}
synth_jmp_lit ( u->lit32, u->jmpkind );
break;
default:
- VG_(panic)("emitUInstr(JMP, unconditional, default)");
+ VG_(core_panic)("emitUInstr(JMP, unconditional, default)");
break;
}
} else {
switch (u->tag1) {
case RealReg:
- VG_(panic)("emitUInstr(JMP, conditional, RealReg)");
+ VG_(core_panic)("emitUInstr(JMP, conditional, RealReg)");
break;
case Literal:
vg_assert(u->jmpkind == JmpBoring);
synth_jcond_lit ( u->cond, u->lit32 );
break;
default:
- VG_(panic)("emitUInstr(JMP, conditional, default)");
+ VG_(core_panic)("emitUInstr(JMP, conditional, default)");
break;
}
}
" VG_(needs).extended_UCode should be set?\n",
u->opcode);
VG_(pp_UInstr)(0,u);
- VG_(panic)("emitUInstr: unimplemented opcode");
+ VG_(core_panic)("emitUInstr: unimplemented opcode");
}
}
roll $19, %eax
# should never get here
pushl $signalreturn_bogusRA_panic_msg
- call VG_(panic)
+ call VG_(core_panic)
.data
signalreturn_bogusRA_panic_msg:
Exports of vg_mylibc.c
------------------------------------------------------------------ */
-/* Note: this function is re-declared (cough, hack) in include/vg_profile.c */
-__attribute__((noreturn))
-extern void VG_(skin_error) ( Char* s );
+#define vg_assert(expr) \
+ ((void) ((expr) ? 0 : \
+ (VG_(core_assert_fail) (VG__STRING(expr), \
+ __FILE__, __LINE__, \
+ __PRETTY_FUNCTION__), 0)))
+__attribute__ ((__noreturn__))
+extern void VG_(core_assert_fail) ( Char* expr, Char* file,
+ Int line, Char* fn );
+__attribute__ ((__noreturn__))
+extern void VG_(core_panic) ( Char* str );
/* VG_(brk) not public so skins cannot screw with curr_dataseg_end */
extern void* VG_(brk) ( void* end_data_segment );
{
UInt t1 = newTemp(cb);
- vg_assert(regparms_n <= 1);
+ sk_assert(regparms_n <= 1);
uInstr2(cb, MOV, 4, Literal, 0, TempReg, t1);
uLiteral(cb, arg1);
uInstr1(cb, CCALL, 0, TempReg, t1);
UInt t1 = newTemp(cb);
UInt t2 = newTemp(cb);
- vg_assert(regparms_n <= 2);
+ sk_assert(regparms_n <= 2);
uInstr2(cb, MOV, 4, Literal, 0, TempReg, t1);
uLiteral(cb, arg1);
uInstr2(cb, MOV, 4, Literal, 0, TempReg, t2);
Int off = baB_off;
baB_off += words;
if (baB_off >= VG_BASEBLOCK_WORDS)
- VG_(panic)( "alloc_BaB: baseBlock is too small");
+ VG_(core_panic)( "alloc_BaB: baseBlock is too small");
return off;
}
if (MAX_COMPACT_HELPERS <= VG_(n_compact_helpers)) {
VG_(printf)("Can only register %d compact helpers\n",
MAX_COMPACT_HELPERS);
- VG_(panic)("Too many compact helpers registered");
+ VG_(core_panic)("Too many compact helpers registered");
}
VG_(compact_helper_addrs)[VG_(n_compact_helpers)] = a;
VG_(n_compact_helpers)++;
VG_(printf)("Can only register %d non-compact helpers\n",
MAX_NONCOMPACT_HELPERS);
VG_(printf)("Try increasing MAX_NON_COMPACT_HELPERS\n");
- VG_(panic)("Too many non-compact helpers registered");
+ VG_(core_panic)("Too many non-compact helpers registered");
}
VG_(noncompact_helper_addrs)[VG_(n_noncompact_helpers)] = a;
VG_(n_noncompact_helpers)++;
VgNeeds VG_(needs) = {
.name = NULL,
.description = NULL,
+ .bug_reports_to = NULL,
.core_errors = False,
.skin_errors = False,
static void sanity_check_needs ( void )
{
-#define CHECK_NOT(var, value) \
- if ((var)==(value)) { \
- VG_(printf)("\n`%s' not initialised\n", VG__STRING(var)); \
- VG_(skin_error)("Uninitialised needs field\n"); \
+#define CHECK_NOT(var, value) \
+ if ((var)==(value)) { \
+ VG_(printf)("\nSkin error: `%s' not initialised\n", \
+ VG__STRING(var)); \
+ VG_(skin_panic)("Uninitialised needs field\n"); \
}
- CHECK_NOT(VG_(needs).name, NULL);
- CHECK_NOT(VG_(needs).description, NULL);
+ CHECK_NOT(VG_(needs).name, NULL);
+ CHECK_NOT(VG_(needs).description, NULL);
+ CHECK_NOT(VG_(needs).bug_reports_to, NULL);
#undef CHECK_NOT
#undef INVALID_Bool
that arg. */
VG_(exit)( VG_(exitcode) );
/* NOT ALIVE HERE! */
- VG_(panic)("entered the afterlife in vg_main() -- ExitSyscall");
+ VG_(core_panic)("entered the afterlife in vg_main() -- ExitSyscall");
break; /* what the hell :) */
case VgSrc_Deadlock:
/* Just exit now. No point in continuing. */
VG_(exit)(0);
- VG_(panic)("entered the afterlife in vg_main() -- Deadlock");
+ VG_(core_panic)("entered the afterlife in vg_main() -- Deadlock");
break;
case VgSrc_BbsDone:
VG_(switch_to_real_CPU)();
default:
- VG_(panic)("vg_main(): unexpected scheduler return code");
+ VG_(core_panic)("vg_main(): unexpected scheduler return code");
}
}
"scripts is also likely to cause problems.\n"
"\n"
);
- VG_(panic)("VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) failed\n");
+ VG_(core_panic)("VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) failed\n");
}
return sb;
VG_(printf)("findSb: can't find pointer %p in arena `%s'\n",
ch, a->name );
- VG_(panic)("findSb: vg_free() in wrong arena?");
+ VG_(core_panic)("findSb: vg_free() in wrong arena?");
return NULL; /*NOTREACHED*/
}
UInt arena_bytes_on_loan;
Arena* a;
-# define BOMB VG_(panic)("mallocSanityCheckArena")
+# define BOMB VG_(core_panic)("mallocSanityCheckArena")
a = arenaId_to_ArenaP(aid);
default:
VG_(printf)("vg_malloc_aligned(%p, %d, %d)\nbad alignment request",
a, req_alignB, req_pszB );
- VG_(panic)("vg_malloc_aligned");
+ VG_(core_panic)("vg_malloc_aligned");
/*NOTREACHED*/
}
"naively assumes it is the executable. ");
VG_(message)(Vg_UserMsg,
"In that case, rename it appropriately.");
- VG_(panic)("VG_ASSUMED_EXE_BASE doesn't match reality");
+ VG_(core_panic)("VG_ASSUMED_EXE_BASE doesn't match reality");
}
}
if (rr != 'r' && xx != 'x' && ww != 'w') {
VG_(printf)("No permissions on the segment named %s\n", filename);
- VG_(panic)("Non-readable, writable, executable segment at startup");
+ VG_(core_panic)("Non-readable, writable, executable segment at startup");
}
/* This parallels what happens when we mmap some new memory */
Assertery.
------------------------------------------------------------------ */
-void VG_(assert_fail) ( Char* expr, Char* file, Int line, Char* fn )
+__attribute__ ((noreturn))
+static void report_and_quit ( Char* report )
+{
+ VG_(pp_sched_status)();
+ VG_(printf)("Please report this bug to: %s\n\n", report);
+ VG_(shutdown_logging)();
+ VG_(exit)(1);
+}
+
+__attribute__ ((noreturn))
+static void assert_fail ( Char* expr, Char* name, Char* report,
+ Char* file, Int line, Char* fn )
{
static Bool entered = False;
if (entered)
VG_(exit)(2);
entered = True;
VG_(printf)("\n%s: %s:%d (%s): Assertion `%s' failed.\n",
- "valgrind", file, line, fn, expr );
- VG_(pp_sched_status)();
- VG_(printf)("Please report this bug to me at: %s\n\n", VG_EMAIL_ADDR);
- VG_(shutdown_logging)();
- VG_(exit)(1);
+ name, file, line, fn, expr );
+ report_and_quit(report);
+}
+
+void VG_(skin_assert_fail) ( Char* expr, Char* file, Int line, Char* fn )
+{
+ assert_fail(expr, VG_(needs).name, VG_(needs).bug_reports_to,
+ file, line, fn);
+}
+
+void VG_(core_assert_fail) ( Char* expr, Char* file, Int line, Char* fn )
+{
+ assert_fail(expr, "valgrind", VG_EMAIL_ADDR, file, line, fn);
}
-void VG_(panic) ( Char* str )
+__attribute__ ((noreturn))
+static void panic ( Char* name, Char* report, Char* str )
{
- VG_(printf)("\nvalgrind: the `impossible' happened:\n %s\n", str);
+ VG_(printf)("\n%s: the `impossible' happened:\n %s\n", name, str);
VG_(printf)("Basic block ctr is approximately %llu\n", VG_(bbs_done) );
- VG_(pp_sched_status)();
- VG_(printf)("Please report this bug to me at: %s\n\n", VG_EMAIL_ADDR);
- VG_(shutdown_logging)();
- VG_(exit)(1);
+ report_and_quit(report);
}
-void VG_(skin_error) ( Char* str )
+void VG_(core_panic) ( Char* str )
{
- VG_(printf)("\n%s: misconfigured skin:\n %s\n\n", VG_(needs).name, str);
- //VG_(printf)("Please report this bug to me at: %s\n\n", VG_EMAIL_ADDR);
- VG_(shutdown_logging)();
- VG_(exit)(1);
+ panic("valgrind", VG_EMAIL_ADDR, str);
}
+void VG_(skin_panic) ( Char* str )
+{
+ panic(VG_(needs).name, VG_(needs).bug_reports_to, str);
+}
/* ---------------------------------------------------------------------
Primitive support for reading files.
req = rem;
loops++;
if (loops > 100)
- VG_(panic)("calibration nanosleep loop failed?!");
+ VG_(core_panic)("calibration nanosleep loop failed?!");
}
/* Now read both timers, and do the Math. */
VG_(message)(Vg_UserMsg, "Estimated CPU clock rate is %d MHz",
(UInt)cpu_clock_MHZ);
if (cpu_clock_MHZ < 50 || cpu_clock_MHZ > 10000)
- VG_(panic)("end_rdtsc_calibration: "
+ VG_(core_panic)("end_rdtsc_calibration: "
"estimated CPU MHz outside range 50 .. 10000");
/* Paranoia about division by zero later. */
vg_assert(rdtsc_ticks_per_millisecond != 0);
break;
if (i == VG_N_WAITING_FDS)
- VG_(panic)("add_waiting_fd: VG_N_WAITING_FDS is too low");
+ VG_(core_panic)("add_waiting_fd: VG_N_WAITING_FDS is too low");
/*
VG_(printf)("add_waiting_fd: add (tid %d, fd %d) at slot %d\n",
tid, fd, i);
}
VG_(printf)("vg_alloc_ThreadState: no free slots available\n");
VG_(printf)("Increase VG_N_THREADS, rebuild and try again.\n");
- VG_(panic)("VG_N_THREADS is too low");
+ VG_(core_panic)("VG_N_THREADS is too low");
/*NOTREACHED*/
}
(void*)VG_STARTUP_STACK_BASE_3,
(void*)VG_STARTUP_STACK_BASE_4
);
- VG_(panic)("unexpected %esp at startup");
+ VG_(core_panic)("unexpected %esp at startup");
}
for (i = 0 /* NB; not 1 */; i < VG_N_THREADS; i++) {
}
if (VG_(threads)[tid].status == VgTs_WaitFD) {
- VG_(panic)("handle_signal_return: unknown interrupted syscall");
+ VG_(core_panic)("handle_signal_return: unknown interrupted syscall");
}
/* All other cases? Just return. */
case __NR_write:
VKI_FD_SET(fd, &writefds); break;
default:
- VG_(panic)("poll_for_ready_fds: unexpected syscall");
+ VG_(core_panic)("poll_for_ready_fds: unexpected syscall");
/*NOTREACHED*/
break;
}
( fd_max+1, &readfds, &writefds, &exceptfds, &timeout);
if (VG_(is_kerror)(n_ready)) {
VG_(printf)("poll_for_ready_fds: select returned %d\n", n_ready);
- VG_(panic)("poll_for_ready_fds: select failed?!");
+ VG_(core_panic)("poll_for_ready_fds: select failed?!");
/*NOTREACHED*/
}
continue;
if (n_ok > 1) {
VG_(printf)("offending fd = %d\n", fd);
- VG_(panic)("poll_for_ready_fds: multiple events on fd");
+ VG_(core_panic)("poll_for_ready_fds: multiple events on fd");
}
/* An I/O event completed for fd. Find the thread which
tid, VG_(threads)[tid].m_eip );
trans_addr = VG_(search_transtab) ( VG_(threads)[tid].m_eip );
if (trans_addr == (Addr)0)
- VG_(panic)("VG_TRC_INNER_FASTMISS: missing tt_fast entry");
+ VG_(core_panic)("VG_TRC_INNER_FASTMISS: missing tt_fast entry");
}
continue; /* with this thread */
}
default:
VG_(printf)("\ntrc = %d\n", trc);
- VG_(panic)("VG_(scheduler), phase 3: "
- "unexpected thread return code");
+ VG_(core_panic)("VG_(scheduler), phase 3: "
+ "unexpected thread return code");
/* NOTREACHED */
break;
/* NOTREACHED */
- VG_(panic)("scheduler: post-main-loop ?!");
+ VG_(core_panic)("scheduler: post-main-loop ?!");
/* NOTREACHED */
debug_stop:
}
vg_assert(sp >= 0 && sp <= VG_N_CLEANUPSTACK);
if (sp == VG_N_CLEANUPSTACK)
- VG_(panic)("do__cleanup_push: VG_N_CLEANUPSTACK is too small."
+ VG_(core_panic)("do__cleanup_push: VG_N_CLEANUPSTACK is too small."
" Increase and recompile.");
VG_(threads)[tid].custack[sp] = *cu;
sp++;
if (state == PTHREAD_CANCEL_DISABLE) {
VG_(threads)[tid].cancel_st = False;
} else {
- VG_(panic)("do__set_cancelstate");
+ VG_(core_panic)("do__set_cancelstate");
}
SET_EDX(tid, old_st ? PTHREAD_CANCEL_ENABLE
: PTHREAD_CANCEL_DISABLE);
if (type == PTHREAD_CANCEL_DEFERRED) {
VG_(threads)[tid].cancel_ty = True;
} else {
- VG_(panic)("do__set_canceltype");
+ VG_(core_panic)("do__set_canceltype");
}
SET_EDX(tid, old_ty ? PTHREAD_CANCEL_DEFERRED
: PTHREAD_CANCEL_ASYNCHRONOUS);
SET_EDX(tid, 0);
return;
default:
- VG_(panic)("do__set_or_get_detach");
+ VG_(core_panic)("do__set_or_get_detach");
}
}
static
void do__apply_in_new_thread_bogusRA ( void )
{
- VG_(panic)("do__apply_in_new_thread_bogusRA");
+ VG_(core_panic)("do__apply_in_new_thread_bogusRA");
}
/* (Fn, Arg): Create a new thread and run Fn applied to Arg in it. Fn
/* SET_EDX(tid, EAGAIN);
return;
*/
- VG_(panic)("pthread_key_create: VG_N_THREAD_KEYS is too low;"
- " increase and recompile");
+ VG_(core_panic)("pthread_key_create: VG_N_THREAD_KEYS is too low;"
+ " increase and recompile");
}
vg_thread_keys[i].inuse = True;
" unhandled client request: 0x%x. Perhaps\n"
" VG_(needs).client_requests should be set?\n",
arg[0]);
- VG_(panic)("do_client_request: unknown request");
+ VG_(core_panic)("do_client_request: unknown request");
/*NOTREACHED*/
}
break;
*orig_set = *modifier;
break;
default:
- VG_(panic)("do_sigprocmask_bitops");
+ VG_(core_panic)("do_sigprocmask_bitops");
break;
}
}
}
/* Note: we panic with all signals blocked here. Don't think
that matters. */
- VG_(panic)("vg_oursignalhandler: unexpected signal");
+ VG_(core_panic)("vg_oursignalhandler: unexpected signal");
}
/* End of the sanity check. */
altstack_info.ss_flags = 0;
ret = VG_(ksigaltstack)(&altstack_info, NULL);
if (ret != 0) {
- VG_(panic)(
+ VG_(core_panic)(
"vg_sigstartup_actions: couldn't install alternative sigstack");
}
if (VG_(clo_trace_signals)) {
} else {
VG_(printf)("unhandled N_SOL stabs case: %d %d %d",
stab[i+1].n_type, i, n_stab_entries);
- VG_(panic)("unhandled N_SOL stabs case");
+ VG_(core_panic)("unhandled N_SOL stabs case");
}
default:
VG_(printf)("unhandled (other) stabs case: %d %d",
stab[i+1].n_type,i);
- /* VG_(panic)("unhandled (other) stabs case"); */
+ /* VG_(core_panic)("unhandled (other) stabs case"); */
next_addr = this_addr + 4;
break;
}
{
curr_dataseg_end = (Addr)VG_(brk)(0);
if (curr_dataseg_end == (Addr)(-1))
- VG_(panic)("can't determine data-seg end for brk()");
+ VG_(core_panic)("can't determine data-seg end for brk()");
if (0)
VG_(printf)("DS END is %p\n", (void*)curr_dataseg_end);
}
switch (syscallno) {
case __NR_exit:
- VG_(panic)("syscall exit() not caught by the scheduler?!");
+ VG_(core_panic)("syscall exit() not caught by the scheduler?!");
break;
case __NR_clone:
VG_(message)(Vg_DebugMsg,
"FATAL: unhandled syscall(ipc) %d",
arg1 );
- VG_(panic)("... bye!\n");
+ VG_(core_panic)("... bye!\n");
break; /*NOTREACHED*/
}
}
if (nReadThisBuf > res) nReadThisBuf = res;
VG_TRACK( post_mem_write, (UInt)vec[i].iov_base, nReadThisBuf );
res -= nReadThisBuf;
- if (res < 0) VG_(panic)("readv: res < 0");
+ if (res < 0) VG_(core_panic)("readv: res < 0");
}
}
break;
default:
VG_(message)(Vg_DebugMsg,"FATAL: unhandled socketcall 0x%x",arg1);
- VG_(panic)("... bye!\n");
+ VG_(core_panic)("... bye!\n");
break; /*NOTREACHED*/
}
break;
default:
VG_(printf)("pre_known_blocking_syscall: unexpected %d\n", syscallno);
- VG_(panic)("pre_known_blocking_syscall");
+ VG_(core_panic)("pre_known_blocking_syscall");
/*NOTREACHED*/
break;
}
default:
VG_(printf)("post_known_blocking_syscall: unexpected %d\n",
syscallno);
- VG_(panic)("post_known_blocking_syscall");
+ VG_(core_panic)("post_known_blocking_syscall");
/*NOTREACHED*/
break;
}
{
static Char* grp1_names[8]
= { "add", "or", "adc", "sbb", "and", "sub", "xor", "cmp" };
- if (opc_aux < 0 || opc_aux > 7) VG_(panic)("nameGrp1");
+ if (opc_aux < 0 || opc_aux > 7) VG_(core_panic)("nameGrp1");
return grp1_names[opc_aux];
}
{
static Char* grp2_names[8]
= { "rol", "ror", "rcl", "rcr", "shl", "shr", "shl", "sar" };
- if (opc_aux < 0 || opc_aux > 7) VG_(panic)("nameGrp2");
+ if (opc_aux < 0 || opc_aux > 7) VG_(core_panic)("nameGrp2");
return grp2_names[opc_aux];
}
{
static Char* grp4_names[8]
= { "inc", "dec", "???", "???", "???", "???", "???", "???" };
- if (opc_aux < 0 || opc_aux > 1) VG_(panic)("nameGrp4");
+ if (opc_aux < 0 || opc_aux > 1) VG_(core_panic)("nameGrp4");
return grp4_names[opc_aux];
}
{
static Char* grp5_names[8]
= { "inc", "dec", "call*", "call*", "jmp*", "jmp*", "push", "???" };
- if (opc_aux < 0 || opc_aux > 6) VG_(panic)("nameGrp5");
+ if (opc_aux < 0 || opc_aux > 6) VG_(core_panic)("nameGrp5");
return grp5_names[opc_aux];
}
{
static Char* grp8_names[8]
= { "???", "???", "???", "???", "bt", "bts", "btr", "btc" };
- if (opc_aux < 4 || opc_aux > 7) VG_(panic)("nameGrp8");
+ if (opc_aux < 4 || opc_aux > 7) VG_(core_panic)("nameGrp8");
return grp8_names[opc_aux];
}
case 1: return ireg8_names[reg];
}
bad:
- VG_(panic)("name_of_int_reg");
+ VG_(core_panic)("name_of_int_reg");
return NULL; /*notreached*/
}
case R_DS: return "%ds";
case R_FS: return "%fs";
case R_GS: return "%gs";
- default: VG_(panic)("nameOfSegReg");
+ default: VG_(core_panic)("nameOfSegReg");
}
}
case 4: return 'l';
case 2: return 'w';
case 1: return 'b';
- default: VG_(panic)("name_of_int_size");
+ default: VG_(core_panic)("name_of_int_size");
}
}
case 4: return getUDisp32(eip);
case 2: return getUDisp16(eip);
case 1: return getUChar(eip);
- default: VG_(panic)("getUDisp");
+ default: VG_(core_panic)("getUDisp");
}
return 0; /*notreached*/
}
case 4: return getUDisp32(eip);
case 2: return getSDisp16(eip);
case 1: return getSDisp8(eip);
- default: VG_(panic)("getUDisp");
+ default: VG_(core_panic)("getUDisp");
}
return 0; /*notreached*/
}
default:
VG_(printf)("unhandled case is %s\n",
VG_(name_UOpcode)(True, uopc));
- VG_(panic)("setFlagsFromUOpcode: unhandled case");
+ VG_(core_panic)("setFlagsFromUOpcode: unhandled case");
}
}
case 0x26: return "%es:";
case 0x64: return "%fs:";
case 0x65: return "%gs:";
- default: VG_(panic)("sorbTxt");
+ default: VG_(core_panic)("sorbTxt");
}
}
case 0x26: sreg = R_ES; break;
case 0x64: sreg = R_FS; break;
case 0x65: sreg = R_GS; break;
- default: VG_(panic)("handleSegOverride");
+ default: VG_(core_panic)("handleSegOverride");
}
tsreg = newTemp(cb);
/* a register, %eax .. %edi. This shouldn't happen. */
case 0x18: case 0x19: case 0x1A: case 0x1B:
case 0x1C: case 0x1D: case 0x1E: case 0x1F:
- VG_(panic)("disAMode: not an addr!");
+ VG_(core_panic)("disAMode: not an addr!");
/* a 32-bit literal address
--> MOV d32, tmp
}
default:
- VG_(panic)("disAMode");
+ VG_(core_panic)("disAMode");
return 0; /*notreached*/
}
}
case 0x14: return 6;
default:
- VG_(panic)("amode_from_RM");
+ VG_(core_panic)("amode_from_RM");
return 0; /*notreached*/
}
}
case 1: helper = (signed_divide ? VGOFF_(helper_idiv_16_8)
: VGOFF_(helper_div_16_8));
break;
- default: VG_(panic)("codegen_div");
+ default: VG_(core_panic)("codegen_div");
}
uInstr0(cb, CALLM_S, 0);
if (sz == 4 || sz == 2) {
case 2: uopc = ADC; break; case 3: uopc = SBB; break;
case 4: uopc = AND; break; case 5: uopc = SUB; break;
case 6: uopc = XOR; break; case 7: uopc = SUB; break;
- default: VG_(panic)("dis_Grp1(Reg): unhandled case");
+ default: VG_(core_panic)("dis_Grp1(Reg): unhandled case");
}
if (uopc == AND || uopc == OR) {
Int tao = newTemp(cb);
case 2: uopc = ADC; break; case 3: uopc = SBB; break;
case 4: uopc = AND; break; case 5: uopc = SUB; break;
case 6: uopc = XOR; break; case 7: uopc = SUB; break;
- default: VG_(panic)("dis_Grp1(Mem): unhandled case");
+ default: VG_(core_panic)("dis_Grp1(Mem): unhandled case");
}
if (uopc == AND || uopc == OR) {
Int tao = newTemp(cb);
case 2: uopc = RCL; break; case 3: uopc = RCR; break;
case 4: uopc = SHL; break; case 5: uopc = SHR; break;
case 7: uopc = SAR; break;
- default: VG_(panic)("dis_Grp2(Reg): unhandled case");
+ default: VG_(core_panic)("dis_Grp2(Reg): unhandled case");
}
if (src_tag == Literal) {
uInstr2(cb, uopc, sz, Literal, 0, TempReg, t1);
case 2: uopc = RCL; break; case 3: uopc = RCR; break;
case 4: uopc = SHL; break; case 5: uopc = SHR; break;
case 7: uopc = SAR; break;
- default: VG_(panic)("dis_Grp2(Reg): unhandled case");
+ default: VG_(core_panic)("dis_Grp2(Reg): unhandled case");
}
if (src_tag == Literal) {
uInstr2(cb, uopc, sz, Literal, 0, TempReg, t2);
switch (sz) {
case 2: src_val &= 15; break;
case 4: src_val &= 31; break;
- default: VG_(panic)("dis_Grp8_BT: invalid size");
+ default: VG_(core_panic)("dis_Grp8_BT: invalid size");
}
/* Invent a mask suitable for the operation. */
new function to handle the other cases (0 .. 3). The
Intel docs do however not indicate any use for 0 .. 3, so
we don't expect this to happen. */
- default: VG_(panic)("dis_Grp8_BT");
+ default: VG_(core_panic)("dis_Grp8_BT");
}
/* Probably excessively paranoid. */
if (sz == 2)
default:
VG_(printf)(
"unhandled Grp3(R) case %d\n", (UInt)gregOfRM(modrm));
- VG_(panic)("Grp3");
+ VG_(core_panic)("Grp3");
}
} else {
pair = disAMode ( cb, sorb, eip, dis?dis_buf:NULL );
default:
VG_(printf)(
"unhandled Grp3(M) case %d\n", (UInt)gregOfRM(modrm));
- VG_(panic)("Grp3");
+ VG_(core_panic)("Grp3");
}
}
return eip;
default:
VG_(printf)(
"unhandled Grp4(R) case %d\n", (UInt)gregOfRM(modrm));
- VG_(panic)("Grp4");
+ VG_(core_panic)("Grp4");
}
eip++;
if (dis)
default:
VG_(printf)(
"unhandled Grp4(M) case %d\n", (UInt)gregOfRM(modrm));
- VG_(panic)("Grp4");
+ VG_(core_panic)("Grp4");
}
eip += HI8(pair);
if (dis)
default:
VG_(printf)(
"unhandled Grp5(R) case %d\n", (UInt)gregOfRM(modrm));
- VG_(panic)("Grp5");
+ VG_(core_panic)("Grp5");
}
eip++;
if (dis)
default:
VG_(printf)(
"unhandled Grp5(M) case %d\n", (UInt)gregOfRM(modrm));
- VG_(panic)("Grp5");
+ VG_(core_panic)("Grp5");
}
eip += HI8(pair);
if (dis)
case 1: helper = signed_multiply ? VGOFF_(helper_imul_8_16)
: VGOFF_(helper_mul_8_16);
break;
- default: VG_(panic)("dis_mul_E_G");
+ default: VG_(core_panic)("dis_mul_E_G");
}
uInstr0(cb, CALLM_S, 0);
case 4: helper = VGOFF_(helper_imul_32_64); break;
case 2: helper = VGOFF_(helper_imul_16_32); break;
case 1: helper = VGOFF_(helper_imul_8_16); break;
- default: VG_(panic)("dis_imul_I_E_G");
+ default: VG_(core_panic)("dis_imul_I_E_G");
}
uInstr0(cb, CALLM_S, 0);
VG_(printf)("dis_fpu: unhandled memory case 0x%2x:0x%2x(%d)\n",
(UInt)first_byte, (UInt)second_byte,
(UInt)((second_byte >> 3) & 7) );
- VG_(panic)("dis_fpu: unhandled opcodes");
+ VG_(core_panic)("dis_fpu: unhandled opcodes");
}
case BtOpSet: return "s";
case BtOpReset: return "r";
case BtOpComp: return "c";
- default: VG_(panic)("nameBtOp");
+ default: VG_(core_panic)("nameBtOp");
}
}
uInstr2(cb, AND, 4, TempReg, t_mask, TempReg, temp);
break;
default:
- VG_(panic)("dis_bt_G_E");
+ VG_(core_panic)("dis_bt_G_E");
}
uInstr2(cb, STORE, 1, TempReg, temp, TempReg, t_addr);
}
case 0xCD: /* INT imm8 */
d32 = getUChar(eip); eip++;
- if (d32 != 0x80) VG_(panic)("disInstr: INT but not 0x80 !");
+ if (d32 != 0x80) VG_(core_panic)("disInstr: INT but not 0x80 !");
/* It's important that all ArchRegs carry their up-to-date value
at this point. So we declare an end-of-block here, which
forces any TempRegs caching ArchRegs to be flushed. */
case 0x8D: /* LEA M,Gv */
modrm = getUChar(eip);
if (epartIsReg(modrm))
- VG_(panic)("LEA M,Gv: modRM refers to register");
+ VG_(core_panic)("LEA M,Gv: modRM refers to register");
/* NOTE! this is the one place where a segment override prefix
has no effect on the address calculation. Therefore we pass
zero instead of sorb here. */
}
else {
VG_(printf)("REPNE then 0x%x\n", (UInt)abyte);
- VG_(panic)("Unhandled REPNE case");
+ VG_(core_panic)("Unhandled REPNE case");
}
break;
}
/* do nothing; apparently a hint to the P4 re spin-wait loop */
} else {
VG_(printf)("REPE then 0x%x\n", (UInt)abyte);
- VG_(panic)("Unhandled REPE case");
+ VG_(core_panic)("Unhandled REPE case");
}
break;
}
default:
VG_(printf)("disInstr: unhandled opcode 0x%x then 0x%x\n",
(UInt)opc, (UInt)getUChar(eip));
- VG_(panic)("unhandled x86 opcode");
+ VG_(core_panic)("unhandled x86 opcode");
}
if (dis)
case 1: return R_ESI;
case 0: return R_EDI;
# endif
- default: VG_(panic)("VG_(rank_to_realreg)");
+ default: VG_(core_panic)("VG_(rank_to_realreg)");
}
}
case R_ESI: return 1;
case R_EDI: return 0;
# endif
- default: VG_(panic)("VG_(realreg_to_rank)");
+ default: VG_(core_panic)("VG_(realreg_to_rank)");
}
}
VG_(printf)("unhandled opcode: %u. Perhaps "
"VG_(needs).extended_UCode should be set?",
u->opcode);
- VG_(panic)("VG_(saneUInstr): unhandled opcode");
+ VG_(core_panic)("VG_(saneUInstr): unhandled opcode");
}
}
# undef LIT0
case CondLE: return "le";
case CondNLE: return "nle";
case CondAlways: return "MP"; /* hack! */
- default: VG_(panic)("nameCondcode");
+ default: VG_(core_panic)("nameCondcode");
}
}
case 1: tag = u->tag1; val = u->val1; break;
case 2: tag = u->tag2; val = u->val2; break;
case 3: tag = u->tag3; val = u->val3; break;
- default: VG_(panic)("VG_(pp_UOperand)(1)");
+ default: VG_(core_panic)("VG_(pp_UOperand)(1)");
}
if (tag == Literal) val = u->lit32;
case ArchReg: VG_(printf)("%S",nameIReg(sz,val)); break;
case ArchRegS: VG_(printf)("%S",nameSReg(val)); break;
case SpillNo: VG_(printf)("spill%d", val); break;
- default: VG_(panic)("VG_(ppUOperand)(2)");
+ default: VG_(core_panic)("VG_(ppUOperand)(2)");
}
if (parens) VG_(printf)(")");
}
case BSWAP: return (upper ? "BSWAP" : "bswap");
default: break;
}
- if (!upper) VG_(panic)("vg_name_UOpcode: invalid !upper");
+ if (!upper) VG_(core_panic)("vg_name_UOpcode: invalid !upper");
switch (opc) {
case CALLM_S: return "CALLM_S";
case CALLM_E: return "CALLM_E";
VG_(printf)("unhandled opcode: %u. Perhaps "
"VG_(needs).extended_UCode should be set?",
opc);
- VG_(panic)("name_UOpcode: unhandled opcode");
+ VG_(core_panic)("name_UOpcode: unhandled opcode");
}
}
}
VG_(printf)("unhandled opcode: %u. Perhaps "
"VG_(needs).extended_UCode should be set?",
u->opcode);
- VG_(panic)("pp_UInstr: unhandled opcode");
+ VG_(core_panic)("pp_UInstr: unhandled opcode");
}
}
if (u->flags_r != FlagsEmpty || u->flags_w != FlagsEmpty) {
VG_(printf)("unhandled opcode: %u. Perhaps "
"VG_(needs).extended_UCode should be set?",
u->opcode);
- VG_(panic)("VG_(get_reg_usage): unhandled opcode");
+ VG_(core_panic)("VG_(get_reg_usage): unhandled opcode");
}
}
return n;
if (u->tag1 == TempReg) {
for (i = 0; i < n_tmap; i++)
if (temps[i].num == u->val1) break;
- if (i == n_tmap) VG_(panic)("patchUInstr(1)");
+ if (i == n_tmap) VG_(core_panic)("patchUInstr(1)");
u->tag1 = RealReg;
u->val1 = reals[i];
}
if (u->tag2 == TempReg) {
for (i = 0; i < n_tmap; i++)
if (temps[i].num == u->val2) break;
- if (i == n_tmap) VG_(panic)("patchUInstr(2)");
+ if (i == n_tmap) VG_(core_panic)("patchUInstr(2)");
u->tag2 = RealReg;
u->val2 = reals[i];
}
if (u->tag3 == TempReg) {
for (i = 0; i < n_tmap; i++)
if (temps[i].num == u->val3) break;
- if (i == n_tmap) VG_(panic)("patchUInstr(3)");
+ if (i == n_tmap) VG_(core_panic)("patchUInstr(3)");
u->tag3 = RealReg;
u->val3 = reals[i];
}
case 4: return aregno;
case 2: return aregno;
case 1: return aregno >= 4 ? aregno-4 : aregno;
- default: VG_(panic)("containingArchRegOf");
+ default: VG_(core_panic)("containingArchRegOf");
}
}
default:
VG_(pp_UInstr)(0,u);
- VG_(panic)("maybe_uinstrReadsArchReg: unhandled opcode");
+ VG_(core_panic)("maybe_uinstrReadsArchReg: unhandled opcode");
}
}
break;
if (j == VG_MAX_SPILLSLOTS) {
VG_(printf)("VG_MAX_SPILLSLOTS is too low; increase and recompile.\n");
- VG_(panic)("register allocation failed -- out of spill slots");
+ VG_(core_panic)("register allocation failed -- out of spill slots");
}
ss_busy_until_before[j] = temp_info[i].dead_before;
temp_info[i].spill_no = j;
have_spill_cand:
if (r == VG_MAX_REALREGS)
- VG_(panic)("new reg alloc: out of registers ?!");
+ VG_(core_panic)("new reg alloc: out of registers ?!");
/* Eject r. Important refinement: don't bother if the
associated TempReg is now dead. */
i = ((UInt)(tte->orig_addr)) % VG_TT_SIZE;
while (True) {
if (vg_tt[i].orig_addr == tte->orig_addr)
- VG_(panic)("add_to_trans_tab: duplicate");
+ VG_(core_panic)("add_to_trans_tab: duplicate");
if (vg_tt[i].orig_addr == VG_TTE_EMPTY) {
/* Put it here, and set the back pointer. */
vg_tt[i] = *tte;
Int i;
Addr ret_addr;
if (4+trans_size > VG_TC_SIZE-vg_tc_used)
- VG_(panic)("copy_to_transcache: not enough free space?!");
+ VG_(core_panic)("copy_to_transcache: not enough free space?!");
/* Leave a hole for the back pointer to the TT entry. */
vg_tc_used += 4;
ret_addr = (Addr)&vg_tc[vg_tc_used];
void SK_(pre_clo_init)(VgNeeds* needs, VgTrackEvents* track)
{
- needs->name = "example";
- needs->description = "an example Valgrind skin";
+ needs->name = "example";
+ needs->description = "an example Valgrind skin";
+ needs->report_bugs_to = "the North Pole";
}
void SK_(post_clo_init)(void)
}
#define PROF_EVENT(ev) \
- do { vg_assert((ev) >= 0 && (ev) < N_PROF_EVENTS); \
+ do { sk_assert((ev) >= 0 && (ev) < N_PROF_EVENTS); \
event_ctr[ev]++; \
} while (False);
/* It just happens that a SecMap occupies exactly 18 pages --
although this isn't important, so the following assert is
spurious. (SSS: not true for ESecMaps -- they're 16 pages) */
- vg_assert(0 == (sizeof(ESecMap) % VKI_BYTES_PER_PAGE));
+ sk_assert(0 == (sizeof(ESecMap) % VKI_BYTES_PER_PAGE));
map = VG_(get_memory_from_mmap)( sizeof(ESecMap), caller );
for (i = 0; i < ESEC_MAP_WORDS; i++)
/* Use bits 31..16 for primary, 15..2 for secondary lookup */
sm = primary_map[a >> 16];
- vg_assert(sm != &distinguished_secondary_map);
+ sk_assert(sm != &distinguished_secondary_map);
sm->swords[(a & 0xFFFC) >> 2] = sword;
if (VGE_IS_DISTINGUISHED_SM(sm)) {
VG_(printf)("wrote to distinguished 2ndary map! 0x%x\n", a);
// XXX: may be legit, but I want to know when it happens --njn
- VG_(panic)("wrote to distinguished 2ndary map!");
+ VG_(skin_panic)("wrote to distinguished 2ndary map!");
}
}
if (VGE_IS_DISTINGUISHED_SM(sm)) {
VG_(printf)("accessed distinguished 2ndary map! 0x%x\n", a);
// XXX: may be legit, but I want to know when it happens --njn
- //VG_(panic)("accessed distinguished 2ndary map!");
+ //VG_(skin_panic)("accessed distinguished 2ndary map!");
return SEC_MAP_ACCESS;
}
Addr a_past_end = a + size;
//PROF_EVENT(??) PPP
- vg_assert(IS_ALIGNED4_ADDR(a));
+ sk_assert(IS_ALIGNED4_ADDR(a));
for ( ; a < a_past_end; a += 4) {
set_sword(a, virgin_sword);
{
shadow_word sword;
- vg_assert(1 == VG_(get_current_tid_1_if_root)());
+ sk_assert(1 == VG_(get_current_tid_1_if_root)());
sword.other = TID_INDICATING_NONVIRGIN;
sword.state = Vge_Virgin;
set_sword(a, virgin_sword);
Int allocate_LockSet(LockSet* set)
{
if (n_lockset_table >= M_LOCKSET_TABLE)
- VG_(panic)("lockset table full -- increase M_LOCKSET_TABLE");
+ VG_(skin_panic)("lockset table full -- increase M_LOCKSET_TABLE");
lockset_table[n_lockset_table] = set;
n_lockset_table++;
# if DEBUG_MEM_LOCKSET_CHANGES || DEBUG_NEW_LOCKSETS
"i = %d, j = %d, badness = %d, caller = %s\n",
i, j, badness, caller);
pp_all_LockSets();
- VG_(panic)("sanity_check_locksets");
+ VG_(skin_panic)("sanity_check_locksets");
}
#endif /* LOCKSET_SANITY */
LockSet* new_node;
LockSet** prev_ptr = &new_vector;
LockSet* a = lockset_table[ia];
- vg_assert(is_valid_lockset_id(ia));
+ sk_assert(is_valid_lockset_id(ia));
# if DEBUG_MEM_LOCKSET_CHANGES
VG_(printf)("Removing from %d mutex %p:\n", ia, mx);
}
*prev_ptr = NULL;
}
- vg_assert(found == 1 /* sigh .. if the client is buggy */ || found == 0 );
+ sk_assert(found == 1 /* sigh .. if the client is buggy */ || found == 0 );
/* Preserve uniqueness invariants in face of client buggyness */
if (found == 0) {
a = a->next;
} else if (a->mutex > b->mutex) {
b = b->next;
- } else VG_(panic)("STOP PRESS: Laws of arithmetic broken");
+ } else VG_(skin_panic)("STOP PRESS: Laws of arithmetic broken");
*prev_ptr = NULL;
}
}
/* Check we won't overflow the OTHER_BITS bits of sword->other */
- vg_assert(i < (1 << OTHER_BITS));
+ sk_assert(i < (1 << OTHER_BITS));
# if LOCKSET_SANITY
sanity_check_locksets("intersect-OUT");
default:
VG_(printf)("init_status = %u\n", status);
- VG_(panic)("Unexpected Vge_InitStatus");
+ VG_(skin_panic)("Unexpected Vge_InitStatus");
}
/* Check that zero page and highest page have not been written to
-- this could happen with buggy syscall wrappers. Today
(2001-04-26) had precisely such a problem with
__NR_setitimer. */
- vg_assert(SK_(cheap_sanity_check)());
+ sk_assert(SK_(cheap_sanity_check)());
VGP_POPCC(VgpSARP);
}
uInstr2(cb, MOV, 4, Literal, 0, TempReg, t_size);
uLiteral(cb, (UInt)u_in->size);
- vg_assert(1 == u_in->size || 2 == u_in->size || 4 == u_in->size ||
+ sk_assert(1 == u_in->size || 2 == u_in->size || 4 == u_in->size ||
8 == u_in->size || 10 == u_in->size);
uInstr2(cb, CCALL, 0, TempReg, u_in->val1, TempReg, t_size);
// SSS: make regparms(2) eventually...
uInstr2(cb, MOV, 4, Literal, 0, TempReg, t_size);
uLiteral(cb, (UInt)u_in->size);
- vg_assert(1 == u_in->size || 2 == u_in->size || 4 == u_in->size ||
+ sk_assert(1 == u_in->size || 2 == u_in->size || 4 == u_in->size ||
8 == u_in->size || 10 == u_in->size);
uInstr2(cb, CCALL, 0, TempReg, u_in->val2, TempReg, t_size);
uCCall(cb, (Addr) & eraser_mem_write, 2, 0, False);
Bool SK_(eq_SkinError) ( VgRes not_used,
SkinError* e1, SkinError* e2 )
{
- vg_assert(EraserErr == e1->ekind && EraserErr == e2->ekind);
+ sk_assert(EraserErr == e1->ekind && EraserErr == e2->ekind);
if (e1->string != e2->string) return False;
if (0 != VG_(strcmp)(e1->string, e2->string)) return False;
return True;
void SK_(pp_SkinError) ( SkinError* err, void (*pp_ExeContext)(void) )
{
- vg_assert(EraserErr == err->ekind);
+ sk_assert(EraserErr == err->ekind);
VG_(message)(Vg_UserMsg, "Possible data race %s variable at 0x%x",
err->string, err->addr );
pp_ExeContext();
Bool SK_(error_matches_suppression)(SkinError* err, SkinSupp* su)
{
- vg_assert( su->skind == EraserSupp);
- vg_assert(err->ekind == EraserErr);
+ sk_assert( su->skind == EraserSupp);
+ sk_assert(err->ekind == EraserErr);
return True;
}
VG_(printf)("lock (%u, %x)\n", tid, mutex);
# endif
- vg_assert(tid < VG_N_THREADS &&
+ sk_assert(tid < VG_N_THREADS &&
thread_locks[tid] < M_LOCKSET_TABLE);
/* VG_(printf)("LOCK: held %d, new %p\n", thread_locks[tid], mutex); */
# if LOCKSET_SANITY > 1
while (True) {
if (i == M_LOCKSET_TABLE)
- VG_(panic)("lockset table full -- increase M_LOCKSET_TABLE");
+ VG_(skin_panic)("lockset table full -- increase M_LOCKSET_TABLE");
/* the lockset didn't already exist */
if (i == n_lockset_table) {
(*q) = new_node;
p = lockset_table[i];
- vg_assert(i == n_lockset_table);
+ sk_assert(i == n_lockset_table);
n_lockset_table++;
# if DEBUG_NEW_LOCKSETS
break;
default:
- VG_(panic)("Unknown eraser state");
+ VG_(skin_panic)("Unknown eraser state");
}
}
}
break;
default:
- VG_(panic)("Unknown eraser state");
+ VG_(skin_panic)("Unknown eraser state");
}
}
}
needs->name = "helgrind";
needs->description = "a data race detector";
+ needs->description = "njn25@cam.ac.uk";
needs->core_errors = True;
needs->skin_errors = True;
#define VGP_M_STACK 20
#define VGP_MAX_CCS 50
-/* Required function from coregrind/vg_include.h; duplicated declaration
- is a hack but will do. */
-__attribute__((noreturn))
-extern void VG_(skin_error) ( Char* s );
-
/* All zeroed initially because they're static */
static Int vgp_nticks;
"If you really need this many profile events, increase\n"
"VGP_MAX_CCS and recompile Valgrind.\n",
n, VGP_MAX_CCS);
- VG_(skin_error)("profile event too high");
+ VG_(skin_panic)("profile event too high");
}
if (vgp_names[n] != NULL) {
VG_(printf)("\nProfile event #%d being registered as `%s'\n"
"already registered as `%s'.\n"
"Note that skin and core event numbers must not overlap.\n",
n, name, vgp_names[n]);
- VG_(skin_error)("profile event already registered");
+ VG_(skin_panic)("profile event already registered");
}
vgp_names[n] = name;
signal(SIGPROF, VGP_(tick) );
ret = setitimer(ITIMER_PROF, &value, NULL);
- if (ret != 0) VG_(panic)("vgp_init_profiling");
+ if (ret != 0) VG_(core_panic)("vgp_init_profiling");
}
void VGP_(done_profiling) ( void )
"Or if you are nesting profiling events very deeply, increase\n"
"VGP_M_STACK and recompile Valgrind.\n",
VGP_M_STACK, cc, vgp_names[cc]);
- VG_(skin_error)("Profiling stack overflow");
+ VG_(skin_panic)("Profiling stack overflow");
}
vgp_sp++;
vgp_stack[vgp_sp] = cc;
VG_(printf)(
"\nProfile stack underflow. This is due to a VGP_(popcc)() without\n"
"a matching VGP_(pushcc)(). Make sure they all match.\n");
- VG_(skin_error)("Profiling stack underflow");
+ VG_(skin_panic)("Profiling stack underflow");
}
if (vgp_stack[vgp_sp] != cc) {
Int i;
extern void VG_(exit)( Int status )
__attribute__ ((__noreturn__));
-/* Prints a panic message (a constant string), appends newline, aborts. */
-extern void VG_(panic) ( Char* str )
- __attribute__ ((__noreturn__));
+/* Prints a panic message (a constant string), appends newline and bug
+ reporting info, aborts. */
+__attribute__ ((__noreturn__))
+extern void VG_(skin_panic) ( Char* str );
/* Looks up VG_(client_envp) */
extern Char* VG_(getenv) ( Char* name );
/* Asserts permanently enabled -- no turning off with NDEBUG. Hurrah! */
#define VG__STRING(__str) #__str
-#define vg_assert(expr) \
+#define sk_assert(expr) \
((void) ((expr) ? 0 : \
- (VG_(assert_fail) (VG__STRING(expr), \
- __FILE__, __LINE__, \
- __PRETTY_FUNCTION__), 0)))
+ (VG_(skin_assert_fail) (VG__STRING(expr), \
+ __FILE__, __LINE__, \
+ __PRETTY_FUNCTION__), 0)))
-extern void VG_(assert_fail) ( Char* expr, Char* file,
- Int line, Char* fn )
- __attribute__ ((__noreturn__));
+__attribute__ ((__noreturn__))
+extern void VG_(skin_assert_fail) ( Char* expr, Char* file,
+ Int line, Char* fn );
/* ------------------------------------------------------------------ */
*/
typedef
struct {
- /* Name and description used in the startup message. 'name' also
+ /* Name and description used in the startup message. `name' also
determines the string used for identifying suppressions in a
- suppression file as belonging to this skin. */
+ suppression file as belonging to this skin. `bug_reports_to'
+ (should be an email address) is printed if an `sk_assert' assertion
+ fails or VG_(skin_panic) is called. */
Char* name;
Char* description;
+ Char* bug_reports_to;
/* Booleans that decide core behaviour, but don't require extra
operations to be defined if `True' */
{
needs->name = "lackey";
needs->description = "a UInstr counter";
+ needs->description = "njn25@cam.ac.uk";
VG_(register_compact_helper)((Addr) & add_one_dlrr_call);
VG_(register_compact_helper)((Addr) & add_one_BB);
}
/* Ok, we have to allocate a new one. */
- vg_assert(vg_cgb_used == vg_cgb_size);
+ sk_assert(vg_cgb_used == vg_cgb_size);
sz_new = (vg_cgbs == NULL) ? 10 : (2 * vg_cgb_size);
cgbs_new = VG_(malloc)( sz_new * sizeof(CGenBlock) );
if (vg_csb_used >= vg_csb_size) {
/* No; we have to expand the array. */
- vg_assert(vg_csb_used == vg_csb_size);
+ sk_assert(vg_csb_used == vg_csb_size);
sz_new = (vg_csbs == NULL) ? 10 : (2 * vg_csb_size);
if (vg_csb_used > vg_csb_used_MAX)
vg_csb_used_MAX = vg_csb_used;
- vg_assert(vg_csb_used <= vg_csb_size);
+ sk_assert(vg_csb_used <= vg_csb_size);
/* VG_(printf)("acsb %p %d\n", aa, sz); */
SK_(make_noaccess) ( aa, sz );
# if 1
for (i = 1; i < vg_csb_used; i++)
- vg_assert(vg_csbs[i-1].start >= vg_csbs[i].start);
+ sk_assert(vg_csbs[i-1].start >= vg_csbs[i].start);
# endif
}
if (vg_cgbs == NULL
|| arg[2] >= vg_cgb_used || vg_cgbs[arg[2]].kind == CG_NotInUse)
return 1;
- vg_assert(arg[2] >= 0 && arg[2] < vg_cgb_used);
+ sk_assert(arg[2] >= 0 && arg[2] < vg_cgb_used);
vg_cgbs[arg[2]].kind = CG_NotInUse;
vg_cgb_discards++;
return 0;
default:
VG_(printf)("Error:\n unknown MemCheck error code %d\n", e1->ekind);
- VG_(panic)("unknown error code in SK_(eq_SkinError)");
+ VG_(skin_panic)("unknown error code in SK_(eq_SkinError)");
}
}
break;
}
default:
- VG_(panic)("pp_AddrInfo");
+ VG_(skin_panic)("pp_AddrInfo");
}
}
"stated on the next line");
break;
default:
- VG_(panic)("pp_SkinError(axskind)");
+ VG_(skin_panic)("pp_SkinError(axskind)");
}
pp_ExeContext();
pp_AddrInfo(err->addr, &err_extra->addrinfo);
default:
VG_(printf)("Error:\n unknown MemCheck error code %d\n", err->ekind);
- VG_(panic)("unknown error code in SK_(pp_SkinError)");
+ VG_(skin_panic)("unknown error code in SK_(pp_SkinError)");
}
}
{
MemCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_MemCheckError( &err_extra );
err_extra.addrinfo.akind = Undescribed;
err_extra.isWrite = isWrite;
{
MemCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_MemCheckError( &err_extra );
err_extra.axskind = ExecAxs;
{
MemCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_MemCheckError( &err_extra );
err_extra.addrinfo.akind = Undescribed;
{
MemCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_MemCheckError( &err_extra );
err_extra.addrinfo.akind = Undescribed;
{
MemCheckError err_extra;
- vg_assert(NULL != tst);
+ sk_assert(NULL != tst);
clear_MemCheckError( &err_extra );
err_extra.addrinfo.akind = Undescribed;
default:
VG_(printf)("Error:\n"
" unknown MemCheck suppression type %d\n", su->skind);
- VG_(panic)("unknown suppression type in "
- "SK_(error_matches_suppression)");
+ VG_(skin_panic)("unknown suppression type in "
+ "SK_(error_matches_suppression)");
}
}
if (sz == 2) {
VG_(emitB) ( 0x66 );
} else {
- vg_assert(sz == 4);
+ sk_assert(sz == 4);
}
VG_(emitB) ( 0xF7 ); /* Grp3 Ev */
VG_(emit_amode_ereg_greg) ( reg, 0 /* Grp3 subopcode for TEST */ );
if (sz == 2) {
VG_(emitB) ( 0x66 );
} else {
- vg_assert(sz == 4);
+ sk_assert(sz == 4);
}
VG_(emitB) ( 0xF7 ); /* Grp3 Ev */
VG_(emit_amode_offregmem_reg) ( off, reg, 0 /* Grp3 subopcode for TEST */ );
case 4: helper = (Addr) & SK_(helperc_LOADV4); break;
case 2: helper = (Addr) & SK_(helperc_LOADV2); break;
case 1: helper = (Addr) & SK_(helperc_LOADV1); break;
- default: VG_(panic)("synth_LOADV");
+ default: VG_(skin_panic)("synth_LOADV");
}
VG_(synth_ccall) ( helper, 1, 1, argv, tagv, tv_reg,
regs_live_before, regs_live_after );
UInt argv[] = { a_reg, tv_val };
Tag tagv[] = { RealReg, tv_tag };
- vg_assert(tv_tag == RealReg || tv_tag == Literal);
+ sk_assert(tv_tag == RealReg || tv_tag == Literal);
switch (sz) {
case 4: helper = (Addr) SK_(helperc_STOREV4); break;
case 2: helper = (Addr) SK_(helperc_STOREV2); break;
case 1: helper = (Addr) SK_(helperc_STOREV1); break;
- default: VG_(panic)("synth_STOREV");
+ default: VG_(skin_panic)("synth_STOREV");
}
VG_(synth_ccall) ( helper, 2, 2, argv, tagv, INVALID_REALREG,
regs_live_before, regs_live_after );
case 2: val = 0xFFFF0000; break;
case 1: val = 0xFFFFFF00; break;
case 0: val = 0xFFFFFFFE; break;
- default: VG_(panic)("synth_SETV");
+ default: VG_(skin_panic)("synth_SETV");
}
VG_(emit_movv_lit_reg) ( 4, val, reg );
}
the codegen scheme used below. Since there are a shortage of
compact helper slots, and since the size==1 case is never
actually used, we assert against it. */
- vg_assert(sz == 0 || sz == 2 || sz == 4);
+ sk_assert(sz == 0 || sz == 2 || sz == 4);
- vg_assert(tag == ArchReg || tag == RealReg);
+ sk_assert(tag == ArchReg || tag == RealReg);
if (tag == ArchReg) {
switch (sz) {
case 4:
case 0:
/* should never happen */
default:
- VG_(panic)("synth_TESTV(ArchReg)");
+ VG_(skin_panic)("synth_TESTV(ArchReg)");
}
} else {
switch (sz) {
synth_minimal_test_lit_reg ( 0x00000001, val );
break;
default:
- VG_(panic)("synth_TESTV(RealReg)");
+ VG_(skin_panic)("synth_TESTV(RealReg)");
}
}
VG_(emit_jcondshort_delta) ( CondZ, 3 );
VG_(emit_nonshiftopv_lit_reg) ( 4, OR, 0xFFFFFF00, reg );
break;
default:
- VG_(panic)("synth_GETV");
+ VG_(skin_panic)("synth_GETV");
}
}
UInt lit = lit_or_reg;
switch (sz) {
case 4:
- vg_assert(lit == 0x00000000);
+ sk_assert(lit == 0x00000000);
VG_(emit_movv_lit_offregmem) ( 4, 0x00000000,
VG_(shadow_reg_offset)(arch), R_EBP );
break;
case 2:
- vg_assert(lit == 0xFFFF0000);
+ sk_assert(lit == 0xFFFF0000);
VG_(emit_movv_lit_offregmem) ( 2, 0x0000,
VG_(shadow_reg_offset)(arch), R_EBP );
break;
case 1:
- vg_assert(lit == 0xFFFFFF00);
+ sk_assert(lit == 0xFFFFFF00);
if (arch < 4) {
VG_(emit_movb_lit_offregmem) ( 0x00,
VG_(shadow_reg_offset)(arch), R_EBP );
}
break;
default:
- VG_(panic)("synth_PUTV(lit)");
+ VG_(skin_panic)("synth_PUTV(lit)");
}
} else {
UInt reg;
- vg_assert(srcTag == RealReg);
+ sk_assert(srcTag == RealReg);
if (sz == 1 && lit_or_reg >= 4) {
VG_(emit_swapl_reg_EAX) ( lit_or_reg );
reg = lit_or_reg;
}
- if (sz == 1) vg_assert(reg < 4);
+ if (sz == 1) sk_assert(reg < 4);
switch (sz) {
case 4:
}
break;
default:
- VG_(panic)("synth_PUTV(reg)");
+ VG_(skin_panic)("synth_PUTV(reg)");
}
if (sz == 1 && lit_or_reg >= 4) {
break;
default:
- VG_(panic)("synth_TAG1_op");
+ VG_(skin_panic)("synth_TAG1_op");
}
}
break;
default:
- VG_(panic)("synth_TAG2_op");
+ VG_(skin_panic)("synth_TAG2_op");
}
}
switch (u->opcode) {
case SETV:
- vg_assert(u->tag1 == RealReg);
+ sk_assert(u->tag1 == RealReg);
synth_SETV ( u->size, u->val1 );
break;
case STOREV:
- vg_assert(u->tag1 == RealReg || u->tag1 == Literal);
- vg_assert(u->tag2 == RealReg);
+ sk_assert(u->tag1 == RealReg || u->tag1 == Literal);
+ sk_assert(u->tag2 == RealReg);
synth_STOREV ( u->size, u->tag1,
u->tag1==Literal ? u->lit32 : u->val1,
u->val2,
break;
case LOADV:
- vg_assert(u->tag1 == RealReg);
- vg_assert(u->tag2 == RealReg);
+ sk_assert(u->tag1 == RealReg);
+ sk_assert(u->tag2 == RealReg);
if (0)
VG_(emit_AMD_prefetch_reg) ( u->val1 );
synth_LOADV ( u->size, u->val1, u->val2,
break;
case TESTV:
- vg_assert(u->tag1 == RealReg || u->tag1 == ArchReg);
+ sk_assert(u->tag1 == RealReg || u->tag1 == ArchReg);
synth_TESTV(u->size, u->tag1, u->val1);
break;
case GETV:
- vg_assert(u->tag1 == ArchReg);
- vg_assert(u->tag2 == RealReg);
+ sk_assert(u->tag1 == ArchReg);
+ sk_assert(u->tag2 == RealReg);
synth_GETV(u->size, u->val1, u->val2);
break;
case GETVF:
- vg_assert(u->tag1 == RealReg);
- vg_assert(u->size == 0);
+ sk_assert(u->tag1 == RealReg);
+ sk_assert(u->size == 0);
synth_GETVF(u->val1);
break;
case PUTV:
- vg_assert(u->tag1 == RealReg || u->tag1 == Literal);
- vg_assert(u->tag2 == ArchReg);
+ sk_assert(u->tag1 == RealReg || u->tag1 == Literal);
+ sk_assert(u->tag2 == ArchReg);
synth_PUTV(u->size, u->tag1,
u->tag1==Literal ? u->lit32 : u->val1,
u->val2 );
break;
case PUTVF:
- vg_assert(u->tag1 == RealReg);
- vg_assert(u->size == 0);
+ sk_assert(u->tag1 == RealReg);
+ sk_assert(u->size == 0);
synth_PUTVF(u->val1);
break;
default:
VG_(printf)("emit_XUInstr: unhandled extension insn:\n");
VG_(pp_UInstr)(0,u);
- VG_(panic)("emit_XUInstr: unhandled extension opcode");
+ VG_(skin_panic)("emit_XUInstr: unhandled extension opcode");
}
}
}
#define PROF_EVENT(ev) \
- do { vg_assert((ev) >= 0 && (ev) < N_PROF_EVENTS); \
+ do { sk_assert((ev) >= 0 && (ev) < N_PROF_EVENTS); \
event_ctr[ev]++; \
} while (False);
/* It just happens that a SecMap occupies exactly 18 pages --
although this isn't important, so the following assert is
spurious. */
- vg_assert(0 == (sizeof(SecMap) % VKI_BYTES_PER_PAGE));
+ sk_assert(0 == (sizeof(SecMap) % VKI_BYTES_PER_PAGE));
map = VG_(get_memory_from_mmap)( sizeof(SecMap), caller );
for (i = 0; i < 8192; i++)
UChar abits8;
PROF_EVENT(24);
# ifdef VG_DEBUG_MEMORY
- vg_assert(IS_ALIGNED4_ADDR(a));
+ sk_assert(IS_ALIGNED4_ADDR(a));
# endif
sm = primary_map[a >> 16];
sm_off = a & 0xFFFF;
UInt sm_off = a & 0xFFFF;
PROF_EVENT(25);
# ifdef VG_DEBUG_MEMORY
- vg_assert(IS_ALIGNED4_ADDR(a));
+ sk_assert(IS_ALIGNED4_ADDR(a));
# endif
return ((UInt*)(sm->vbyte))[sm_off >> 2];
}
indicate bugs in our machinery. 30,000,000 is arbitrary, but so
far all legitimate requests have fallen beneath that size. */
/* 4 Mar 02: this is just stupid; get rid of it. */
- /* vg_assert(len < 30000000); */
+ /* sk_assert(len < 30000000); */
/* Check the permissions make sense. */
- vg_assert(example_a_bit == VGM_BIT_VALID
+ sk_assert(example_a_bit == VGM_BIT_VALID
|| example_a_bit == VGM_BIT_INVALID);
- vg_assert(example_v_bit == VGM_BIT_VALID
+ sk_assert(example_v_bit == VGM_BIT_VALID
|| example_v_bit == VGM_BIT_INVALID);
if (example_a_bit == VGM_BIT_INVALID)
- vg_assert(example_v_bit == VGM_BIT_INVALID);
+ sk_assert(example_v_bit == VGM_BIT_INVALID);
/* The validity bits to write. */
vbyte = example_v_bit==VGM_BIT_VALID
VGP_POPCC(VgpSetMem);
return;
}
- vg_assert((a % 8) == 0 && len > 0);
+ sk_assert((a % 8) == 0 && len > 0);
/* Once aligned, go fast. */
while (True) {
VGP_POPCC(VgpSetMem);
return;
}
- vg_assert((a % 8) == 0 && len > 0 && len < 8);
+ sk_assert((a % 8) == 0 && len > 0 && len < 8);
/* Finish the upper fragment. */
while (True) {
/* Check that zero page and highest page have not been written to
-- this could happen with buggy syscall wrappers. Today
(2001-04-26) had precisely such a problem with __NR_setitimer. */
- vg_assert(SK_(cheap_sanity_check)());
+ sk_assert(SK_(cheap_sanity_check)());
VGP_POPCC(VgpSetMem);
}
PROF_EVENT(50);
# ifdef VG_DEBUG_MEMORY
- vg_assert(IS_ALIGNED4_ADDR(a));
- vg_assert(IS_ALIGNED4_ADDR(len));
+ sk_assert(IS_ALIGNED4_ADDR(a));
+ sk_assert(IS_ALIGNED4_ADDR(len));
# endif
for ( ; a < a_past_end; a += 4) {
PROF_EVENT(51);
# ifdef VG_DEBUG_MEMORY
- vg_assert(IS_ALIGNED4_ADDR(a));
- vg_assert(IS_ALIGNED4_ADDR(len));
+ sk_assert(IS_ALIGNED4_ADDR(a));
+ sk_assert(IS_ALIGNED4_ADDR(len));
# endif
for ( ; a < a_past_end; a += 4) {
break;
default:
- VG_(panic)("check_is_writable: Unknown or unexpected CorePart");
+ VG_(skin_panic)("check_is_writable: Unknown or unexpected CorePart");
}
}
break;
default:
- VG_(panic)("check_is_readable: Unknown or unexpected CorePart");
+ VG_(skin_panic)("check_is_readable: Unknown or unexpected CorePart");
}
}
VGP_POPCC(VgpCheckMem);
VGP_PUSHCC(VgpCheckMem);
- vg_assert(part == Vg_CoreSysCall);
+ sk_assert(part == Vg_CoreSysCall);
ok = SK_(check_readable_asciiz) ( (Addr)str, &bad_addr );
if (!ok) {
SK_(record_param_error) ( tst, bad_addr, /*is_writable =*/False, s );
(which is the default), and the address is 4-aligned.
If not, Case 2 will have applied.
*/
- vg_assert(SK_(clo_partial_loads_ok));
+ sk_assert(SK_(clo_partial_loads_ok));
{
UInt vw = VGM_WORD_INVALID;
vw <<= 8; vw |= (a3ok ? vb3 : VGM_BYTE_INVALID);
}
VG_(printf)("size is %d\n", size);
- VG_(panic)("vgmext_fpu_read_check: unhandled size");
+ VG_(skin_panic)("vgmext_fpu_read_check: unhandled size");
# endif
}
}
VG_(printf)("size is %d\n", size);
- VG_(panic)("vgmext_fpu_write_check: unhandled size");
+ VG_(skin_panic)("vgmext_fpu_write_check: unhandled size");
# endif
}
/* VG_(printf)("freelist sanity\n"); */
for (sc = vg_freed_list_start; sc != NULL; sc = sc->next)
n += sc->size;
- vg_assert(n == vg_freed_list_volume);
+ sk_assert(n == vg_freed_list_volume);
}
/* Put a shadow chunk on the freed blocks queue, possibly freeing up
/* Put it at the end of the freed list */
if (vg_freed_list_end == NULL) {
- vg_assert(vg_freed_list_start == NULL);
+ sk_assert(vg_freed_list_start == NULL);
vg_freed_list_end = vg_freed_list_start = sc;
vg_freed_list_volume = sc->size;
} else {
- vg_assert(vg_freed_list_end->next == NULL);
+ sk_assert(vg_freed_list_end->next == NULL);
vg_freed_list_end->next = sc;
vg_freed_list_end = sc;
vg_freed_list_volume += sc->size;
while (vg_freed_list_volume > SK_(clo_freelist_vol)) {
/* freelist_sanity(); */
- vg_assert(vg_freed_list_start != NULL);
- vg_assert(vg_freed_list_end != NULL);
+ sk_assert(vg_freed_list_start != NULL);
+ sk_assert(vg_freed_list_end != NULL);
sc1 = vg_freed_list_start;
vg_freed_list_volume -= sc1->size;
/* VG_(printf)("volume now %d\n", vg_freed_list_volume); */
- vg_assert(vg_freed_list_volume >= 0);
+ sk_assert(vg_freed_list_volume >= 0);
if (vg_freed_list_start == vg_freed_list_end) {
vg_freed_list_start = vg_freed_list_end = NULL;
sigbus_new.ksa_flags = VKI_SA_ONSTACK | VKI_SA_RESTART;
sigbus_new.ksa_restorer = NULL;
res = VG_(ksigemptyset)( &sigbus_new.ksa_mask );
- vg_assert(res == 0);
+ sk_assert(res == 0);
sigsegv_new.ksa_handler = vg_scan_all_valid_memory_sighandler;
sigsegv_new.ksa_flags = VKI_SA_ONSTACK | VKI_SA_RESTART;
sigsegv_new.ksa_restorer = NULL;
res = VG_(ksigemptyset)( &sigsegv_new.ksa_mask );
- vg_assert(res == 0+0);
+ sk_assert(res == 0+0);
res = VG_(ksigemptyset)( &unblockmask_new );
res |= VG_(ksigaddset)( &unblockmask_new, VKI_SIGBUS );
res |= VG_(ksigaddset)( &unblockmask_new, VKI_SIGSEGV );
res |= VG_(ksigaddset)( &unblockmask_new, VKI_SIGTERM );
- vg_assert(res == 0+0+0);
+ sk_assert(res == 0+0+0);
res = VG_(ksigaction)( VKI_SIGBUS, &sigbus_new, &sigbus_saved );
- vg_assert(res == 0+0+0+0);
+ sk_assert(res == 0+0+0+0);
res = VG_(ksigaction)( VKI_SIGSEGV, &sigsegv_new, &sigsegv_saved );
- vg_assert(res == 0+0+0+0+0);
+ sk_assert(res == 0+0+0+0+0);
res = VG_(ksigprocmask)( VKI_SIG_UNBLOCK, &unblockmask_new, &blockmask_saved );
- vg_assert(res == 0+0+0+0+0+0);
+ sk_assert(res == 0+0+0+0+0+0);
/* The signal handlers are installed. Actually do the memory scan. */
numPages = 1 << (32-VKI_BYTES_PER_PAGE_BITS);
- vg_assert(numPages == 1048576);
- vg_assert(4096 == (1 << VKI_BYTES_PER_PAGE_BITS));
+ sk_assert(numPages == 1048576);
+ sk_assert(4096 == (1 << VKI_BYTES_PER_PAGE_BITS));
nWordsNotified = 0;
/* Restore signal state to whatever it was before. */
res = VG_(ksigaction)( VKI_SIGBUS, &sigbus_saved, NULL );
- vg_assert(res == 0 +0);
+ sk_assert(res == 0 +0);
res = VG_(ksigaction)( VKI_SIGSEGV, &sigsegv_saved, NULL );
- vg_assert(res == 0 +0 +0);
+ sk_assert(res == 0 +0 +0);
res = VG_(ksigprocmask)( VKI_SIG_SETMASK, &blockmask_saved, NULL );
- vg_assert(res == 0 +0 +0 +0);
+ sk_assert(res == 0 +0 +0 +0);
return nWordsNotified;
}
lo = mid+1;
continue;
}
- vg_assert(ptr >= a_mid_lo && ptr <= a_mid_hi);
+ sk_assert(ptr >= a_mid_lo && ptr <= a_mid_hi);
retVal = mid;
break;
}
# ifdef VG_DEBUG_LEAKCHECK
- vg_assert(retVal == find_shadow_for_OLD ( ptr, shadows, n_shadows ));
+ sk_assert(retVal == find_shadow_for_OLD ( ptr, shadows, n_shadows ));
# endif
/* VG_(printf)("%d\n", retVal); */
return retVal;
sh_no = find_shadow_for ( ptr, vglc_shadows, vglc_n_shadows );
if (sh_no != -1) {
/* Found a block at/into which ptr points. */
- vg_assert(sh_no >= 0 && sh_no < vglc_n_shadows);
- vg_assert(ptr < vglc_shadows[sh_no]->data
+ sk_assert(sh_no >= 0 && sh_no < vglc_n_shadows);
+ sk_assert(ptr < vglc_shadows[sh_no]->data
+ vglc_shadows[sh_no]->size);
/* Decide whether Proper-ly or Interior-ly reached. */
if (ptr == vglc_shadows[sh_no]->data) {
/* VG_(get_malloc_shadows) allocates storage for shadows */
vglc_shadows = VG_(get_malloc_shadows)( &vglc_n_shadows );
if (vglc_n_shadows == 0) {
- vg_assert(vglc_shadows == NULL);
+ sk_assert(vglc_shadows == NULL);
VG_(message)(Vg_UserMsg,
"No malloc'd blocks -- no leaks are possible.\n");
return;
/* Sanity check; assert that the blocks are now in order and that
they don't overlap. */
for (i = 0; i < vglc_n_shadows-1; i++) {
- vg_assert( ((Addr)vglc_shadows[i]->data)
+ sk_assert( ((Addr)vglc_shadows[i]->data)
< ((Addr)vglc_shadows[i+1]->data) );
- vg_assert( ((Addr)vglc_shadows[i]->data) + vglc_shadows[i]->size
+ sk_assert( ((Addr)vglc_shadows[i]->data) + vglc_shadows[i]->size
< ((Addr)vglc_shadows[i+1]->data) );
}
p_min = p;
}
}
- vg_assert(p_min != NULL);
+ sk_assert(p_min != NULL);
if ( (!SK_(clo_show_reachable)) && p_min->loss_mode == Proper) {
p_min->num_blocks = 0;
str[w++] = ' ';
}
str[w++] = 0;
- vg_assert(w == 36);
+ sk_assert(w == 36);
}
/* Caution! Not vthread-safe; looks in VG_(baseBlock), not the thread
VG_(message)(Vg_DebugMsg,
"probable sanity check failure for syscall number %d\n",
syscallno );
- VG_(panic)("aborting due to the above ... bye!");
+ VG_(skin_panic)("aborting due to the above ... bye!");
}
}
{
needs->name = "memcheck";
needs->description = "a memory error detector";
+ needs->bug_reports_to = "jseward@acm.org";
needs->core_errors = True;
needs->skin_errors = True;
case TAG2: return LIT0 && SZ0 && CC0 && TR1 && TR2 && Ls3 && XOTHER;
default:
VG_(printf)("unhandled opcode: %u\n", u->opcode);
- VG_(panic)("SK_(sane_XUInstr): unhandled opcode");
+ VG_(skin_panic)("SK_(sane_XUInstr): unhandled opcode");
}
# undef LIT0
# undef LIT1
case Tag_ImproveOR2_TQ: return "ImproveOR2_TQ";
case Tag_ImproveOR1_TQ: return "ImproveOR1_TQ";
case Tag_DebugFn: return "DebugFn";
- default: VG_(panic)("vg_nameOfTagOp");
+ default: VG_(skin_panic)("vg_nameOfTagOp");
}
}
case SETV: return "SETV";
default:
VG_(printf)("unhandled opcode: %u\n", opc);
- VG_(panic)("SK_(name_XUOpcode): unhandled case");
+ VG_(skin_panic)("SK_(name_XUOpcode): unhandled case");
}
}
default:
VG_(printf)("unhandled opcode: %u\n", u->opcode);
- VG_(panic)("SK_(pp_XUInstr): unhandled opcode");
+ VG_(skin_panic)("SK_(pp_XUInstr): unhandled opcode");
}
}
default:
VG_(printf)("unhandled opcode: %u\n", u->opcode);
- VG_(panic)("SK_(get_Xreg_usage): unhandled opcode");
+ VG_(skin_panic)("SK_(get_Xreg_usage): unhandled opcode");
}
return n;
case 4: return Tag_ImproveOR4_TQ;
case 2: return Tag_ImproveOR2_TQ;
case 1: return Tag_ImproveOR1_TQ;
- default: VG_(panic)("get_Tag_ImproveOR_TQ");
+ default: VG_(skin_panic)("get_Tag_ImproveOR_TQ");
}
}
case 4: return Tag_ImproveAND4_TQ;
case 2: return Tag_ImproveAND2_TQ;
case 1: return Tag_ImproveAND1_TQ;
- default: VG_(panic)("get_Tag_ImproveAND_TQ");
+ default: VG_(skin_panic)("get_Tag_ImproveAND_TQ");
}
}
case 4: return Tag_Left4;
case 2: return Tag_Left2;
case 1: return Tag_Left1;
- default: VG_(panic)("get_Tag_Left");
+ default: VG_(skin_panic)("get_Tag_Left");
}
}
case 2: return Tag_UifU2;
case 1: return Tag_UifU1;
case 0: return Tag_UifU0;
- default: VG_(panic)("get_Tag_UifU");
+ default: VG_(skin_panic)("get_Tag_UifU");
}
}
case 4: return Tag_DifD4;
case 2: return Tag_DifD2;
case 1: return Tag_DifD1;
- default: VG_(panic)("get_Tag_DifD");
+ default: VG_(skin_panic)("get_Tag_DifD");
}
}
if (szs == 1 && szd == 2) return Tag_PCast12;
if (szs == 1 && szd == 1) return Tag_PCast11;
VG_(printf)("get_Tag_PCast(%d,%d)\n", szs, szd);
- VG_(panic)("get_Tag_PCast");
+ VG_(skin_panic)("get_Tag_PCast");
}
if (szs == 2 && szd == 4 && !syned) return Tag_ZWiden24;
VG_(printf)("get_Tag_Widen(%d,%d,%d)\n", (Int)syned, szs, szd);
- VG_(panic)("get_Tag_Widen");
+ VG_(skin_panic)("get_Tag_Widen");
}
/* Pessimally cast the spec'd shadow from one size to another. */
uInstr2(cb, GETV, sz, ArchReg, val, TempReg, sh);
return sh;
}
- VG_(panic)("getOperandShadow");
+ VG_(skin_panic)("getOperandShadow");
}
/* Create and return an instrumented version of cb_in. Free cb_in
all this is that instrumentation of USESEG is a no-op! */
case PUTSEG:
- vg_assert(u_in->tag1 == TempReg);
+ sk_assert(u_in->tag1 == TempReg);
uInstr1(cb, TESTV, 2, TempReg, SHADOW(u_in->val1));
uInstr1(cb, SETV, 2, TempReg, SHADOW(u_in->val1));
VG_(copy_UInstr)(cb, u_in);
break;
case GETSEG:
- vg_assert(u_in->tag2 == TempReg);
+ sk_assert(u_in->tag2 == TempReg);
uInstr1(cb, SETV, 2, TempReg, SHADOW(u_in->val2));
VG_(copy_UInstr)(cb, u_in);
break;
TempReg, SHADOW(u_in->val2));
break;
default:
- VG_(panic)("memcheck_instrument: MOV");
+ VG_(skin_panic)("memcheck_instrument: MOV");
}
VG_(copy_UInstr)(cb, u_in);
break;
Therefore: lea1#(qa) = left(qa)
*/
case LEA1:
- vg_assert(u_in->size == 4 && !VG_(any_flag_use)(u_in));
+ sk_assert(u_in->size == 4 && !VG_(any_flag_use)(u_in));
qs = SHADOW(u_in->val1);
qd = SHADOW(u_in->val2);
uInstr2(cb, MOV, 4, TempReg, qs, TempReg, qd);
*/
case LEA2: {
Int shift;
- vg_assert(u_in->size == 4 && !VG_(any_flag_use)(u_in));
+ sk_assert(u_in->size == 4 && !VG_(any_flag_use)(u_in));
switch (u_in->extra4b) {
case 1: shift = 0; break;
case 2: shift = 1; break;
case 4: shift = 2; break;
case 8: shift = 3; break;
- default: VG_(panic)( "memcheck_instrument(LEA2)" );
+ default: VG_(skin_panic)( "memcheck_instrument(LEA2)" );
}
qs = SHADOW(u_in->val1);
qt = SHADOW(u_in->val2);
the eflags.
*/
case RCL: case RCR:
- vg_assert(u_in->flags_r != FlagsEmpty);
+ sk_assert(u_in->flags_r != FlagsEmpty);
/* The following assertion looks like it makes sense, but is
actually wrong. Consider this:
rcll %eax
write of the rcll is annulled by the prior improvement pass.
Noticed by Kevin Ryde <user42@zip.com.au>
*/
- /* vg_assert(u_in->flags_w != FlagsEmpty); */
+ /* sk_assert(u_in->flags_w != FlagsEmpty); */
qs = getOperandShadow(cb, u_in->size, u_in->tag1, u_in->val1);
/* We can safely modify qs; cast it to 0-size. */
create_PCast(cb, u_in->size, 0, qs);
case SHR: case SAR:
case ROL: case ROR: {
Int t_amount = INVALID_TEMPREG;
- vg_assert(u_in->tag1 == TempReg || u_in->tag1 == Literal);
- vg_assert(u_in->tag2 == TempReg);
+ sk_assert(u_in->tag1 == TempReg || u_in->tag1 == Literal);
+ sk_assert(u_in->tag2 == TempReg);
qd = SHADOW(u_in->val2);
/* Make qs hold shift-count# and make
/* One simple tag operation. */
case WIDEN:
- vg_assert(u_in->tag1 == TempReg);
+ sk_assert(u_in->tag1 == TempReg);
create_Widen(cb, u_in->signed_widen, u_in->extra4b, u_in->size,
SHADOW(u_in->val1));
VG_(copy_UInstr)(cb, u_in);
/* not#(x) = x (since bitwise independent) */
case NOT:
- vg_assert(u_in->tag1 == TempReg);
+ sk_assert(u_in->tag1 == TempReg);
VG_(copy_UInstr)(cb, u_in);
break;
/* neg#(x) = left(x) (derivable from case for SUB) */
case NEG:
- vg_assert(u_in->tag1 == TempReg);
+ sk_assert(u_in->tag1 == TempReg);
create_Left(cb, u_in->size, SHADOW(u_in->val1));
VG_(copy_UInstr)(cb, u_in);
break;
/* bswap#(x) = bswap(x) */
case BSWAP:
- vg_assert(u_in->tag1 == TempReg);
- vg_assert(u_in->size == 4);
+ sk_assert(u_in->tag1 == TempReg);
+ sk_assert(u_in->size == 4);
qd = SHADOW(u_in->val1);
uInstr1(cb, BSWAP, 4, TempReg, qd);
VG_(copy_UInstr)(cb, u_in);
/* cc2val#(qd) = pcast-0-to-size(eflags#) */
case CC2VAL:
- vg_assert(u_in->tag1 == TempReg);
- vg_assert(u_in->flags_r != FlagsEmpty);
+ sk_assert(u_in->tag1 == TempReg);
+ sk_assert(u_in->flags_r != FlagsEmpty);
qt = create_GETVF(cb, u_in->size);
uInstr2(cb, MOV, 4, TempReg, qt, TempReg, SHADOW(u_in->val1));
VG_(copy_UInstr)(cb, u_in);
validity of the flags.
*/
case CMOV:
- vg_assert(u_in->size == 4);
- vg_assert(u_in->tag1 == TempReg);
- vg_assert(u_in->tag2 == TempReg);
- vg_assert(u_in->flags_r != FlagsEmpty);
- vg_assert(u_in->flags_w == FlagsEmpty);
+ sk_assert(u_in->size == 4);
+ sk_assert(u_in->tag1 == TempReg);
+ sk_assert(u_in->tag2 == TempReg);
+ sk_assert(u_in->flags_r != FlagsEmpty);
+ sk_assert(u_in->flags_w == FlagsEmpty);
qs = SHADOW(u_in->val1);
qd = SHADOW(u_in->val2);
qt = create_GETVF(cb, 0);
create_UifU(cb, u_in->size, qs, qd);
create_Left(cb, u_in->size, qd);
if (u_in->opcode == ADC || u_in->opcode == SBB) {
- vg_assert(u_in->flags_r != FlagsEmpty);
+ sk_assert(u_in->flags_r != FlagsEmpty);
qt = create_GETVF(cb, u_in->size);
create_UifU(cb, u_in->size, qt, qd);
}
qd = qt `DifD` qd
*/
case AND: case OR:
- vg_assert(u_in->tag1 == TempReg);
- vg_assert(u_in->tag2 == TempReg);
+ sk_assert(u_in->tag1 == TempReg);
+ sk_assert(u_in->tag2 == TempReg);
qd = SHADOW(u_in->val2);
qs = SHADOW(u_in->val1);
qt = newShadow(cb);
uInstr1(cb, TESTV, 4, TempReg, SHADOW(u_in->val1));
uInstr1(cb, SETV, 4, TempReg, SHADOW(u_in->val1));
} else {
- vg_assert(u_in->tag1 == Literal);
+ sk_assert(u_in->tag1 == Literal);
}
if (u_in->cond != CondAlways) {
- vg_assert(u_in->flags_r != FlagsEmpty);
+ sk_assert(u_in->flags_r != FlagsEmpty);
qt = create_GETVF(cb, 0);
uInstr1(cb, TESTV, 0, TempReg, qt);
/* qt should never be referred to again. Nevertheless
case FPU_R: case FPU_W: {
Int t_size = INVALID_TEMPREG;
- vg_assert(u_in->tag2 == TempReg);
+ sk_assert(u_in->tag2 == TempReg);
uInstr1(cb, TESTV, 4, TempReg, SHADOW(u_in->val2));
uInstr1(cb, SETV, 4, TempReg, SHADOW(u_in->val2));
default:
VG_(pp_UInstr)(0, u_in);
- VG_(panic)( "memcheck_instrument: unhandled case");
+ VG_(skin_panic)( "memcheck_instrument: unhandled case");
} /* end of switch (u_in->opcode) */
if (u->opcode == SETV) {
if (u->tag1 == TempReg) {
- vg_assert(VGC_IS_SHADOW(u->val1));
+ sk_assert(VGC_IS_SHADOW(u->val1));
if (next_is_write[u->val1]) {
/* This write is pointless, so annul it. */
VG_(new_NOP)(u);
} else {
/* Find out what this insn does to the temps. */
k = VG_(get_reg_usage)(u, TempReg, &tempUse[0]);
- vg_assert(k <= 3);
+ sk_assert(k <= 3);
for (j = k-1; j >= 0; j--) {
next_is_write[ tempUse[j].num ]
= tempUse[j].isWrite;
/* Make a tag defined. */
case SETV:
- vg_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
+ sk_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
def[u->val1] = u->size;
break;
/* Check definedness of a tag. */
case TESTV:
- vg_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
+ sk_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
if (def[u->val1] <= 4) {
- vg_assert(def[u->val1] == u->size);
+ sk_assert(def[u->val1] == u->size);
NOP_no_msg(u);
if (dis)
VG_(printf)(" at %2d: delete TESTV on defd arg\n", i);
property through copies. Note that this isn't optional;
we *have* to do this to keep def[] correct. */
case MOV:
- vg_assert(u->tag2 == TempReg);
+ sk_assert(u->tag2 == TempReg);
if (u->tag1 == TempReg) {
if (VGC_IS_SHADOW(u->val1)) {
- vg_assert(VGC_IS_SHADOW(u->val2));
+ sk_assert(VGC_IS_SHADOW(u->val2));
def[u->val2] = def[u->val1];
}
}
break;
case PUTV:
- vg_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
+ sk_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
if (def[u->val1] <= 4) {
- vg_assert(def[u->val1] == u->size);
+ sk_assert(def[u->val1] == u->size);
u->tag1 = Literal;
u->val1 = 0;
switch (u->size) {
case 4: u->lit32 = 0x00000000; break;
case 2: u->lit32 = 0xFFFF0000; break;
case 1: u->lit32 = 0xFFFFFF00; break;
- default: VG_(panic)("vg_cleanup(PUTV)");
+ default: VG_(skin_panic)("vg_cleanup(PUTV)");
}
if (dis)
VG_(printf)(
break;
case STOREV:
- vg_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
+ sk_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
if (def[u->val1] <= 4) {
- vg_assert(def[u->val1] == u->size);
+ sk_assert(def[u->val1] == u->size);
u->tag1 = Literal;
u->val1 = 0;
switch (u->size) {
case 4: u->lit32 = 0x00000000; break;
case 2: u->lit32 = 0xFFFF0000; break;
case 1: u->lit32 = 0xFFFFFF00; break;
- default: VG_(panic)("vg_cleanup(STOREV)");
+ default: VG_(skin_panic)("vg_cleanup(STOREV)");
}
if (dis)
VG_(printf)(
/* Tag handling operations. */
case TAG2:
- vg_assert(u->tag2 == TempReg && VGC_IS_SHADOW(u->val2));
- vg_assert(u->tag3 == Lit16);
+ sk_assert(u->tag2 == TempReg && VGC_IS_SHADOW(u->val2));
+ sk_assert(u->tag3 == Lit16);
/* Ultra-paranoid "type" checking. */
switch (u->val3) {
case Tag_ImproveAND4_TQ: case Tag_ImproveAND2_TQ:
case Tag_ImproveAND1_TQ: case Tag_ImproveOR4_TQ:
case Tag_ImproveOR2_TQ: case Tag_ImproveOR1_TQ:
- vg_assert(u->tag1 == TempReg && !VGC_IS_SHADOW(u->val1));
+ sk_assert(u->tag1 == TempReg && !VGC_IS_SHADOW(u->val1));
break;
default:
- vg_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
+ sk_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
break;
}
switch (u->val3) {
case Tag_UifU0:
sz = 0; goto do_UifU;
do_UifU:
- vg_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
- vg_assert(u->tag2 == TempReg && VGC_IS_SHADOW(u->val2));
+ sk_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
+ sk_assert(u->tag2 == TempReg && VGC_IS_SHADOW(u->val2));
if (def[u->val1] <= 4) {
/* UifU. The first arg is defined, so result is
simply second arg. Delete this operation. */
- vg_assert(def[u->val1] == sz);
+ sk_assert(def[u->val1] == sz);
NOP_no_msg(u);
if (dis)
VG_(printf)(
if (def[u->val2] <= 4) {
/* UifU. The second arg is defined, so result is
simply first arg. Copy to second. */
- vg_assert(def[u->val2] == sz);
+ sk_assert(def[u->val2] == sz);
u->opcode = MOV;
u->size = 4;
u->tag3 = NoValue;
/* Implements Q = T OR Q. So if Q is entirely defined,
ie all 0s, we get MOV T, Q. */
if (def[u->val2] <= 4) {
- vg_assert(def[u->val2] == sz);
+ sk_assert(def[u->val2] == sz);
u->size = 4; /* Regardless of sz */
u->opcode = MOV;
u->tag3 = NoValue;
break;
case TAG1:
- vg_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
+ sk_assert(u->tag1 == TempReg && VGC_IS_SHADOW(u->val1));
if (def[u->val1] > 4) break;
/* We now know that the arg to the op is entirely defined.
If the op changes the size of the arg, we must replace
switch (u->val3) {
/* Maintain the same size ... */
case Tag_Left4:
- vg_assert(def[u->val1] == 4);
+ sk_assert(def[u->val1] == 4);
NOP_tag1_op(u);
break;
case Tag_PCast11:
- vg_assert(def[u->val1] == 1);
+ sk_assert(def[u->val1] == 1);
NOP_tag1_op(u);
break;
/* Change size ... */
case Tag_PCast40:
- vg_assert(def[u->val1] == 4);
+ sk_assert(def[u->val1] == 4);
SETV_tag1_op(u,0);
def[u->val1] = 0;
break;
case Tag_PCast14:
- vg_assert(def[u->val1] == 1);
+ sk_assert(def[u->val1] == 1);
SETV_tag1_op(u,4);
def[u->val1] = 4;
break;
case Tag_PCast12:
- vg_assert(def[u->val1] == 1);
+ sk_assert(def[u->val1] == 1);
SETV_tag1_op(u,2);
def[u->val1] = 2;
break;
case Tag_PCast10:
- vg_assert(def[u->val1] == 1);
+ sk_assert(def[u->val1] == 1);
SETV_tag1_op(u,0);
def[u->val1] = 0;
break;
case Tag_PCast02:
- vg_assert(def[u->val1] == 0);
+ sk_assert(def[u->val1] == 0);
SETV_tag1_op(u,2);
def[u->val1] = 2;
break;
/* We don't know how to handle this uinstr. Be safe, and
set to VGC_VALUE or VGC_UNDEF all temps written by it. */
k = VG_(get_reg_usage)(u, TempReg, &tempUse[0]);
- vg_assert(k <= 3);
+ sk_assert(k <= 3);
for (j = 0; j < k; j++) {
t = tempUse[j].num;
- vg_assert(t >= 0 && t < n_temps);
+ sk_assert(t >= 0 && t < n_temps);
if (!tempUse[j].isWrite) {
/* t is read; ignore it. */
if (0&& VGC_IS_SHADOW(t) && def[t] <= 4)
void SK_(pre_clo_init)(VgNeeds* needs, VgTrackEvents* track)
{
- needs->name = "nulgrind";
- needs->description = "a binary JIT-compiler";
+ needs->name = "nulgrind";
+ needs->description = "a binary JIT-compiler";
+ needs->bug_reports_to = "njn25@cam.ac.uk";
/* No needs, no core events to track */
}