summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog.MELT8
-rw-r--r--gcc/melt-runtime.c10
-rw-r--r--gcc/melt-runtime.h16
3 files changed, 27 insertions, 7 deletions
diff --git a/gcc/ChangeLog.MELT b/gcc/ChangeLog.MELT
index 5a28549e5cc..3a3534e2ffd 100644
--- a/gcc/ChangeLog.MELT
+++ b/gcc/ChangeLog.MELT
@@ -1,6 +1,14 @@
2011-07-07 Basile Starynkevitch <basile@starynkevitch.net>
+ * melt-runtime.c (compile_gencsrc_to_binmodule): Gives a fatal
+ error if the make command failed.
+
+ * melt-runtime.h (melt_dbgtracefile): Remove.
+ (melt_trace_start, melt_trace_end): Dummy macros.
+
+2011-07-07 Basile Starynkevitch <basile@starynkevitch.net>
+
* melt-runtime.h (melt_gcc_version): New declaration.
* melt-runtime.c (melt_gcc_version): New definition.
diff --git a/gcc/melt-runtime.c b/gcc/melt-runtime.c
index 8891e2937a2..97a1b0f72f0 100644
--- a/gcc/melt-runtime.c
+++ b/gcc/melt-runtime.c
@@ -5114,6 +5114,16 @@ compile_gencsrc_to_binmodule (const char *srcfile, const char *fullbinfile, cons
melt_fatal_error
("failed to get time of melt dynamic compilation to dyl: %s %s %s - %m",
ourmakecommand, srcfile, fullbinfile);
+ if (cstatus)
+ melt_fatal_error
+ ("MELT failed (%s %d) to compile using %s, source %s, binary %s, target %s",
+ WIFEXITED (cstatus)?"exit"
+ : WIFSIGNALED(cstatus)? "got signal"
+ : WIFSTOPPED(cstatus)?"stopped"
+ : "crashed",
+ WIFEXITED (cstatus) ? WEXITSTATUS(cstatus)
+ : WIFSIGNALED(cstatus) ? WTERMSIG(cstatus)
+ : cstatus, ourmakecommand, srcfile, fullbinfile, maketarget);
pex_free (pex);
myusrtime = (double) ptime.user_seconds
+ 1.0e-6*ptime.user_microseconds;
diff --git a/gcc/melt-runtime.h b/gcc/melt-runtime.h
index abfc1e5b232..6c38bb4147c 100644
--- a/gcc/melt-runtime.h
+++ b/gcc/melt-runtime.h
@@ -2523,7 +2523,8 @@ extern melt_ptr_t melt_jmpval;
#endif
/* declare the current callframe */
-#if MELT_HAVE_DEBUG
+#if MELT_HAVE_DEBUG>0
+
#define MELT_DECLFRAME(NBVAR) struct { \
int mcfr_nbvar; \
const char* mcfr_flocs; \
@@ -2564,7 +2565,9 @@ extern melt_ptr_t melt_jmpval;
#define MELT_LOCATION_HERE_MACRO(MSG) \
MELT_LOCATION_HERE_AT_MACRO(__FILE__,__LINE__,MSG)
#define MELT_LOCATION_HERE(MSG) MELT_LOCATION_HERE_MACRO(MSG)
+
#else /*!MELT_HAVE_DEBUG*/
+
#define MELT_DECLFRAME(NBVAR) struct { \
int mcfr_nbvar; \
struct meltclosure_st* mcfr_clos; \
@@ -2582,7 +2585,8 @@ extern melt_ptr_t melt_jmpval;
meltfram__.mcfr_clos = (CLOS); \
melt_topframe = ((void*)&meltfram__); \
} while(0)
-#endif
+
+#endif /*!MELT_HAVE_DEBUG*/
/* declare and initialize the current callframe */
@@ -2775,7 +2779,7 @@ void melt_dbgshortbacktrace(const char* msg, int maxdepth);
#if ENABLE_CHECKING
extern void* melt_checkedp_ptr1;
extern void* melt_checkedp_ptr2;
-extern FILE* melt_dbgtracefile;
+
void melt_caught_assign_at(void*ptr, const char*fil, int lin, const char*msg);
#define melt_checked_assignmsg_at(Assign,Fil,Lin,Msg) ({ \
void* p_##Lin = (Assign); \
@@ -2788,10 +2792,8 @@ void melt_caught_assign_at(void*ptr, const char*fil, int lin, const char*msg);
#define melt_checked_assignmsg(Assign,Msg) melt_checked_assignmsg_at((Assign),__FILE__,__LINE__,Msg)
void melt_cbreak_at(const char*msg, const char*fil, int lin);
#define melt_cbreak(Msg) melt_cbreak_at((Msg),__FILE__,__LINE__)
-#define melt_trace_start(Msg,Cnt) do {if (melt_dbgtracefile) \
- fprintf(melt_dbgtracefile, "+%s %ld\n", Msg, (long)(Cnt));} while(0)
-#define melt_trace_end(Msg,Cnt) do {if (melt_dbgtracefile) \
- fprintf(melt_dbgtracefile, "-%s %ld\n", Msg, (long)(Cnt));} while(0)
+#define melt_trace_start(Msg,Cnt) do {} while(0)
+#define melt_trace_end(Msg,Cnt) do {} while(0)
#else
#define melt_checked_assign(Assign) Assign
#define melt_checked_assignmsg(Assign,Msg) Assign