From e3348dafe5d8d35f7ce8e2564af20c6f0e4ceccc Mon Sep 17 00:00:00 2001 From: Philipp Marek Date: Wed, 26 Feb 2014 21:37:51 +0100 Subject: [PATCH] GDB: Don't print an object if the type is 0 (cl_start) - that seems unsafe. --- src/util/gdbinit | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/util/gdbinit b/src/util/gdbinit index 5233a8a3a..25ea8cf9d 100644 --- a/src/util/gdbinit +++ b/src/util/gdbinit @@ -26,9 +26,13 @@ define ecl_print #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)x - print (cl_type)($cl_debug_imm ? $cl_debug_imm : x->d.t) + set $cl_debug_imm = 3 & (long)$arg0 + set $cl_debug_type = ($cl_debug_imm ? $cl_debug_imm : $arg0->d.t) + print (cl_type) $cl_debug_type - set $cl_debug_void = si_write_ugly_object( $arg0, $cl_debug_stream) - print $cl_debug_stream->stream.object0->base_string.self + # not safe for printing + if $cl_debug_type > 0 + set $cl_debug_void = si_write_ugly_object( $arg0, $cl_debug_stream) + print $cl_debug_stream->stream.object0->base_string.self + end end