on master help sign in
Merge branch 'master' into Reader
commit292fb31d564087d505062a2101f8d0f1ac4ce5b3 authorPatrick Hilhorst <patrickhilhorst97@gmail.com> dateThu 22 Jun 2017, 00:27 (9 years ago) parent265fb1dd9e3a20
5 files changed+26−4
.travis.yml+4−1 CHANGELOG.md+2 appveyor.yml+1−1 rts/idris_rts.c+9−1 rts/idris_rts.h+10−1
.travis.yml+4−1
@@ -1,3 +1,4 @@
1+dist: trusty
12sudo: false
23
34language: c
@@ -153,7 +154,9 @@ script:
153154 - echo -en 'travis_fold:end:script.tests\\r'
154155###
155156 - echo 'Benchmarks...' && echo -en 'travis_fold:start:script.benchmarks\\r'
156− - cd benchmarks && ./build.pl && ./run.pl && cd ..
157+ - if [[ "$TESTS" == "test_c" ]]; then
158+ cd benchmarks && ./build.pl && ./run.pl && cd ..;
159+ fi
157160 - echo -en 'travis_fold:end:script.benchmarks\\r'
158161###
159162# EOF
CHANGELOG.md+2
@@ -7,6 +7,8 @@
77+ New instances:
88 + Added `Catchable` for `ReaderT`, `WriterT`, and `RWST`.
99 + Added `MonadTrans` for `RWST`.
10++ Added utility functions to `Data.SortedMap` and `Data.SortedSet` (`contrib`),
11+ most notably `merge`, merging two maps by their `Semigroup` op (`<+>`)
1012
1113## Tool Updates
1214
appveyor.yml+1−1
@@ -1,7 +1,7 @@
11version: 1.0.{build}
22init:
33- ps: >-
4− choco install cabal
4+ choco install cabal --no-progress
55
66 mkdir C:\ghc
77
rts/idris_rts.c+9−1
@@ -419,6 +419,13 @@ VAL MKB64(VM* vm, uint64_t bits64) {
419419 return cl;
420420}
421421
422+void idris_trace(VM* vm, const char* func, int line) {
423+ printf("At %s:%d\n", func, line);
424+ dumpStack(vm);
425+ puts("");
426+ fflush(stdout);
427+}
428+
422429void dumpStack(VM* vm) {
423430 int i = 0;
424431 VAL* root;
@@ -426,7 +433,8 @@ void dumpStack(VM* vm) {
426433 for (root = vm->valstack; root < vm->valstack_top; ++root, ++i) {
427434 printf("%d: ", i);
428435 dumpVal(*root);
429− if (*root >= (VAL)(vm->heap.heap) && *root < (VAL)(vm->heap.end)) { printf("OK"); }
436+ if (*root >= (VAL)(vm->heap.heap) && *root < (VAL)(vm->heap.end)) { printf(" OK"); }
437+ if (root == vm->valstack_base) { printf(" <--- base"); }
430438 printf("\n");
431439 }
432440 printf("RET: ");
rts/idris_rts.h+10−1
@@ -235,7 +235,15 @@ typedef intptr_t i_int;
235235
236236// Stack management
237237
238−#define INITFRAME VAL* myoldbase
238+#ifdef IDRIS_TRACE
239+#define TRACE idris_trace(vm, __FUNCTION__, __LINE__);
240+#else
241+#define TRACE
242+#endif
243+
244+#define INITFRAME TRACE\
245+ VAL* myoldbase
246+
239247#define REBASE vm->valstack_base = oldbase
240248#define RESERVE(x) if (vm->valstack_top+(x) > vm->stack_max) { stackOverflow(); } \
241249 else { memset(vm->valstack_top, 0, (x)*sizeof(VAL)); }
@@ -348,6 +356,7 @@ VM* idris_getSender(Msg* msg);
348356int idris_getChannel(Msg* msg);
349357void idris_freeMsg(Msg* msg);
350358
359+void idris_trace(VM* vm, const char* func, int line);
351360void dumpVal(VAL r);
352361void dumpStack(VM* vm);
353362