Fixed very minor bug with profiling.  With cachegrind, if you specified
--profile=yes without having built it for profiling (by #including
vg_profile.c) it gave a "pushcc" panic, instead of a nice explanation.

This is because I assumed no profiling events would be pushed/popped before
VG_(init_profiling)() was called.  But cachegrind malloc's some memory in
post_clo_init(), which takes place before VG_(init_profiling)().

So I changed the dummy pushcc/popcc to give the nice error message, instead of
uninformatively panicking.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1451 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_dummy_profile.c b/coregrind/vg_dummy_profile.c
index 6db1f11..f5adc21 100644
--- a/coregrind/vg_dummy_profile.c
+++ b/coregrind/vg_dummy_profile.c
@@ -32,12 +32,7 @@
 
 #include "vg_include.h"
 
-
-void VGP_(register_profile_event) ( Int n, Char* name )
-{
-}
-
-void VGP_(init_profiling) ( void )
+static void vgp_die(void)
 {
    VG_(printf)(
       "\nProfiling error:\n"
@@ -47,19 +42,28 @@
    VG_(exit)(1);
 }
 
+void VGP_(register_profile_event) ( Int n, Char* name )
+{
+}
+
+void VGP_(init_profiling) ( void )
+{
+   vgp_die();
+}
+
 void VGP_(done_profiling) ( void )
 {
-   VG_(core_panic)("done_profiling");
+   VGP_(core_panic)("done_profiling(), but not compiled for profiling??");
 }
 
 void VGP_(pushcc) ( UInt cc )
 {
-   VG_(core_panic)("pushcc");
+   vgp_die();
 }
 
 void VGP_(popcc) ( UInt cc )
 {
-   VG_(core_panic)("popcc");
+   vgp_die();
 }
 
 /*--------------------------------------------------------------------*/