summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog.MELT6
-rw-r--r--gcc/melt-runtime.c1
-rw-r--r--gcc/melt-runtime.h19
3 files changed, 21 insertions, 5 deletions
diff --git a/gcc/ChangeLog.MELT b/gcc/ChangeLog.MELT
index 57119c66b4e..c36e07d80ec 100644
--- a/gcc/ChangeLog.MELT
+++ b/gcc/ChangeLog.MELT
@@ -1,5 +1,11 @@
+2013-07-03 Basile Starynkevitch <basile@starynkevitch.net>
+
+ * melt-runtime.h (Melt_CallFrame): Declare _dbgcall_count_ when
+ debugging and use it.
+ * melt-runtime.c (Melt_CallFrame::_dbgcall_count_): Define.
+
2013-07-02 Basile Starynkevitch <basile@starynkevitch.net>
* melt-runtime.h (Melt_CallFrame): Improve debugging constructors.
diff --git a/gcc/melt-runtime.c b/gcc/melt-runtime.c
index 64d930ca66b..391526be70b 100644
--- a/gcc/melt-runtime.c
+++ b/gcc/melt-runtime.c
@@ -380,6 +380,7 @@ static struct meltextinfovec_st {
Melt_CallFrame* Melt_CallFrame::_top_call_frame_ =NULL;
#if MELT_HAVE_DEBUG
FILE* Melt_CallFrame::_dbgcall_file_ = NULL;
+long Melt_CallFrame::_dbgcall_count_ = 0L;
#endif /*MELT_HAVE_DEBUG*/
#else /* ! MELT_HAVE_CLASSY_FRAME */
struct melt_callframe_st* melt_topframe =NULL;
diff --git a/gcc/melt-runtime.h b/gcc/melt-runtime.h
index fa48537becb..37ab5632e3a 100644
--- a/gcc/melt-runtime.h
+++ b/gcc/melt-runtime.h
@@ -2834,6 +2834,7 @@ class Melt_CallFrame {
static Melt_CallFrame* _top_call_frame_;
#if MELT_HAVE_DEBUG
static FILE* _dbgcall_file_;
+ static long _dbgcall_count_;
#endif /*MELT_HAVE_DEBUG*/
virtual void melt_forward_values (void) =0;
virtual void melt_mark_ggc_data (void) =0;
@@ -2869,7 +2870,9 @@ protected:
_meltcf_dbgfile(file), _meltcf_dbgline(lin),
mcfr_flocs(NULL), mcfr_clos(clos) {
if (MELT_UNLIKELY( _dbgcall_file_ != NULL)) {
- fprintf (_dbgcall_file_, "+ %s:%d Siz%d Clo%p\n", file, lin, (int)sz, (void*)clos);
+ _dbgcall_count_++;
+ fprintf (_dbgcall_file_, "+ %s:%d #%ld Siz%d Clo%p\n",
+ file, lin, _dbgcall_count_, (int)sz, (void*)clos);
fflush (_dbgcall_file_);
}
melt_clear_rest_of_frame (sz);
@@ -2880,7 +2883,9 @@ protected:
_meltcf_dbgfile(file), _meltcf_dbgline(lin),
mcfr_flocs(NULL), mcfr_hook(hook) {
if (MELT_UNLIKELY( _dbgcall_file_ != NULL)) {
- fprintf (_dbgcall_file_, "+ %s:%d Siz%d Hook%p\n", file, lin, (int)sz, (void*)hook);
+ _dbgcall_count_++;
+ fprintf (_dbgcall_file_, "+ %s:%d #%ld Siz%d Hook%p\n",
+ file, lin, _dbgcall_count_, (int)sz, (void*)hook);
fflush (_dbgcall_file_);
}
melt_clear_rest_of_frame (sz);
@@ -2894,7 +2899,9 @@ protected:
#endif /*MELT_HAVE_DEBUG*/
mcfr_flocs(NULL), mcfr_clos(clos) {
if (MELT_UNLIKELY( _dbgcall_file_ != NULL)) {
- fprintf (_dbgcall_file_, "+ * Siz%d Clo%p\n", (int)sz, (void*)clos);
+ _dbgcall_count_++;
+ fprintf (_dbgcall_file_, "+ * #%ld Siz%d Clo%p\n",
+ _dbgcall_count_, (int)sz, (void*)clos);
fflush (_dbgcall_file_);
}
melt_clear_rest_of_frame (sz);
@@ -2907,7 +2914,9 @@ protected:
#endif /*MELT_HAVE_DEBUG*/
mcfr_flocs(NULL), mcfr_hook(hook) {
if (MELT_UNLIKELY( _dbgcall_file_ != NULL)) {
- fprintf (_dbgcall_file_, "+ * Siz%d Hook%p\n", (int)sz, (void*)hook);
+ _dbgcall_count_++;
+ fprintf (_dbgcall_file_, "+ * #%ld Siz%d Hook%p\n",
+ _dbgcall_count_, (int)sz, (void*)hook);
fflush (_dbgcall_file_);
}
melt_clear_rest_of_frame (sz);
@@ -2929,7 +2938,7 @@ public:
if (MELT_UNLIKELY( _dbgcall_file_ != NULL)) {
fflush (_dbgcall_file_);
if (f == NULL) {
- fprintf (_dbgcall_file_, "#eof\n");
+ fprintf (_dbgcall_file_, "#eof #%ld\n", _dbgcall_count_);
fclose (_dbgcall_file_);
}
}