mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 16:27:35 +02:00
Added basic call history reporting
This commit is contained in:
parent
a4c4ae94fc
commit
2d8c6ed5f3
3 changed files with 11 additions and 18 deletions
13
TODO
13
TODO
|
@ -13,19 +13,6 @@ Working TODO list:
|
||||||
- self-hosting, there are a lot of accumulated TODO's that need to be addressed
|
- self-hosting, there are a lot of accumulated TODO's that need to be addressed
|
||||||
|
|
||||||
- improved error handling:
|
- improved error handling:
|
||||||
(1) - code traces
|
|
||||||
could pass filename and define name (if applicable) to c-compile-exp,
|
|
||||||
and record it for each lambda. could then add code to each lambda to
|
|
||||||
write that info to a circular buffer when the function is called.
|
|
||||||
that would enable a primitive stack trace to be maintained at runtime.
|
|
||||||
|
|
||||||
ideally use an array of (char *) and a pointer incremented like (i = (i + 1) % size)
|
|
||||||
to treat it as a circular buffer
|
|
||||||
|
|
||||||
as a starting point, could encode lambda name and filename and get the
|
|
||||||
circular buffer and runtime reporting working. then come back and add
|
|
||||||
Scheme function names.
|
|
||||||
|
|
||||||
- type checking
|
- type checking
|
||||||
ideally want to do this in a way that minimized performance impacts.
|
ideally want to do this in a way that minimized performance impacts.
|
||||||
will probaby require extensive checks within apply() though, since that
|
will probaby require extensive checks within apply() though, since that
|
||||||
|
|
|
@ -80,9 +80,11 @@ void Cyc_st_init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cyc_st_add(char *frame) {
|
void Cyc_st_add(char *frame) {
|
||||||
// TODO: do not add if (idx - 1) == frame, since that causes recursion to remove older frames
|
// Do not allow recursion to remove older frames
|
||||||
|
if (frame != Cyc_Stack_Traces[(Cyc_Stack_Trace_Idx - 1) % MAX_STACK_TRACES]) {
|
||||||
Cyc_Stack_Traces[Cyc_Stack_Trace_Idx] = frame;
|
Cyc_Stack_Traces[Cyc_Stack_Trace_Idx] = frame;
|
||||||
Cyc_Stack_Trace_Idx = (Cyc_Stack_Trace_Idx + 1) % MAX_STACK_TRACES;
|
Cyc_Stack_Trace_Idx = (Cyc_Stack_Trace_Idx + 1) % MAX_STACK_TRACES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cyc_st_print(FILE *out) {
|
void Cyc_st_print(FILE *out) {
|
||||||
|
|
|
@ -2,10 +2,14 @@
|
||||||
(scheme file)
|
(scheme file)
|
||||||
(scheme write))
|
(scheme write))
|
||||||
|
|
||||||
|
(map
|
||||||
|
(lambda (_)
|
||||||
(set! x 1)
|
(set! x 1)
|
||||||
(write x)
|
;(write x)
|
||||||
(write 'Cyc_procedure)
|
;(write 'Cyc_procedure)
|
||||||
(open-input-file "1.scm")
|
(open-input-file "1.scm")
|
||||||
|
)
|
||||||
|
(list 1))
|
||||||
;;; TODO: C macros for funcall1, etc are not being generated even though entries are set
|
;;; TODO: C macros for funcall1, etc are not being generated even though entries are set
|
||||||
;;; in the vector. must be another problem inspecting the vector ???
|
;;; in the vector. must be another problem inspecting the vector ???
|
||||||
;(write 'hello)
|
;(write 'hello)
|
||||||
|
|
Loading…
Add table
Reference in a new issue