X-Git-Url: https://git.hcoop.net/bpt/guile.git/blobdiff_plain/887ce75ae828fabd9a76d8e719bd3070c334eb44..1f3babaaef5f4c41c24615035a9549e2faf2605e:/gdbinit diff --git a/gdbinit b/gdbinit index ad7881f2a..fdc9c759b 100644 --- a/gdbinit +++ b/gdbinit @@ -1,7 +1,16 @@ +# -*- GDB-Script -*- + +handle SIGPWR noprint nostop +handle SIGXCPU noprint nostop + define newline call (void)scm_newline (scm_current_error_port ()) end +define pp + call (void)scm_call_1 (scm_variable_ref (scm_c_module_lookup (scm_c_resolve_module ("ice-9 pretty-print"), "pretty-print")), $arg0) +end + define gdisplay call (void)scm_display ($arg0, scm_current_error_port ()) newline @@ -70,9 +79,11 @@ define smobdatatox smobwordtox $arg0 1 end -define program +define program_objcode smobdatatox $arg0 - p *(struct scm_program*)$x + set $objcode=$x + smobdatatox $objcode + p *(struct scm_objcode*)$x end define proglocals @@ -140,16 +151,6 @@ define nextframe output $vmdl newline set $vmsp=$vmsp-1 - sputs "hl:\t" - output $vmsp - sputs "\t" - gwrite *$vmsp - set $vmsp=$vmsp-1 - sputs "el:\t" - output $vmsp - sputs "\t" - gwrite *$vmsp - set $vmsp=$vmsp-1 set $vmnlocs=(int)$vmbp->nlocs while $vmnlocs > 0 sputs "loc #" @@ -178,14 +179,13 @@ define nextframe gwrite *$vmsp set $vmsp=$vmsp-1 newline - if !$vmdl - loop_break + if $vmdl + set $vmfp=$vmdl + set $vmbp=(struct scm_objcode*)((SCM*)(((SCM*)($vmfp[-1]))[1])[1]) + set $vmstack_base=$vmfp+$vmbp->nargs+$vmbp->nlocs+4 + set $vmframe=$vmframe+1 + newline end - set $vmfp=$vmdl - set $vmbp=(struct scm_program*)(((SCM*)($vmfp[-1]))[1]) - set $vmstack_base=$vmfp+$vmbp->nargs+$vmbp->nlocs+4 - set $vmframe=$vmframe+1 - newline end define vmstack @@ -194,3 +194,11 @@ define vmstack nextframe end end + +define inst + p scm_instruction_table[$arg0] +end + +define gbt + call scm_display_backtrace (scm_make_stack(0x404,0x304), scm_current_error_port (), 0x704, 0x704, 0x704) +end