mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-02-06 23:50:33 -08:00
Fix ecl_print, and new GDB function ecl_eval.
Used like this:
(gdb) ecl_eval cl::*package*
This commit is contained in:
parent
285eb31812
commit
3afe5932f4
1 changed files with 21 additions and 7 deletions
|
|
@ -20,19 +20,33 @@ macro define NIL (cl_symbols)
|
|||
macro define T (cl_symbols+1)
|
||||
|
||||
define ecl_print
|
||||
set $cl_debug_arg = (long)($arg0)
|
||||
print $cl_debug_arg
|
||||
set $cl_debug_stream = ecl_make_string_output_stream(4096, 0)
|
||||
|
||||
#set $cl_debug_void = ecl_princ( $arg0, $cl_debug_stream)
|
||||
#print $cl_debug_stream->stream.object0->base_string.self
|
||||
#set $cl_debug_stream->stream.object0->base_string.fillp = 0
|
||||
|
||||
set $cl_debug_imm = 3 & (long)$arg0
|
||||
set $cl_debug_type = ($cl_debug_imm ? $cl_debug_imm : $arg0->d.t)
|
||||
set $cl_debug_imm = 3 & $cl_debug_arg
|
||||
set $cl_debug_type = ($cl_debug_imm ? $cl_debug_imm : ((cl_object)$cl_debug_arg)->d.t)
|
||||
print (cl_type) $cl_debug_type
|
||||
|
||||
# not safe for printing
|
||||
if $cl_debug_type > 0
|
||||
set $cl_debug_void = si_write_ugly_object( $arg0, $cl_debug_stream)
|
||||
set $cl_debug_void = si_write_ugly_object( $cl_debug_arg, $cl_debug_stream)
|
||||
print $cl_debug_stream->stream.object0->base_string.self
|
||||
|
||||
set $cl_debug_stream->stream.object0->base_string.fillp = 0
|
||||
set $cl_debug_void = ecl_princ( $cl_debug_arg, $cl_debug_stream)
|
||||
# ensure string is terminated
|
||||
set $cl_debug_stream->stream.object0->base_string.self[$cl_debug_stream->stream.object0->base_string.fillp] = 0
|
||||
print $cl_debug_stream->stream.object0->base_string.self
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
define ecl_eval
|
||||
set $cl_debug_str = ecl_make_simple_base_string( "$arg0", -1)
|
||||
set $cl_debug_stream = ecl_make_string_input_stream( $cl_debug_str, 0, ((struct ecl_base_string*)$cl_debug_str)->fillp)
|
||||
set $cl_debug_form = cl_read(1, $cl_debug_stream)
|
||||
disable breakpoints
|
||||
ecl_print cl_eval($cl_debug_form)
|
||||
enable breakpoints
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue