<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>emacs/.gitignore</filename>
    </added>
    <added>
      <filename>emacs/Makefile.am</filename>
    </added>
    <added>
      <filename>emacs/elk-test.el</filename>
    </added>
    <added>
      <filename>emacs/kshdb-test.el.in</filename>
    </added>
    <added>
      <filename>emacs/kshdb.el</filename>
    </added>
    <added>
      <filename>lib/.gitignore</filename>
    </added>
    <added>
      <filename>lib/journal.sh</filename>
    </added>
    <added>
      <filename>test/.gitignore</filename>
    </added>
    <added>
      <filename>test/hanoi.sh</filename>
    </added>
    <added>
      <filename>testing.sh</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -290,13 +290,13 @@ function _Dbg_set_to_return_from_debugger {
   _Dbg_currentbp=0
   _Dbg_stop_reason=''
   if (( $1 != 0 )) ; then
-    _Dbg_last_bash_command=&quot;$_Dbg_bash_command&quot;
+    _Dbg_last_ksh_command=&quot;$_Dbg_ksh_command&quot;
     _Dbg_last_curline=&quot;$_curline&quot;
     _Dbg_last_source_file=&quot;${.sh.file}&quot;
   else
-    _Dbg_last_curline==${BASH_LINENO[1]}
-    _Dbg_last_source_file=${BASH_SOURCE[2]:-$_Dbg_bogus_file}
-    _Dbg_last_bash_command=&quot;**unsaved _kshdb command**&quot;
+    _Dbg_last_curline==${KSH_LINENO[1]}
+    _Dbg_last_source_file=${KSH_SOURCE[2]:-$_Dbg_bogus_file}
+    _Dbg_last_ksh_command=&quot;**unsaved _kshdb command**&quot;
   fi
 
   _Dbg_restore_user_vars</diff>
      <filename>lib/fns.sh</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,11 @@
+# -*- shell-script -*-
+#================ VARIABLE INITIALIZATIONS ====================#
+
+# Where are we in stack? This can be changed by &quot;up&quot;, &quot;down&quot; or &quot;frame&quot;
+# commands.
+
+typeset -i _Dbg_stack_pos=1
+
 typeset -T Frame_t=(
 	filename=''
 	integer lineno=0
@@ -8,15 +16,15 @@ typeset -T Frame_t=(
 	}
 )
 
-Frame_t -a call_stack  #=() causes a problem
-call_stack=()
+Frame_t -a _Dbg_frame_stack  #=() causes a problem
+_Dbg_frame_stack=()
 save_callstack() {
     integer start=${1:-0}
     integer .level=.sh.level-$start .max=.sh.level
     typeset -a .files=()
     typeset -a .linenos=()
     typeset -a .fns=()
-    # Frame_t -a .call_stack gives segv
+    # Frame_t -a ._Dbg_frame_stack gives segv
     while((--.level&gt;=0)); do
 	((.sh.level = .level))
 	.files+=(&quot;${.sh.file}&quot;)
@@ -27,15 +35,15 @@ save_callstack() {
     # Reorganize into an array of frame structures
     integer i
     for ((i=0; i&lt;.max-start; i++)) ; do 
-	call_stack[i].filename=${.files[i]}
-	call_stack[i].lineno=${.linenos[i]}
-	call_stack[i].fn=${.fns[$i]}
+	_Dbg_frame_stack[i].filename=${.files[i]}
+	_Dbg_frame_stack[i].lineno=${.linenos[i]}
+	_Dbg_frame_stack[i].fn=${.fns[$i]}
     done
  }
 print_callstack() {
     integer i
-    for ((i=0; i&lt;${#call_stack[@]}; i++)) ; do 
-	print -r -- ${call_stack[$i].to_file_line}
+    for ((i=0; i&lt;${#_Dbg_frame_stack[@]}; i++)) ; do 
+	print -r -- ${_Dbg_frame_stack[$i].to_file_line}
     done
     print ======
 }</diff>
      <filename>lib/frame.sh</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,61 @@
+# sig.sh - Debugger Signal handling routines
+#
+#   Copyright (C) 2008 Rocky Bernstein rocky@gnu.org
+#
+#   zshdb is free software; you can redistribute it and/or modify it under
+#   the terms of the GNU General Public License as published by the Free
+#   Software Foundation; either version 2, or (at your option) any later
+#   version.
+#
+#   zshdb is distributed in the hope that it will be useful, but WITHOUT ANY
+#   WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#   for more details.
+#   
+#   You should have received a copy of the GNU General Public License along
+#   with zshdb; see the file COPYING.  If not, write to the Free Software
+#   Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+
 function _Dbg_debug_trap_handler {
-   save_callstack 1
+    typeset -i _Dbg_debugged_exit_code=$?
+    _Dbg_old_set_opts=$-
+
+    # Place to save values of $1, $2, etc.
+    typeset -a _Dbg_arg
+    _Dbg_arg=($@)
+
+    # Turn off line and variable trace listing if were not in our own debug
+    # mode, and set our own PS4 for debugging inside the debugger
+    (( !_Dbg_debug_debugger )) &amp;&amp; set +x +v +u
+
+    # if in step mode, decrement counter
+    if ((_Dbg_step_ignore &gt;= 0)) ; then 
+	((_Dbg_step_ignore--))
+	_Dbg_write_journal &quot;_Dbg_step_ignore=$_Dbg_step_ignore&quot;
+    fi
+
+    if ((_Dbg_skip_ignore &gt; 0)) ; then
+	((_Dbg_skip_ignore--))
+	_Dbg_write_journal &quot;_Dbg_step_ignore=$_Dbg_skip_ignore&quot;
+    fi
+
+    # Determine if we stop or not. 
+
+    # next, check if step mode and no. of steps is up
+    if ((_Dbg_step_ignore == 0)); then
+	_Dbg_stop_reason='after being stepped'
+	
+	# If we don't have to stop we might consider skipping 
+	_Dbg_set_debugger_entry
+	
+	save_callstack 1
+	_Dbg_print_location
+	# _Dbg_process_commands
+	_Dbg_set_to_return_from_debugger 1
+	return $_Dbg_rc
+    else
+	save_callstack 1
+    fi
+
    print_callstack
 }</diff>
      <filename>lib/sig.sh</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9103033afd606a3e20c2b125b054879febd57fc2</id>
    </parent>
  </parents>
  <author>
    <name>R. Bernstein</name>
    <email>rocky@gnu.org</email>
  </author>
  <url>http://github.com/rocky/kshdb/commit/d39c43e585bac898636fabba39183cf31e5a4538</url>
  <id>d39c43e585bac898636fabba39183cf31e5a4538</id>
  <committed-date>2008-08-10T07:19:32-07:00</committed-date>
  <authored-date>2008-08-10T07:19:32-07:00</authored-date>
  <message>Add gdb's print location. Move more of the zshdb code over.</message>
  <tree>95ebb8ce7d55cd7588537fc6fc7a3d0f850b5a46</tree>
  <committer>
    <name>R. Bernstein</name>
    <email>rocky@gnu.org</email>
  </committer>
</commit>
