]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Changes made so that skin error "report this bug to" messages are distinguished
authorNicholas Nethercote <njn@valgrind.org>
Wed, 2 Oct 2002 11:08:25 +0000 (11:08 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 2 Oct 2002 11:08:25 +0000 (11:08 +0000)
from core error ones:

  - Split up VG_(panic) into VG_(core_panic) and VG_(skin_panic)

  - Likewise, split vg_assert into vg_assert and sk_assert

  - Added a new need string: `bug_reports_to'

  - Removed VG_(skin_error) which was a previous wussy attempt at this change.
    This removed the need for the hacky redeclaration of VG_(skin_error) in
    vg_profile.c, which is good.

At the moment, Julian and Nick's email addresses are hard-coded into each skin
individually, rather than using a #define in vg_skin.h, because that didn't
feel quite right to me...  jseward@acm.org is still done with a #define for
core errors, though.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1164

37 files changed:
addrcheck/ac_main.c
cachegrind/cg_main.c
cachegrind/cg_sim_gen.c
corecheck/cc_main.c
coregrind/demangle/dyn-string.c
coregrind/vg_clientfuncs.c
coregrind/vg_default.c
coregrind/vg_dispatch.S
coregrind/vg_dummy_profile.c
coregrind/vg_errcontext.c
coregrind/vg_execontext.c
coregrind/vg_from_ucode.c
coregrind/vg_helpers.S
coregrind/vg_include.h
coregrind/vg_instrument.c
coregrind/vg_main.c
coregrind/vg_malloc2.c
coregrind/vg_memory.c
coregrind/vg_mylibc.c
coregrind/vg_scheduler.c
coregrind/vg_signals.c
coregrind/vg_symtab2.c
coregrind/vg_syscalls.c
coregrind/vg_to_ucode.c
coregrind/vg_translate.c
coregrind/vg_transtab.c
example/ex_main.c
helgrind/hg_main.c
include/vg_profile.c
include/vg_skin.h
lackey/lk_main.c
memcheck/mc_clientreqs.c
memcheck/mc_errcontext.c
memcheck/mc_from_ucode.c
memcheck/mc_main.c
memcheck/mc_translate.c
none/nl_main.c

index c47efb86f54525efb5f310b7993ea3ee629816ca..c47b056b2605179fef7ea805b52fc9197df9594f 100644 (file)
@@ -173,7 +173,7 @@ Bool SK_(eq_SkinError) ( VgRes res,
 
       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)");
    }
 }
 
@@ -223,7 +223,7 @@ static void pp_AcAddrInfo ( Addr a, AcAddrInfo* ai )
          break;
       }
       default:
-         VG_(panic)("pp_AcAddrInfo");
+         VG_(skin_panic)("pp_AcAddrInfo");
    }
 }
 
@@ -256,7 +256,7 @@ void SK_(pp_SkinError) ( SkinError* err, void (*pp_ExeContext)(void) )
                                         "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);
@@ -303,7 +303,7 @@ void SK_(pp_SkinError) ( SkinError* err, void (*pp_ExeContext)(void) )
 
       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)");
    }
 }
 
@@ -428,7 +428,7 @@ void SK_(record_param_error) ( ThreadState* tst, Addr a, Bool isWrite,
 {
    AddrCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
    clear_AddrCheckError( &err_extra );
    err_extra.addrinfo.akind = Undescribed;
    err_extra.isWrite = isWrite;
@@ -439,7 +439,7 @@ void SK_(record_jump_error) ( ThreadState* tst, Addr a )
 {
    AddrCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
 
    clear_AddrCheckError( &err_extra );
    err_extra.axskind = ExecAxs;
@@ -451,7 +451,7 @@ void SK_(record_free_error) ( ThreadState* tst, Addr a )
 {
    AddrCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
 
    clear_AddrCheckError( &err_extra );
    err_extra.addrinfo.akind = Undescribed;
@@ -462,7 +462,7 @@ void SK_(record_freemismatch_error) ( ThreadState* tst, Addr a )
 {
    AddrCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
 
    clear_AddrCheckError( &err_extra );
    err_extra.addrinfo.akind = Undescribed;
@@ -473,7 +473,7 @@ void SK_(record_user_error) ( ThreadState* tst, Addr a, Bool isWrite )
 {
    AddrCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
 
    clear_AddrCheckError( &err_extra );
    err_extra.addrinfo.akind = Undescribed;
@@ -542,8 +542,8 @@ extern Bool SK_(error_matches_suppression)(SkinError* err, SkinSupp* su)
       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)");
    }
 }
 
@@ -659,7 +659,7 @@ static void done_prof_mem ( 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);
 
@@ -883,7 +883,7 @@ static AcSecMap* alloc_secondary_map ( __attribute__ ((unused))
    /* 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++)
@@ -934,7 +934,7 @@ static __inline__ UChar get_abits4_ALIGNED ( Addr a )
    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;
@@ -975,10 +975,10 @@ static void set_address_range_perms ( Addr a, UInt len,
       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
@@ -1018,7 +1018,7 @@ static void set_address_range_perms ( Addr a, UInt len,
       VGP_POPCC(VgpSetMem);
       return;
    }
-   vg_assert((a % 8) == 0 && len > 0);
+   sk_assert((a % 8) == 0 && len > 0);
 
    /* Once aligned, go fast. */
    while (True) {
@@ -1036,7 +1036,7 @@ static void set_address_range_perms ( Addr a, UInt len,
       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) {
@@ -1051,7 +1051,7 @@ static void set_address_range_perms ( Addr a, UInt len,
    /* 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);
 }
 
@@ -1170,8 +1170,8 @@ static void make_noaccess_aligned ( Addr a, UInt len )
 
    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) {
@@ -1198,8 +1198,8 @@ static void make_writable_aligned ( Addr a, UInt len )
 
    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) {
@@ -1240,7 +1240,7 @@ void check_is_writable ( CorePart part, ThreadState* tst,
          break;
 
       default:
-         VG_(panic)("check_is_readable: Unknown or unexpected CorePart");
+         VG_(skin_panic)("check_is_readable: Unknown or unexpected CorePart");
       }
    }
 
@@ -1276,7 +1276,7 @@ void check_is_readable ( CorePart part, ThreadState* tst,
          break;
 
       default:
-         VG_(panic)("check_is_readable: Unknown or unexpected CorePart");
+         VG_(skin_panic)("check_is_readable: Unknown or unexpected CorePart");
       }
    }
    VGP_POPCC(VgpCheckMem);
@@ -1292,7 +1292,7 @@ void check_is_readable_asciiz ( CorePart part, ThreadState* tst,
 
    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 );
@@ -1463,7 +1463,7 @@ static void vgmext_ACCESS4_SLOWLY ( Addr a )
       (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;
    }
@@ -1584,7 +1584,7 @@ void SK_(fpu_ACCESS_check) ( Addr addr, Int size )
    }
 
    VG_(printf)("size is %d\n", size);
-   VG_(panic)("fpu_ACCESS_check: unhandled size");
+   VG_(skin_panic)("fpu_ACCESS_check: unhandled size");
 #  endif
 }
 
@@ -1658,7 +1658,7 @@ static __attribute__ ((unused))
    /* 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
@@ -1669,11 +1669,11 @@ static void add_to_freed_queue ( ShadowChunk* sc )
 
    /* 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;
@@ -1685,13 +1685,13 @@ static void add_to_freed_queue ( ShadowChunk* sc )
    
    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;
@@ -1778,7 +1778,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
                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;
@@ -1848,33 +1848,33 @@ UInt VG_(scan_all_valid_memory) ( void (*notify_word)( Addr, UInt ) )
    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;
 
@@ -1909,13 +1909,13 @@ UInt VG_(scan_all_valid_memory) ( void (*notify_word)( Addr, UInt ) )
 
    /* 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;
 }
@@ -2005,13 +2005,13 @@ static Int find_shadow_for ( Addr          ptr,
          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;
@@ -2096,8 +2096,8 @@ void vg_detect_memory_leaks_notify_addr ( Addr a, UInt word_at_a )
       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) {
@@ -2129,7 +2129,7 @@ void SK_(detect_memory_leaks) ( void )
    /* 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;
@@ -2143,9 +2143,9 @@ void SK_(detect_memory_leaks) ( void )
    /* 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) );
    }
 
@@ -2235,7 +2235,7 @@ void SK_(detect_memory_leaks) ( void )
             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;
@@ -2332,7 +2332,7 @@ static void uint_to_bits ( UInt x, Char* str )
          str[w++] = ' ';
    }
    str[w++] = 0;
-   vg_assert(w == 36);
+   sk_assert(w == 36);
 }
 
 /* Caution!  Not vthread-safe; looks in VG_(baseBlock), not the thread
@@ -2428,7 +2428,7 @@ void  SK_(post_syscall) ( ThreadId tid, UInt syscallno,
       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!");
    }
 }
 
@@ -2519,6 +2519,7 @@ void SK_(pre_clo_init)(VgNeeds* needs, VgTrackEvents* track)
 {
    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;
index 21d978796c8d86e902bf60a6713a798f42792456..e8de3c47ae7a54245dfd1298bd5a31bdeacbf761 100644 (file)
@@ -451,15 +451,15 @@ static __inline__ BBCC* get_BBCC(Addr bb_orig_addr, UCodeBlock* cb,
    }
    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");
@@ -530,7 +530,7 @@ static Int compute_BBCC_array_size(UCodeBlock* cb)
          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;
@@ -538,19 +538,19 @@ static Int compute_BBCC_array_size(UCodeBlock* cb)
 
          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;
@@ -611,7 +611,7 @@ void log_1I_0D_cache_access_JIFZ(iCC* cc)
            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);
@@ -734,7 +734,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
        * 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:
@@ -807,18 +807,18 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
          /* 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. */
@@ -834,14 +834,14 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
              * 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);
@@ -855,7 +855,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
                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);
                
@@ -872,7 +872,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
                   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);
@@ -888,15 +888,15 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
                   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);
@@ -947,7 +947,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
                                         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);
             }
@@ -971,7 +971,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
    }
 
    /* 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;
@@ -1072,7 +1072,7 @@ Int Intel_cache_info(Int level, cache_t* I1c, cache_t* D1c, cache_t* L2c)
       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, 
@@ -1234,10 +1234,10 @@ Int get_caches_from_CPUID(cache_t* I1c, cache_t* D1c, cache_t* L2c)
    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. */
@@ -1248,14 +1248,14 @@ Int get_caches_from_CPUID(cache_t* I1c, cache_t* D1c, cache_t* L2c)
 
       /* 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;
    }
 
@@ -1466,7 +1466,7 @@ static void fprint_BBCC(Int fd, BBCC* BBCC_node, Char *first_instr_fl,
             break;
 
          default:
-            VG_(panic)("Unknown CC type in fprint_BBCC()\n");
+            VG_(skin_panic)("Unknown CC type in fprint_BBCC()\n");
             break;
       }
       distinct_instrs++;
@@ -1508,7 +1508,7 @@ static void fprint_BBCC(Int fd, BBCC* BBCC_node, Char *first_instr_fl,
    /* 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)
@@ -1812,7 +1812,7 @@ void SK_(discard_basic_block_info) ( Addr a, UInt size )
    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) {
 
@@ -1848,7 +1848,7 @@ void SK_(discard_basic_block_info) ( Addr a, UInt 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;
       }
    }
@@ -1926,6 +1926,7 @@ void SK_(pre_clo_init)(VgNeeds* needs, VgTrackEvents* not_used)
 {
    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;
index a05d1ac5e2423d72ed70394b7fa33121b8ff0251..3d8993cac328dcfa7c4ea5102f8aba53c44494cd 100644 (file)
@@ -199,7 +199,7 @@ miss_treatment:                                                             \
                                                                             \
    } 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;                                                                  \
 }
index 09a89868d5ec4f0937e635c9076172f1671ce63f..44bd66c141165a4e57ebaf8f80787441b27bd3e4 100644 (file)
 
 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 */
 }
index d6130a1c6c55800756e59bc51f094e89f7d1a3b8..ed0f511ba14ee62c4114b38d7e6cfd994e4b6bbb 100644 (file)
@@ -199,7 +199,7 @@ dyn_string_copy (dest, src)
      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)
@@ -270,7 +270,7 @@ dyn_string_insert (dest, pos, src)
   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;
index 559276fe550ad834b05be9dbc5f1f951283819c4..e4d205b83d999a3a18bfd77db7b864941277b379 100644 (file)
@@ -345,22 +345,22 @@ int __posix_memalign ( void **memptr, UInt alignment, UInt size )
 
 
 /* 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
index 2f6d5756038f333d0301273bd7f05e7866a2acd1..4911e3475f990c073a2512dae4a1ad050d481348 100644 (file)
@@ -51,7 +51,7 @@ void fund_panic ( Char* fn )
       "  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))
@@ -62,7 +62,7 @@ void non_fund_panic ( Char* fn )
       "  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");
 }
 
 /* ---------------------------------------------------------------------
index 7cdb2099f8d48eb4fe2080db5385169ed31211e5..ddb8819dad0cf901ef612bd0735b7a3a093bc991 100644 (file)
@@ -187,7 +187,7 @@ dispatch_exceptional:
 
        /* ebp has an invalid value ... crap out. */
        pushl   $panic_msg_ebp
-       call    VG_(panic)
+       call    VG_(core_panic)
        /* (never returns) */
 
 dispatch_syscall:
index 2f869c9359ac2a31d162bf8d12d6d3e3c0aed3f8..3620ff8175e1313f9653f7f210fb28b55f46edf7 100644 (file)
@@ -49,17 +49,17 @@ void VGP_(init_profiling) ( void )
 
 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");
 }
 
 /*--------------------------------------------------------------------*/
index 9da03fc4b0d1583405d5c87ab4b0fb773da3a6b5..198dd785fe006a567aa30e6b072bde1d34938737 100644 (file)
@@ -81,7 +81,7 @@ static Bool eq_CoreError ( VgRes res, CoreError* e1, CoreError* e2 )
             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");
          }
    }
 }
@@ -113,7 +113,7 @@ static void pp_CoreError ( CoreError* err, Bool printCount )
             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");
          }
    }
 }
@@ -410,7 +410,7 @@ void VG_(show_all_errors) ( void )
             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:",
@@ -684,7 +684,7 @@ Bool supp_matches_error(CoreSupp* su, CoreError* err)
                "\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");
          }
    }
 }
@@ -703,7 +703,7 @@ Bool supp_matches_callers(CoreSupp* su, Char caller_obj[][M_VG_ERRTXT],
          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");
       }
    }
 
index 24939c5a4b1328c052437265b76f4f7a65984ab4..e1a0ff1f7cf27e4a11fd5838df73980555fdce74 100644 (file)
@@ -140,7 +140,7 @@ Bool VG_(eq_ExeContext) ( VgRes res, ExeContext* e1, ExeContext* e2 )
       return True;
 
    default:
-      VG_(panic)("VG_(eq_ExeContext): unrecognised VgRes");
+      VG_(core_panic)("VG_(eq_ExeContext): unrecognised VgRes");
    }
 }
 
index 91ba029bd9b50e96003b1134650a5318da5b4ff5..23e804cf1bad59e8d4bd77e322da2ddc52d939df 100644 (file)
@@ -218,7 +218,7 @@ static __inline__ UChar mkSIB ( Int scale, Int regindex, Int regbase )
       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);
 }
@@ -234,7 +234,7 @@ static __inline__ void emit_amode_regmem_reg ( Int regmem, Int reg )
 {
    /* (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 );
@@ -246,7 +246,7 @@ static __inline__ void emit_amode_regmem_reg ( Int regmem, Int reg )
 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 */
@@ -263,7 +263,7 @@ static __inline__ void emit_amode_sib_reg ( Int off, Int scale, Int regbase,
                                             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 */
@@ -304,7 +304,7 @@ static __inline__ Int mkGrp1opcode ( Opcode opc )
       case AND: return 4;
       case SUB: return 5;
       case XOR: return 6;
-      default: VG_(panic)("mkGrp1opcode");
+      default: VG_(core_panic)("mkGrp1opcode");
    }
 }
 
@@ -318,7 +318,7 @@ static __inline__ Int mkGrp2opcode ( Opcode opc )
       case SHL: return 4;
       case SHR: return 5;
       case SAR: return 7;
-      default: VG_(panic)("mkGrp2opcode");
+      default: VG_(core_panic)("mkGrp2opcode");
    }
 }
 
@@ -327,7 +327,7 @@ static __inline__ Int mkGrp3opcode ( Opcode opc )
    switch (opc) {
       case NOT: return 2;
       case NEG: return 3;
-      default: VG_(panic)("mkGrp3opcode");
+      default: VG_(core_panic)("mkGrp3opcode");
    }
 }
 
@@ -336,7 +336,7 @@ static __inline__ Int mkGrp4opcode ( Opcode opc )
    switch (opc) {
       case INC: return 0;
       case DEC: return 1;
-      default: VG_(panic)("mkGrp4opcode");
+      default: VG_(core_panic)("mkGrp4opcode");
    }
 }
 
@@ -345,7 +345,7 @@ static __inline__ Int mkGrp5opcode ( Opcode opc )
    switch (opc) {
       case CALLM: return 2;
       case JMP:   return 4;
-      default: VG_(panic)("mkGrp5opcode");
+      default: VG_(core_panic)("mkGrp5opcode");
    }
 }
 
@@ -359,7 +359,7 @@ static __inline__ UChar mkPrimaryOpcode ( Opcode opc )
       case OR:  return 0x08;
       case SBB: return 0x18;
       case SUB: return 0x28;
-      default: VG_(panic)("mkPrimaryOpcode");
+      default: VG_(core_panic)("mkPrimaryOpcode");
   }
 }
 
@@ -560,7 +560,7 @@ void VG_(emit_unaryopv_reg) ( Int sz, Opcode opc, Int reg )
                          nameISize(sz), nameIReg(sz,reg));
          break;
       default: 
-         VG_(panic)("VG_(emit_unaryopv_reg)");
+         VG_(core_panic)("VG_(emit_unaryopv_reg)");
    }
 }
 
@@ -794,7 +794,7 @@ void VG_(emit_unaryopb_reg) ( Opcode opc, Int 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)");
    }
 }
 
@@ -947,7 +947,7 @@ static void emit_addlit8_offregmem ( Int lit8, Int regmem, Int off )
 
 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 );
@@ -1122,7 +1122,7 @@ Int VG_(helper_offset)(Addr a)
       VG_(printf)("%p ", VG_(noncompact_helper_addrs)[i]);
 
    VG_(printf)("\n");
-   VG_(skin_error)("Unfound helper");
+   VG_(skin_panic)("Unfound helper");
 }
 
 /*----------------------------------------------------*/
@@ -1165,7 +1165,7 @@ static void maybe_emit_movl_litOrReg_reg ( UInt litOrReg, Tag tag, UInt reg )
       ccall_arg_setup_instrs++;
    }
    else
-      VG_(panic)("emit_movl_litOrReg_reg: unexpected tag");
+      VG_(core_panic)("emit_movl_litOrReg_reg: unexpected tag");
 }
 
 static
@@ -1225,7 +1225,7 @@ void emit_three_regs_args_setup ( UInt src1, UInt src2, UInt src3,
          emit_swapl_arg_regs ( dst1, dst2 );
 
       } else {
-         VG_(panic)("impossible 3-cycle");
+         VG_(core_panic)("impossible 3-cycle");
       }
    }
 }
@@ -1321,7 +1321,7 @@ void VG_(synth_ccall) ( Addr fn, Int argc, Int regparms_n, UInt argv[],
          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++;
@@ -1353,7 +1353,7 @@ void VG_(synth_ccall) ( Addr fn, Int argc, Int regparms_n, UInt argv[],
       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 */
@@ -1396,7 +1396,7 @@ static void load_ebp_from_JmpKind ( JmpKind jmpkind )
          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");
    }
 }
 
@@ -1471,7 +1471,7 @@ static void synth_mov_regmem_reg ( Int size, Int reg1, Int reg2 )
       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");
    }  
 }
 
@@ -1482,7 +1482,7 @@ static void synth_mov_offregmem_reg ( Int size, Int off, Int areg, Int 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");
    }  
 }
 
@@ -1502,7 +1502,7 @@ static void synth_mov_reg_offregmem ( Int size, Int reg,
                  VG_(emit_swapl_reg_EAX) ( reg );
               }
               break;
-      default: VG_(panic)("synth_mov_reg_offregmem");
+      default: VG_(core_panic)("synth_mov_reg_offregmem");
    }
 }
 
@@ -1524,7 +1524,7 @@ static void synth_mov_reg_memreg ( Int size, Int reg1, Int reg2 )
                  emit_swapl_reg_reg ( s1, reg1 );
               }
               break;
-      default: VG_(panic)("synth_mov_reg_litmem");
+      default: VG_(core_panic)("synth_mov_reg_litmem");
    }
 }
 
@@ -1555,7 +1555,7 @@ static void synth_unaryop_reg ( Bool wr_cc,
                  VG_(emit_swapl_reg_EAX) ( reg );
               }
               break;
-      default: VG_(panic)("synth_unaryop_reg");
+      default: VG_(core_panic)("synth_unaryop_reg");
    }
 }
 
@@ -1623,9 +1623,9 @@ static void synth_nonshiftop_reg_reg ( Bool rd_cc, Bool wr_cc,
             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");
    }
 }
 
@@ -1660,7 +1660,7 @@ static void synth_nonshiftop_offregmem_reg (
          }
          break;
       default: 
-         VG_(panic)("synth_nonshiftop_offregmem_reg");
+         VG_(core_panic)("synth_nonshiftop_offregmem_reg");
    }
 }
 
@@ -1690,7 +1690,7 @@ static void synth_nonshiftop_lit_reg ( Bool rd_cc, Bool wr_cc,
                  VG_(emit_swapl_reg_EAX) ( reg );
               }
               break;
-      default: VG_(panic)("synth_nonshiftop_lit_reg");
+      default: VG_(core_panic)("synth_nonshiftop_lit_reg");
    }
 }
 
@@ -1714,7 +1714,7 @@ static void synth_push_reg ( Int size, Int reg )
          if (reg != R_EAX) VG_(emit_swapl_reg_EAX) ( reg );
          break;
      default: 
-         VG_(panic)("synth_push_reg");
+         VG_(core_panic)("synth_push_reg");
    }
 }
 
@@ -1736,7 +1736,7 @@ static void synth_pop_reg ( Int size, Int 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");
    }
 }
 
@@ -1752,7 +1752,7 @@ static void synth_shiftop_reg_reg ( Bool rd_cc, Bool wr_cc,
       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 );
@@ -1785,7 +1785,7 @@ static void synth_shiftop_lit_reg ( Bool rd_cc, Bool wr_cc,
                  VG_(emit_swapl_reg_EAX) ( reg );
               }
               break;
-      default: VG_(panic)("synth_shiftop_lit_reg");
+      default: VG_(core_panic)("synth_shiftop_lit_reg");
    }
 }
 
@@ -1869,7 +1869,7 @@ static Int spillOrArchOffset ( Int size, Tag tag, UInt value )
                      else return 4 * VGOFF_(m_edi);
       }
    }
-   VG_(panic)("spillOrArchOffset");
+   VG_(core_panic)("spillOrArchOffset");
 }
 
 static Int eflagsOffset ( void )
@@ -1886,7 +1886,7 @@ static Int segRegOffset ( UInt archregs )
       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");
    }
 }
 
@@ -1904,7 +1904,7 @@ Int VG_(shadow_reg_offset) ( Int arch )
       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");
    }
 }
 
@@ -1930,7 +1930,7 @@ static void synth_WIDEN_signed ( Int sz_src, Int sz_dst, Int reg )
       VG_(emit_shiftopv_lit_reg) ( 2, SAR, 8, reg );
    }
    else
-      VG_(panic)("synth_WIDEN");
+      VG_(core_panic)("synth_WIDEN");
 }
 
 
@@ -2191,7 +2191,7 @@ static void emitUInstr ( UCodeBlock* cb, Int i, RRegSet regs_live_before )
                           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;
       }
@@ -2241,7 +2241,7 @@ static void emitUInstr ( UCodeBlock* cb, Int i, RRegSet regs_live_before )
                              R_EBP,
                              u->val2 );
                           break;
-            default: VG_(panic)("emitUInstr:non-shift-op");
+            default: VG_(core_panic)("emitUInstr:non-shift-op");
          }
          break;
       }
@@ -2265,7 +2265,7 @@ static void emitUInstr ( UCodeBlock* cb, Int i, RRegSet regs_live_before )
                              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;
       }
@@ -2307,20 +2307,20 @@ static void emitUInstr ( UCodeBlock* cb, Int i, RRegSet regs_live_before )
                   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;
             }
          }
@@ -2421,7 +2421,7 @@ static void emitUInstr ( UCodeBlock* cb, Int i, RRegSet regs_live_before )
                         " 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");
          }
    }
 
index 2315da4221158317d9dc0ceb33d6fe71967d4807..1511bc13c7c8b5570a53f885d9853b477cce9e04 100644 (file)
@@ -58,7 +58,7 @@ VG_(signalreturn_bogusRA):
        roll $19, %eax
        # should never get here
        pushl   $signalreturn_bogusRA_panic_msg
-       call    VG_(panic)
+       call    VG_(core_panic)
        
 .data
 signalreturn_bogusRA_panic_msg:
index eccd05afa3af436e885f100336cb88162c8d18ad..d0c8f08356c381bc44cd68bc954b8f7d2eac16c6 100644 (file)
@@ -798,9 +798,16 @@ extern void VG_(restore_all_host_signals)
    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 );
index 9f787ebd2aa23f3a963fdf413ec1e7315ad4483a..dd870ec1812bdd2751a7ed8714cd0d49df6663c5 100644 (file)
@@ -56,7 +56,7 @@ void VG_(call_helper_1_0)(UCodeBlock* cb, Addr f, UInt arg1, UInt regparms_n)
 {
    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);
@@ -69,7 +69,7 @@ void VG_(call_helper_2_0)(UCodeBlock* cb, Addr f, UInt arg1, UInt arg2,
    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);
index 665dcfba53735eb9212da08b62eddf6882209b77..99c17e307270cf060ada2ee9ccdb1b6fedd43b1a 100644 (file)
@@ -126,7 +126,7 @@ static Int alloc_BaB ( Int words )
    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;   
 }
@@ -147,7 +147,7 @@ void VG_(register_compact_helper)(Addr a)
    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)++;
@@ -162,7 +162,7 @@ void VG_(register_noncompact_helper)(Addr a)
       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)++;
@@ -441,6 +441,7 @@ UInt VG_(num_scheduling_events_MAJOR) = 0;
 VgNeeds VG_(needs) = {
    .name                    = NULL,
    .description             = NULL,
+   .bug_reports_to          = NULL,
 
    .core_errors             = False,
    .skin_errors             = False,
@@ -496,14 +497,16 @@ VgTrackEvents VG_(track_events) = {
 
 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
@@ -1319,13 +1322,13 @@ void VG_(main) ( void )
             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: 
@@ -1345,7 +1348,7 @@ void VG_(main) ( void )
          VG_(switch_to_real_CPU)();
 
       default:
-         VG_(panic)("vg_main(): unexpected scheduler return code");
+         VG_(core_panic)("vg_main(): unexpected scheduler return code");
    }
 }
 
@@ -1460,7 +1463,7 @@ void VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) ( Char* ld_preload_str,
       "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");
 }
 
 
index 92358c187e20891b75a510a760abf342050b41c9..ffe7159e4e6a74811d16e870e0f5c402f96656db 100644 (file)
@@ -262,7 +262,7 @@ Superblock* findSb ( Arena* a, UInt* ch )
          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*/
 }
 
@@ -710,7 +710,7 @@ static void mallocSanityCheckArena ( ArenaId aid )
    UInt        arena_bytes_on_loan;
    Arena*      a;
 
-#  define BOMB VG_(panic)("mallocSanityCheckArena")
+#  define BOMB VG_(core_panic)("mallocSanityCheckArena")
 
    a = arenaId_to_ArenaP(aid);
    
@@ -1105,7 +1105,7 @@ void* VG_(arena_malloc_aligned) ( ArenaId aid, Int req_alignB, Int req_pszB )
       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*/
    }
 
index 8966d39ce767c0f564ac6442914c96c197fe2173..85d06882d6926bcfd505cef9d57a3202942cdb89 100644 (file)
@@ -175,7 +175,7 @@ void startup_segment_callback ( Addr start, UInt size,
             "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");
       }
    }
 
@@ -187,7 +187,7 @@ void startup_segment_callback ( Addr start, UInt size,
 
    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 */
index ac75b5a2502fed26ecbdaee92f15743d9a361d8b..7eab2f7b708c6872cc1d4bfc7b218dd2a243262b 100644 (file)
@@ -984,38 +984,56 @@ Bool VG_(string_match) ( Char* pat, Char* str )
    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.
@@ -1206,7 +1224,7 @@ void VG_(end_rdtsc_calibration) ( void )
       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. */
@@ -1245,7 +1263,7 @@ void VG_(end_rdtsc_calibration) ( void )
       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);
index e6b8eeaf414e5abe6f9ffcfeeb99f9727c20eee7..70ef7d65546b92fe25b7080a3c6adcbfb4983935 100644 (file)
@@ -263,7 +263,7 @@ void add_waiting_fd ( ThreadId tid, Int fd, Int syscall_no, void* pre_res )
          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);
@@ -357,7 +357,7 @@ ThreadId vg_alloc_ThreadState ( void )
    }
    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*/
 }
 
@@ -661,7 +661,7 @@ void VG_(scheduler_init) ( void )
          (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++) {
@@ -828,7 +828,7 @@ void handle_signal_return ( ThreadId tid )
    }
 
    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. */
@@ -1055,7 +1055,7 @@ void poll_for_ready_fds ( void )
          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;
       }
@@ -1073,7 +1073,7 @@ void poll_for_ready_fds ( void )
                 ( 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*/
    }
    
@@ -1105,7 +1105,7 @@ void poll_for_ready_fds ( void )
          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
@@ -1425,7 +1425,7 @@ VgSchedReturnCode VG_(scheduler) ( void )
                   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 */
          }
@@ -1585,8 +1585,8 @@ VgSchedReturnCode VG_(scheduler) ( void )
 
          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;
 
@@ -1599,7 +1599,7 @@ VgSchedReturnCode VG_(scheduler) ( void )
 
 
    /* NOTREACHED */
-   VG_(panic)("scheduler: post-main-loop ?!");
+   VG_(core_panic)("scheduler: post-main-loop ?!");
    /* NOTREACHED */
 
   debug_stop:
@@ -1790,7 +1790,7 @@ void do__cleanup_push ( ThreadId tid, CleanupEntry* cu )
    }
    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++;
@@ -1880,7 +1880,7 @@ void do__set_cancelstate ( ThreadId tid, Int state )
    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);
@@ -1907,7 +1907,7 @@ void do__set_canceltype ( ThreadId tid, Int type )
    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);
@@ -1965,7 +1965,7 @@ void do__set_or_get_detach ( ThreadId tid,
          SET_EDX(tid, 0);
          return;
       default:
-         VG_(panic)("do__set_or_get_detach");
+         VG_(core_panic)("do__set_or_get_detach");
    }
 }
 
@@ -2123,7 +2123,7 @@ void do__quit ( ThreadId tid )
 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
@@ -2814,8 +2814,8 @@ void do_pthread_key_create ( ThreadId tid,
       /* 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;
@@ -3440,7 +3440,7 @@ void do_client_request ( ThreadId tid )
                         "  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;
index 1b30c7c5fc7d39f3d6ff65b77bce67092e7964b9..90726c066809a79af89cab552969cafe718b62d0 100644 (file)
@@ -631,7 +631,7 @@ void do_sigprocmask_bitops ( Int vki_how,
          *orig_set = *modifier;
          break;
       default:
-         VG_(panic)("do_sigprocmask_bitops");
+         VG_(core_panic)("do_sigprocmask_bitops");
         break;
    }
 }
@@ -1353,7 +1353,7 @@ void vg_oursignalhandler ( Int sigNo )
       }
       /* 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. */
 
@@ -1486,7 +1486,7 @@ void VG_(sigstartup_actions) ( void )
    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)) {
index 66e397f272ecca8f0952b653d55fbbf2354519cc..eaa7223c1f7e7e1abc78b1033dfd2ffc5286d2df 100644 (file)
@@ -780,13 +780,13 @@ void read_debuginfo_stabs ( SegInfo* si,
                      } 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;
                }
index 825baa164db9c29c3d00fc52aec217059e499c13..1735b60887a2f2cf3a4496780dae0321225beb0a 100644 (file)
@@ -405,7 +405,7 @@ void VG_(init_dataseg_end_for_brk) ( void )
 {
    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);
 }
@@ -463,7 +463,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
    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:
@@ -1623,7 +1623,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
                VG_(message)(Vg_DebugMsg,
                             "FATAL: unhandled syscall(ipc) %d",
                             arg1 );
-               VG_(panic)("... bye!\n");
+               VG_(core_panic)("... bye!\n");
                break; /*NOTREACHED*/
          }
          }
@@ -2340,7 +2340,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
                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;
@@ -2768,7 +2768,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
 
             default:
                VG_(message)(Vg_DebugMsg,"FATAL: unhandled socketcall 0x%x",arg1);
-               VG_(panic)("... bye!\n");
+               VG_(core_panic)("... bye!\n");
                break; /*NOTREACHED*/
          }
          break;
@@ -3102,7 +3102,7 @@ void* VG_(pre_known_blocking_syscall) ( ThreadId tid, Int syscallno )
 
       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;
    }
@@ -3162,7 +3162,7 @@ void VG_(post_known_blocking_syscall) ( ThreadId tid,
       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;
    }
index 56c1ad45edadf99d1b27db9868cb25ca613ac3f3..7250a4d2f860ff6ad7450d212e2176b62e4de02c 100644 (file)
@@ -78,7 +78,7 @@ static Char* nameGrp1 ( Int opc_aux )
 {
    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];
 }
 
@@ -86,7 +86,7 @@ static Char* nameGrp2 ( Int 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];
 }
 
@@ -94,7 +94,7 @@ static Char* nameGrp4 ( Int 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];
 }
 
@@ -102,7 +102,7 @@ static Char* nameGrp5 ( Int 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];
 }
 
@@ -110,7 +110,7 @@ static Char* nameGrp8 ( Int 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];
 }
 
@@ -130,7 +130,7 @@ Char* VG_(name_of_int_reg) ( Int size, Int reg )
       case 1: return ireg8_names[reg];
    }
   bad:
-   VG_(panic)("name_of_int_reg");
+   VG_(core_panic)("name_of_int_reg");
    return NULL; /*notreached*/
 }
 
@@ -143,7 +143,7 @@ Char* VG_(name_of_seg_reg) ( Int sreg )
       case R_DS: return "%ds";
       case R_FS: return "%fs";
       case R_GS: return "%gs";
-      default: VG_(panic)("nameOfSegReg");
+      default: VG_(core_panic)("nameOfSegReg");
    }
 }
 
@@ -153,7 +153,7 @@ Char VG_(name_of_int_size) ( Int size )
       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");
    }
 }
 
@@ -225,7 +225,7 @@ __inline__ static UInt getUDisp ( Int size, Addr eip )
       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*/
 }
@@ -236,7 +236,7 @@ __inline__ static UInt getSDisp ( Int size, Addr eip )
       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*/
 }
@@ -281,7 +281,7 @@ static void setFlagsFromUOpcode ( UCodeBlock* cb, Int uopc )
       default: 
          VG_(printf)("unhandled case is %s\n", 
                      VG_(name_UOpcode)(True, uopc));
-         VG_(panic)("setFlagsFromUOpcode: unhandled case");
+         VG_(core_panic)("setFlagsFromUOpcode: unhandled case");
    }
 }
 
@@ -304,7 +304,7 @@ UChar* sorbTxt ( UChar sorb )
       case 0x26: return "%es:";
       case 0x64: return "%fs:";
       case 0x65: return "%gs:";
-      default: VG_(panic)("sorbTxt");
+      default: VG_(core_panic)("sorbTxt");
    }
 }
 
@@ -326,7 +326,7 @@ void handleSegOverride ( UCodeBlock* cb, UChar sorb, Int tmp )
       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);
@@ -412,7 +412,7 @@ UInt disAMode ( UCodeBlock* cb, UChar sorb, Addr eip0, UChar* buf )
       /* 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 
@@ -590,7 +590,7 @@ UInt disAMode ( UCodeBlock* cb, UChar sorb, Addr eip0, UChar* buf )
       }
 
       default:
-         VG_(panic)("disAMode");
+         VG_(core_panic)("disAMode");
          return 0; /*notreached*/
    }
 }
@@ -649,7 +649,7 @@ static UInt lengthAMode ( Addr eip0 )
       case 0x14: return 6;
 
       default:
-         VG_(panic)("amode_from_RM");
+         VG_(core_panic)("amode_from_RM");
          return 0; /*notreached*/
    }
 }
@@ -1084,7 +1084,7 @@ void codegen_div ( UCodeBlock* cb, Int sz, Int t, Bool signed_divide )
       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) {
@@ -1137,7 +1137,7 @@ Addr dis_Grp1 ( UCodeBlock* 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(Reg): unhandled case");
+         default: VG_(core_panic)("dis_Grp1(Reg): unhandled case");
       }
       if (uopc == AND || uopc == OR) {
          Int tao = newTemp(cb);
@@ -1169,7 +1169,7 @@ Addr dis_Grp1 ( UCodeBlock* 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);
@@ -1229,7 +1229,7 @@ Addr dis_Grp2 ( UCodeBlock* 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);
@@ -1263,7 +1263,7 @@ Addr dis_Grp2 ( UCodeBlock* 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, t2);
@@ -1338,7 +1338,7 @@ Addr dis_Grp8_BT ( UCodeBlock* cb,
    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. */
@@ -1352,7 +1352,7 @@ Addr dis_Grp8_BT ( UCodeBlock* cb,
             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)
@@ -1561,7 +1561,7 @@ Addr dis_Grp3 ( UCodeBlock* cb,
          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 );
@@ -1616,7 +1616,7 @@ Addr dis_Grp3 ( UCodeBlock* cb,
          default: 
             VG_(printf)(
                "unhandled Grp3(M) case %d\n", (UInt)gregOfRM(modrm));
-            VG_(panic)("Grp3");
+            VG_(core_panic)("Grp3");
       }
    }
    return eip;
@@ -1653,7 +1653,7 @@ Addr dis_Grp4 ( UCodeBlock* cb,
          default: 
             VG_(printf)(
                "unhandled Grp4(R) case %d\n", (UInt)gregOfRM(modrm));
-            VG_(panic)("Grp4");
+            VG_(core_panic)("Grp4");
       }
       eip++;
       if (dis)
@@ -1678,7 +1678,7 @@ Addr dis_Grp4 ( UCodeBlock* cb,
          default: 
             VG_(printf)(
                "unhandled Grp4(M) case %d\n", (UInt)gregOfRM(modrm));
-            VG_(panic)("Grp4");
+            VG_(core_panic)("Grp4");
       }
       eip += HI8(pair);
       if (dis)
@@ -1737,7 +1737,7 @@ Addr dis_Grp5 ( UCodeBlock* cb,
          default: 
             VG_(printf)(
                "unhandled Grp5(R) case %d\n", (UInt)gregOfRM(modrm));
-            VG_(panic)("Grp5");
+            VG_(core_panic)("Grp5");
       }
       eip++;
       if (dis)
@@ -1789,7 +1789,7 @@ Addr dis_Grp5 ( UCodeBlock* cb,
          default: 
             VG_(printf)(
                "unhandled Grp5(M) case %d\n", (UInt)gregOfRM(modrm));
-            VG_(panic)("Grp5");
+            VG_(core_panic)("Grp5");
       }
       eip += HI8(pair);
       if (dis)
@@ -2212,7 +2212,7 @@ Addr dis_mul_E_G ( UCodeBlock* cb,
       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);
@@ -2274,7 +2274,7 @@ Addr dis_imul_I_E_G ( UCodeBlock* cb,
       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);
@@ -2591,7 +2591,7 @@ Addr dis_fpu ( UCodeBlock* cb,
    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");
 }
 
 
@@ -2689,7 +2689,7 @@ static Char* nameBtOp ( BtOp op )
       case BtOpSet:   return "s";
       case BtOpReset: return "r";
       case BtOpComp:  return "c";
-      default: VG_(panic)("nameBtOp");
+      default: VG_(core_panic)("nameBtOp");
    }
 }
 
@@ -2786,7 +2786,7 @@ Addr dis_bt_G_E ( UCodeBlock* cb,
             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);
    }
@@ -3491,7 +3491,7 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
 
    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. */
@@ -3623,7 +3623,7 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
    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. */
@@ -4210,7 +4210,7 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
       }
       else {
          VG_(printf)("REPNE then 0x%x\n", (UInt)abyte);
-         VG_(panic)("Unhandled REPNE case");
+         VG_(core_panic)("Unhandled REPNE case");
       }
       break;
    }
@@ -4246,7 +4246,7 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
          /* 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;
    }
@@ -4692,7 +4692,7 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
    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)
index de6ac139413696c4fdc69383c3e9ac990f7158b3..a6d902844cf8c8e69b3e298e745404753572a53b 100644 (file)
@@ -280,7 +280,7 @@ Int VG_(rank_to_realreg) ( Int rank )
       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)");
    }
 }
 
@@ -306,7 +306,7 @@ Int VG_(realreg_to_rank) ( Int 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)");
    }
 }
 
@@ -536,7 +536,7 @@ Bool VG_(saneUInstr) ( Bool beforeRA, Bool beforeLiveness, UInstr* u )
          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
@@ -718,7 +718,7 @@ Char* VG_(nameCondcode) ( Condcode cond )
       case CondLE:     return "le";
       case CondNLE:    return "nle";
       case CondAlways: return "MP"; /* hack! */
-      default: VG_(panic)("nameCondcode");
+      default: VG_(core_panic)("nameCondcode");
    }
 }
 
@@ -752,7 +752,7 @@ void VG_(pp_UOperand) ( UInstr* u, Int operandNo, Int sz, Bool parens )
       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;
 
@@ -766,7 +766,7 @@ void VG_(pp_UOperand) ( UInstr* u, Int operandNo, Int sz, Bool parens )
       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)(")");
 }
@@ -796,7 +796,7 @@ Char* VG_(name_UOpcode) ( Bool upper, Opcode opc )
       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";
@@ -834,7 +834,7 @@ Char* VG_(name_UOpcode) ( Bool upper, Opcode opc )
             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");
          }
    }
 }
@@ -1031,7 +1031,7 @@ void pp_UInstrWorker ( Int instrNo, UInstr* u, Bool ppRegsLiveness )
             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) {
@@ -1150,7 +1150,7 @@ Int VG_(get_reg_usage) ( UInstr* u, Tag tag, RegUse* arr )
             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;
@@ -1169,21 +1169,21 @@ void patchUInstr ( UInstr* u, RegUse temps[], UInt reals[], Int n_tmap )
    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];
    }
@@ -1201,7 +1201,7 @@ Int containingArchRegOf ( Int sz, Int aregno )
       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");
    }
 }
 
@@ -1249,7 +1249,7 @@ Int maybe_uinstrReadsArchReg ( UInstr* u )
 
       default: 
          VG_(pp_UInstr)(0,u);
-         VG_(panic)("maybe_uinstrReadsArchReg: unhandled opcode");
+         VG_(core_panic)("maybe_uinstrReadsArchReg: unhandled opcode");
    }
 }
 
@@ -1704,7 +1704,7 @@ UCodeBlock* vg_do_register_allocation ( UCodeBlock* c1 )
             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;
@@ -1880,7 +1880,7 @@ UCodeBlock* vg_do_register_allocation ( UCodeBlock* c1 )
 
          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. */
index 09e8fa23c61d6c9d69c022604d3eda20cc4eff1a..d3274297d4527460e7df62b8e12f8e00da7c96bf 100644 (file)
@@ -370,7 +370,7 @@ extern void VG_(add_to_trans_tab) ( TTEntry* tte )
    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;
@@ -393,7 +393,7 @@ Addr VG_(copy_to_transcache) ( Addr trans_addr, Int trans_size )
    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];
index a9d51fd0517116f65b899a9784bab4c27a3615b9..e22405b580e69113c403ff101a4db9406e8dfe70 100644 (file)
@@ -7,8 +7,9 @@
 
 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)
index 9cd25cabe595dbbdc05b2ab217061e3903da2a28..efe6fae7275306fe7720813fdce7a80aaecfb287 100644 (file)
@@ -87,7 +87,7 @@ void VGE_(done_prof_mem) ( 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);
 
@@ -201,7 +201,7 @@ ESecMap* alloc_secondary_map ( __attribute__ ((unused)) Char* caller )
    /* 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++)
@@ -223,13 +223,13 @@ void set_sword ( Addr a, shadow_word sword )
 
    /* 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!");
    }
 }
 
@@ -244,7 +244,7 @@ shadow_word* get_sword_addr ( Addr a )
    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;
    }
 
@@ -271,7 +271,7 @@ void make_writable_aligned ( Addr a, UInt size )
    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);
@@ -298,7 +298,7 @@ void init_magically_inited_sword(Addr a)
 {
    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);
@@ -341,7 +341,7 @@ static
 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
@@ -465,7 +465,7 @@ void sanity_check_locksets ( Char* caller )
                "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 */
 
@@ -482,7 +482,7 @@ UInt remove ( UInt ia, pthread_mutex_t* mx )
    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);
@@ -513,7 +513,7 @@ UInt remove ( UInt ia, pthread_mutex_t* 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) {
@@ -613,7 +613,7 @@ static UInt intersect(UInt ia, UInt ib)
          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;
    }
@@ -631,7 +631,7 @@ static UInt intersect(UInt ia, UInt ib)
    }
 
    /* 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");
@@ -703,14 +703,14 @@ void set_address_range_state ( Addr a, UInt len /* in bytes */,
    
    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);
 }
 
@@ -893,7 +893,7 @@ UCodeBlock* SK_(instrument) ( UCodeBlock* cb_in, Addr not_used )
             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...
@@ -908,7 +908,7 @@ UCodeBlock* SK_(instrument) ( UCodeBlock* cb_in, Addr not_used )
             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);
@@ -957,7 +957,7 @@ static void record_eraser_error ( ThreadId tid, Addr a, Bool is_write )
 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;
@@ -966,7 +966,7 @@ Bool SK_(eq_SkinError) ( VgRes not_used,
 
 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();
@@ -1001,8 +1001,8 @@ Bool SK_(read_extra_suppression_info) ( Int fd, Char* buf,
 
 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;
 }
 
@@ -1021,7 +1021,7 @@ static void eraser_post_mutex_lock(ThreadId tid, void* void_mutex)
    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
@@ -1030,7 +1030,7 @@ static void eraser_post_mutex_lock(ThreadId tid, void* void_mutex)
 
    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) {
@@ -1063,7 +1063,7 @@ static void eraser_post_mutex_lock(ThreadId tid, void* void_mutex)
          (*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
@@ -1264,7 +1264,7 @@ static void eraser_mem_read(Addr a, UInt size)
          break;
 
       default:
-         VG_(panic)("Unknown eraser state");
+         VG_(skin_panic)("Unknown eraser state");
       }
    }
 }
@@ -1326,7 +1326,7 @@ static void eraser_mem_write(Addr a, UInt size)
          break;
 
       default:
-         VG_(panic)("Unknown eraser state");
+         VG_(skin_panic)("Unknown eraser state");
       }
    }
 }
@@ -1344,6 +1344,7 @@ void SK_(pre_clo_init)(VgNeeds* needs, VgTrackEvents* track)
 
    needs->name                    = "helgrind";
    needs->description             = "a data race detector";
+   needs->description             = "njn25@cam.ac.uk";
 
    needs->core_errors             = True;
    needs->skin_errors             = True;
index dc5f0c0e162d809c3210ddfe1f7cc8e6a7ba114d..31bad9991dbdbc240adce64000a79ccfc234b6fb 100644 (file)
 #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;
@@ -76,14 +71,14 @@ void VGP_(register_profile_event) ( Int n, Char* name )
                   "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;
@@ -120,7 +115,7 @@ void VGP_(init_profiling) ( void )
 
    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 )
@@ -146,7 +141,7 @@ void VGP_(pushcc) ( UInt cc )
          "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;
@@ -159,7 +154,7 @@ void VGP_(popcc) ( UInt 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;
index 4b51cbbdab79fdd63759ea67169ae0844b5ca571..ff589f1c83881a79e26e66017335f42af217afda 100644 (file)
@@ -296,9 +296,10 @@ extern void  VG_(print_malloc_stats) ( void );
 
 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 );
@@ -369,15 +370,15 @@ extern Int  VG_(stat)  ( Char* file_name, struct vki_stat* buf );
 /* 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 );
 
 
 /* ------------------------------------------------------------------ */
@@ -1110,11 +1111,14 @@ extern ThreadId VG_(any_matching_thread_stack)
  */
 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' */
index 3da3339ea43eb78456a9a88efaa82e5eea1b0bfb..e4afcc41040b8854b6e805f805309751d0935cd8 100644 (file)
@@ -78,6 +78,7 @@ void SK_(pre_clo_init)(VgNeeds* needs, VgTrackEvents* not_used)
 {
    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);
index e78afdd1a412d62e2e8a0c997faee7ef583a0995..ef617addd9f112ecbd5c2d1acf91cb3935b5d86d 100644 (file)
@@ -93,7 +93,7 @@ Int vg_alloc_client_block ( void )
    }
 
    /* 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) );
@@ -161,7 +161,7 @@ void vg_add_client_stack_block ( ThreadState* tst, Addr aa, UInt sz )
    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);
 
@@ -186,7 +186,7 @@ void vg_add_client_stack_block ( ThreadState* tst, Addr aa, UInt sz )
    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 );
@@ -202,7 +202,7 @@ void vg_add_client_stack_block ( ThreadState* tst, Addr aa, UInt 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
 }
 
@@ -344,7 +344,7 @@ UInt SK_(handle_client_request) ( ThreadState* tst, UInt* arg_block )
          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;
index 31cdcea753f066fc570628e3211a2bc907f0961d..80647cef1be26b351027bfa73606573e1fa3df2d 100644 (file)
@@ -179,7 +179,7 @@ Bool SK_(eq_SkinError) ( VgRes res,
 
       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)");
    }
 }
 
@@ -234,7 +234,7 @@ static void pp_AddrInfo ( Addr a, AddrInfo* ai )
          break;
       }
       default:
-         VG_(panic)("pp_AddrInfo");
+         VG_(skin_panic)("pp_AddrInfo");
    }
 }
 
@@ -283,7 +283,7 @@ void SK_(pp_SkinError) ( SkinError* err, void (*pp_ExeContext)(void) )
                                         "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);
@@ -330,7 +330,7 @@ void SK_(pp_SkinError) ( SkinError* err, void (*pp_ExeContext)(void) )
 
       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)");
    }
 }
 
@@ -470,7 +470,7 @@ void SK_(record_param_error) ( ThreadState* tst, Addr a, Bool isWrite,
 {
    MemCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
    clear_MemCheckError( &err_extra );
    err_extra.addrinfo.akind = Undescribed;
    err_extra.isWrite = isWrite;
@@ -481,7 +481,7 @@ void SK_(record_jump_error) ( ThreadState* tst, Addr a )
 {
    MemCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
 
    clear_MemCheckError( &err_extra );
    err_extra.axskind = ExecAxs;
@@ -493,7 +493,7 @@ void SK_(record_free_error) ( ThreadState* tst, Addr a )
 {
    MemCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
 
    clear_MemCheckError( &err_extra );
    err_extra.addrinfo.akind = Undescribed;
@@ -504,7 +504,7 @@ void SK_(record_freemismatch_error) ( ThreadState* tst, Addr a )
 {
    MemCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
 
    clear_MemCheckError( &err_extra );
    err_extra.addrinfo.akind = Undescribed;
@@ -515,7 +515,7 @@ void SK_(record_user_error) ( ThreadState* tst, Addr a, Bool isWrite )
 {
    MemCheckError err_extra;
 
-   vg_assert(NULL != tst);
+   sk_assert(NULL != tst);
 
    clear_MemCheckError( &err_extra );
    err_extra.addrinfo.akind = Undescribed;
@@ -598,8 +598,8 @@ extern Bool SK_(error_matches_suppression)(SkinError* err, SkinSupp* su)
       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)");
    }
 }
 
index 399946e1b5bce2b42455d9754120af1c1f9faf93..912158cfb5087db4bde1368fc1fb0be058de9cca 100644 (file)
@@ -58,7 +58,7 @@ static void emit_testv_lit_reg ( Int sz, UInt lit, Int reg )
    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 */ );
@@ -74,7 +74,7 @@ static void emit_testv_lit_offregmem ( Int sz, UInt lit, Int off, Int reg )
    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 */ );
@@ -126,7 +126,7 @@ static void synth_LOADV ( Int sz, Int a_reg, Int tv_reg,
       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 );
@@ -141,12 +141,12 @@ static void synth_STOREV ( Int sz, Int tv_tag, Int tv_val, Int a_reg,
    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 );
@@ -161,7 +161,7 @@ static void synth_SETV ( Int sz, Int reg )
       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 );
 }
@@ -174,9 +174,9 @@ static void synth_TESTV ( Int sz, Int tag, Int val )
       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: 
@@ -199,7 +199,7 @@ static void synth_TESTV ( Int sz, Int tag, Int val )
          case 0: 
             /* should never happen */
          default: 
-            VG_(panic)("synth_TESTV(ArchReg)");
+            VG_(skin_panic)("synth_TESTV(ArchReg)");
       }
    } else {
       switch (sz) {
@@ -222,7 +222,7 @@ static void synth_TESTV ( Int sz, Int tag, Int val )
             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 );
@@ -263,7 +263,7 @@ static void synth_GETV ( Int sz, Int arch, Int reg )
          VG_(emit_nonshiftopv_lit_reg) ( 4, OR, 0xFFFFFF00, reg );
          break;
       default: 
-         VG_(panic)("synth_GETV");
+         VG_(skin_panic)("synth_GETV");
    }
 }
 
@@ -276,17 +276,17 @@ static void synth_PUTV ( Int sz, Int srcTag, UInt lit_or_reg, Int arch )
       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 );
@@ -297,13 +297,13 @@ static void synth_PUTV ( Int sz, Int srcTag, UInt lit_or_reg, Int arch )
             }
             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 );
@@ -312,7 +312,7 @@ static void synth_PUTV ( Int sz, Int srcTag, UInt lit_or_reg, Int arch )
          reg = lit_or_reg;
       }
 
-      if (sz == 1) vg_assert(reg < 4);
+      if (sz == 1) sk_assert(reg < 4);
 
       switch (sz) {
          case 4:
@@ -333,7 +333,7 @@ static void synth_PUTV ( Int sz, Int srcTag, UInt lit_or_reg, Int arch )
             }
             break;
          default: 
-            VG_(panic)("synth_PUTV(reg)");
+            VG_(skin_panic)("synth_PUTV(reg)");
       }
 
       if (sz == 1 && lit_or_reg >= 4) {
@@ -496,7 +496,7 @@ static void synth_TAG1_op ( TagOp op, Int reg, RRegSet regs_live_after )
          break;
 
       default:
-         VG_(panic)("synth_TAG1_op");
+         VG_(skin_panic)("synth_TAG1_op");
    }
 }
 
@@ -563,7 +563,7 @@ static void synth_TAG2_op ( TagOp op, Int regs, Int regd )
          break;
 
       default:
-         VG_(panic)("synth_TAG2_op");
+         VG_(skin_panic)("synth_TAG2_op");
    }
 }
 
@@ -576,13 +576,13 @@ void SK_(emit_XUInstr) ( UInstr* u, RRegSet regs_live_before )
    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,
@@ -590,8 +590,8 @@ void SK_(emit_XUInstr) ( UInstr* u, RRegSet regs_live_before )
          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,
@@ -599,33 +599,33 @@ void SK_(emit_XUInstr) ( UInstr* u, RRegSet regs_live_before )
          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;
 
@@ -640,7 +640,7 @@ void SK_(emit_XUInstr) ( UInstr* u, RRegSet regs_live_before )
       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");
    }
 }
 
index 6df699337238a3adc291f93cdb1294035fdb77ec..4a7ff24e4ee6370951b80776ca0f80092d200bca 100644 (file)
@@ -149,7 +149,7 @@ static void done_prof_mem ( 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);
 
@@ -386,7 +386,7 @@ static SecMap* alloc_secondary_map ( __attribute__ ((unused))
    /* 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++)
@@ -463,7 +463,7 @@ static __inline__ UChar get_abits4_ALIGNED ( Addr a )
    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;
@@ -479,7 +479,7 @@ static UInt __inline__ get_vbytes4_ALIGNED ( Addr a )
    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];
 }
@@ -515,15 +515,15 @@ static void set_address_range_perms ( Addr a, UInt len,
       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 
@@ -568,7 +568,7 @@ static void set_address_range_perms ( Addr a, UInt len,
       VGP_POPCC(VgpSetMem);
       return;
    }
-   vg_assert((a % 8) == 0 && len > 0);
+   sk_assert((a % 8) == 0 && len > 0);
 
    /* Once aligned, go fast. */
    while (True) {
@@ -588,7 +588,7 @@ static void set_address_range_perms ( Addr a, UInt len,
       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) {
@@ -604,7 +604,7 @@ static void set_address_range_perms ( Addr a, UInt len,
    /* 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);
 }
 
@@ -736,8 +736,8 @@ static void make_noaccess_aligned ( Addr a, UInt len )
 
    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) {
@@ -765,8 +765,8 @@ static void make_writable_aligned ( Addr a, UInt len )
 
    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) {
@@ -808,7 +808,7 @@ void check_is_writable ( CorePart part, ThreadState* tst,
          break;
 
       default:
-         VG_(panic)("check_is_writable: Unknown or unexpected CorePart");
+         VG_(skin_panic)("check_is_writable: Unknown or unexpected CorePart");
       }
    }
 
@@ -844,7 +844,7 @@ void check_is_readable ( CorePart part, ThreadState* tst,
          break;
 
       default:
-         VG_(panic)("check_is_readable: Unknown or unexpected CorePart");
+         VG_(skin_panic)("check_is_readable: Unknown or unexpected CorePart");
       }
    }
    VGP_POPCC(VgpCheckMem);
@@ -860,7 +860,7 @@ void check_is_readable_asciiz ( CorePart part, ThreadState* tst,
 
    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 );
@@ -1129,7 +1129,7 @@ static UInt vgmext_rd_V4_SLOWLY ( Addr a )
       (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);
@@ -1362,7 +1362,7 @@ void SK_(fpu_read_check) ( Addr addr, Int size )
    }
 
    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
 }
 
@@ -1450,7 +1450,7 @@ void SK_(fpu_write_check) ( Addr addr, Int size )
    }
 
    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
 }
 
@@ -1560,7 +1560,7 @@ static __attribute__ ((unused))
    /* 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
@@ -1571,11 +1571,11 @@ static void add_to_freed_queue ( ShadowChunk* sc )
 
    /* 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;
@@ -1587,13 +1587,13 @@ static void add_to_freed_queue ( ShadowChunk* sc )
    
    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;
@@ -1671,33 +1671,33 @@ UInt VG_(scan_all_valid_memory) ( void (*notify_word)( Addr, UInt ) )
    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;
 
@@ -1734,13 +1734,13 @@ UInt VG_(scan_all_valid_memory) ( void (*notify_word)( Addr, UInt ) )
 
    /* 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;
 }
@@ -1830,13 +1830,13 @@ static Int find_shadow_for ( Addr          ptr,
          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;
@@ -1921,8 +1921,8 @@ void vg_detect_memory_leaks_notify_addr ( Addr a, UInt word_at_a )
       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) {
@@ -1954,7 +1954,7 @@ void SK_(detect_memory_leaks) ( void )
    /* 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;
@@ -1968,9 +1968,9 @@ void SK_(detect_memory_leaks) ( void )
    /* 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) );
    }
 
@@ -2060,7 +2060,7 @@ void SK_(detect_memory_leaks) ( void )
             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;
@@ -2161,7 +2161,7 @@ static void uint_to_bits ( UInt x, Char* str )
          str[w++] = ' ';
    }
    str[w++] = 0;
-   vg_assert(w == 36);
+   sk_assert(w == 36);
 }
 
 /* Caution!  Not vthread-safe; looks in VG_(baseBlock), not the thread
@@ -2257,7 +2257,7 @@ void  SK_(post_syscall) ( ThreadId tid, UInt syscallno,
       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!");
    }
 }
 
@@ -2353,6 +2353,7 @@ void SK_(pre_clo_init)(VgNeeds* needs, VgTrackEvents* track)
 {
    needs->name                    = "memcheck";
    needs->description             = "a memory error detector";
+   needs->bug_reports_to          = "jseward@acm.org";
 
    needs->core_errors             = True;
    needs->skin_errors             = True;
index 6dc51466744bdf5230a21653f6f85c5962cdf27d..031208eb516e6d7380995898d657311bf369b6eb 100644 (file)
@@ -93,7 +93,7 @@ Bool SK_(sane_XUInstr)(Bool beforeRA, Bool beforeLiveness, UInstr* u)
    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
@@ -155,7 +155,7 @@ static Char* nameOfTagOp ( TagOp h )
       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");
    }
 }
 
@@ -175,7 +175,7 @@ Char* SK_(name_XUOpcode)(Opcode opc)
       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");
    }
 }
 
@@ -231,7 +231,7 @@ void SK_(pp_XUInstr)(UInstr* u)
 
       default:
          VG_(printf)("unhandled opcode: %u\n", u->opcode);
-         VG_(panic)("SK_(pp_XUInstr): unhandled opcode");
+         VG_(skin_panic)("SK_(pp_XUInstr): unhandled opcode");
    }
 
 }
@@ -257,7 +257,7 @@ Int SK_(get_Xreg_usage)(UInstr* u, Tag tag, RegUse* arr)
 
       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;
 
@@ -284,7 +284,7 @@ TagOp get_Tag_ImproveOR_TQ ( Int sz )
       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");
    }
 }
 
@@ -296,7 +296,7 @@ TagOp get_Tag_ImproveAND_TQ ( Int sz )
       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");
    }
 }
 
@@ -308,7 +308,7 @@ TagOp get_Tag_Left ( Int sz )
       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");
    }
 }
 
@@ -321,7 +321,7 @@ TagOp get_Tag_UifU ( Int sz )
       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");
    }
 }
 
@@ -333,7 +333,7 @@ TagOp get_Tag_DifD ( Int sz )
       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");
    }
 }
 
@@ -351,7 +351,7 @@ TagOp get_Tag_PCast ( Int szs, Int szd )
    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");
 }
 
 
@@ -368,7 +368,7 @@ TagOp get_Tag_Widen ( Bool syned, Int szs, Int szd )
    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. */
@@ -494,7 +494,7 @@ Int /* TempReg */ getOperandShadow ( UCodeBlock* cb,
       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
@@ -532,14 +532,14 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* 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;
@@ -621,7 +621,7 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
                               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;
@@ -631,7 +631,7 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
             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);
@@ -649,13 +649,13 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
          */
          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);
@@ -690,7 +690,7 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
             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
@@ -699,7 +699,7 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
                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);
@@ -737,8 +737,8 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
          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
@@ -768,7 +768,7 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
 
          /* 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);
@@ -776,21 +776,21 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_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);
@@ -798,8 +798,8 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_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);
@@ -811,11 +811,11 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_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);
@@ -847,7 +847,7 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
             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);
             }
@@ -881,8 +881,8 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
                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);
@@ -1005,10 +1005,10 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
                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
@@ -1029,7 +1029,7 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
          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));
 
@@ -1053,7 +1053,7 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
 
          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) */
 
@@ -1162,7 +1162,7 @@ static void vg_delete_redundant_SETVs ( UCodeBlock* cb )
 
       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);
@@ -1179,7 +1179,7 @@ static void vg_delete_redundant_SETVs ( UCodeBlock* cb )
       } 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;
@@ -1233,15 +1233,15 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
 
          /* 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);
@@ -1252,26 +1252,26 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
             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)(
@@ -1280,16 +1280,16 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
             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)(
@@ -1303,17 +1303,17 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
 
          /* 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) {
@@ -1327,12 +1327,12 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
                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)(
@@ -1343,7 +1343,7 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
                   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;
@@ -1363,7 +1363,7 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
                   /* 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;
@@ -1381,7 +1381,7 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
             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
@@ -1390,36 +1390,36 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
             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;
@@ -1437,10 +1437,10 @@ static void vg_propagate_definedness ( UCodeBlock* cb )
             /* 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)
index f369631463cfeb2e90b7026bc06fc69b6a785294..3a97680d1245850e963cd2d840082c112e74691d 100644 (file)
@@ -33,8 +33,9 @@
 
 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 */
 }