<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,5 +13,6 @@
 /install-sh
 /kshdb
 /kshdb-*.tar.gz
+/kshdb-*.tar.bz2
 /kshdb-trace
 /missing</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -3,8 +3,12 @@ pkgdata_DATA =       \
 	alias.sh     \
 	break.sh     \
 	continue.sh  \
+	delete.sh    \
+	disable.sh   \
 	edit.sh      \
+	enable.sh    \
 	eval.sh      \
+	examine.sh   \
 	frame.sh     \
 	help.sh      \
 	info.sh      \</diff>
      <filename>command/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -108,13 +108,14 @@ AC_CONFIG_FILES([test/unit/test-columns.sh],
                 [chmod +x test/unit/test-columns.sh])
 AC_CONFIG_FILES([test/unit/test-dbg-opts.sh], 
                 [chmod +x test/unit/test-dbg-opts.sh])
+AC_CONFIG_FILES([test/unit/test-file.sh],
+	        [chmod +x test/unit/test-file.sh])
 AC_CONFIG_FILES([test/unit/test-filecache.sh],
 	        [chmod +x test/unit/test-filecache.sh])
 AC_CONFIG_FILES([test/unit/test-fns.sh],   [chmod +x test/unit/test-fns.sh])
 AC_CONFIG_FILES([test/unit/test-frame.sh], [chmod +x test/unit/test-frame.sh])
 AC_CONFIG_FILES([test/unit/test-journal.sh],
 	        [chmod +x test/unit/test-journal.sh])
-AC_CONFIG_FILES([test/unit/test-io.sh],    [chmod +x test/unit/test-io.sh])
 AC_CONFIG_FILES([test/unit/test-pre.sh],   [chmod +x test/unit/test-pre.sh])
 AC_CONFIG_FILES([test/unit/test-run.sh],   [chmod +x test/unit/test-run.sh])
 AC_CONFIG_FILES([test/unit/test-save-restore.sh],</diff>
      <filename>configure.ac</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 # -*- shell-script -*-
 # This program needs to be SOURCE'd and is not called as an executable
 #
-#   Copyright (C) 2008 Rocky Bernstein rocky@gnu.org
+#   Copyright (C) 2008, 2009 Rocky Bernstein rocky@gnu.org
 #
 #   kshdb 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
@@ -73,3 +73,7 @@ fi
 
 set -${_Dbg_trace_old_set_opts}
 unset _Dbg_trace_old_set_opts
+
+_Dbg_debugger() {
+    trap '_Dbg_hook $? &quot;$@&quot;' DEBUG
+}</diff>
      <filename>dbg-trace.sh.in</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 # -*- shell-script -*-
 #
-#   Copyright (C) 2008 Rocky Bernstein  rocky@gnu.org
+#   Copyright (C) 2008, 2009 Rocky Bernstein  rocky@gnu.org
 #
 #   kshdb is free software; you can redistribute it and/or modify it
 #   under the terms of the GNU General Public License as published by
@@ -76,7 +76,7 @@ _Dbg_save_breakpoints() {
 # Start out with general break/watchpoint functions first...
 
 # Enable/disable breakpoint or watchpoint by entry numbers.
-_Dbg_enable_disable() {
+function _Dbg_enable_disable {
   if (($# == 0)) ; then
     _Dbg_errmsg &quot;Expecting a list of breakpoint/watchpoint numbers. Got none.&quot;
     return 1
@@ -194,7 +194,7 @@ _Dbg_set_brkpt() {
 }
 
 # Internal routine to unset the actual breakpoint arrays
-_Dbg_unset_brkpt_arrays() {
+function _Dbg_unset_brkpt_arrays {
     (( $# != 1 )) &amp;&amp; return 1
     typeset -i del=$1
     _Dbg_write_journal_eval &quot;_Dbg_brkpt[$del].lineno=0&quot;
@@ -208,7 +208,7 @@ _Dbg_unset_brkpt_arrays() {
 
 # Internal routine to delete a breakpoint by file/line.
 # The number of breakpoints unset returned.
-_Dbg_unset_brkpt() {
+function _Dbg_unset_brkpt {
     (( $# != 2 )) &amp;&amp; return 0
     typeset    filename=&quot;$1&quot;
     typeset -i lineno=$2
@@ -239,13 +239,13 @@ _Dbg_unset_brkpt() {
 
 # Routine to a delete breakpoint by entry number: $1.
 # Returns whether or not anything was deleted.
-_Dbg_delete_brkpt_entry() {
+function _Dbg_delete_brkpt_entry {
     (( $# == 0 )) &amp;&amp; return 0
     typeset -r  del=&quot;$1&quot;
     typeset -i  i
     typeset -i  found=0
     
-    if [[ -z ${_Dbg_brkpt_file[$del]} ]] ; then
+    if [[ -z ${_Dbg_brkpt[$del]} ]] ; then
 	_Dbg_errmsg &quot;No breakpoint number $del.&quot;
 	return 0
     fi
@@ -254,7 +254,7 @@ _Dbg_delete_brkpt_entry() {
     typeset -i try 
     typeset -a new_lineno_val; new_lineno_val=()
     typeset -a new_brkpt_nos; new_brkpt_nos=()
-    typeset -i i
+    typeset -i i=-1
     brkpt_nos=(${_Dbg_brkpt_file2brkpt[$source_file]})
     for try in ${_Dbg_brkpt_file2linenos[$source_file]} ; do 
 	((i++))
@@ -279,12 +279,11 @@ _Dbg_delete_brkpt_entry() {
 	    _Dbg_write_journal_eval &quot;_Dbg_brkpt_file2brkpt[$source_file]=${new_brkpt_nos}&quot;
 	fi
     fi
-    
     return $found
 }
 
 # Enable/disable breakpoint(s) by entry numbers.
-_Dbg_enable_disable_brkpt() {
+function _Dbg_enable_disable_brkpt {
   (($# != 3)) &amp;&amp; return 1
   typeset -i on=$1
   typeset en_dis=$2</diff>
      <filename>lib/break.sh</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,6 @@
 # -*- shell-script -*-
-# dbg-fns.inc - Debugger Utility Functions
 #
-#   Copyright (C) 2008 Rocky Bernstein rocky@gnu.org
+#   Copyright (C) 2008, 2009 Rocky Bernstein rocky@gnu.org
 #
 #   kshdb 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
@@ -68,3 +67,11 @@ function _Dbg_printf_nocr {
   fi
 }
 
+# Common funnel for &quot;Undefined command&quot; message
+_Dbg_undefined_cmd() {
+    if (( $# == 2 )) ; then
+	_Dbg_msg &quot;Undefined $1 subcommand \&quot;$2\&quot;. Try \&quot;help $1\&quot;.&quot;
+    else
+	_Dbg_msg &quot;Undefined command \&quot;$1\&quot;. Try \&quot;help\&quot;.&quot;
+    fi
+}</diff>
      <filename>lib/msg.sh</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 # -*- shell-script -*-
-#   Copyright (C) 2008 Rocky Bernstein rocky@gnu.org
+#   Copyright (C) 2008, 2009 Rocky Bernstein rocky@gnu.org
 #
 #   kshdb 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
@@ -71,7 +71,7 @@ function _Dbg_process_commands {
     	_Dbg_onecmd &quot;$_Dbg_cmd&quot; &quot;$args&quot;
         rc=$?
         # _Dbg_postcmd
-        (( $rc &gt; 0 )) &amp;&amp; return $rc
+        (( rc &gt; 0 &amp;&amp; rc != 255 )) &amp;&amp; return $rc
     done
 
     unset _Dbg_fd[_Dbg_fd_last--]
@@ -135,6 +135,18 @@ _Dbg_onecmd() {
 	  fi
 	  ;;
 
+	# Delete breakpoints by entry numbers. 
+	delete )
+	  _Dbg_do_delete $args
+	  _Dbg_last_cmd='delete'
+	  ;;
+
+	# Disable breakpoints
+	disable )
+	  _Dbg_do_disable $args
+	  _Dbg_last_cmd='disable'
+	  ;;
+
 	# Move call stack down
 	down )
 	  _Dbg_do_down $@
@@ -147,6 +159,12 @@ _Dbg_onecmd() {
 	  _Dbg_last_cmd='edit'
 	  ;;
 
+	# enable breakpoints or watchpoints
+	enable )
+	  _Dbg_do_enable $args
+	  _Dbg_last_cmd='enable'
+	  ;;
+
 	# evaluate as shell command
 	eval )
 	  _Dbg_do_eval $@
@@ -258,13 +276,13 @@ _Dbg_onecmd() {
 
 	* ) 
 	   if (( _Dbg_autoeval )) ; then
-	     ! _Dbg_do_eval $_Dbg_cmd $args &amp;&amp; return -1
+	     ! _Dbg_do_eval $_Dbg_cmd $args &amp;&amp; return 255
 	   else
-             _Dbg_msg &quot;Undefined command: \&quot;$_Dbg_cmd\&quot;. Try \&quot;help\&quot;.&quot; 
+             _Dbg_undefined_cmd $_Dbg_cmd
 	     # _Dbg_remove_history_item
 	     # typeset -a last_history=(`history 1`)
 	     # history -d ${last_history[0]}
-	     return -1
+	     return 255
 	   fi
 	  ;;
       esac</diff>
      <filename>lib/processor.sh</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@
 /test-break.sh
 /test-columns.sh
 /test-dbg-opts.sh
+/test-file.sh
 /test-filecache.sh
 /test-fns.sh
 /test-frame.sh</diff>
      <filename>test/unit/.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -5,11 +5,11 @@ TESTS = test-alias.sh        \
 	test-break.sh        \
 	test-columns.sh      \
 	test-dbg-opts.sh     \
+	test-file.sh         \
 	test-filecache.sh    \
 	test-fns.sh          \
 	test-frame.sh        \
 	test-journal.sh      \
-	test-io.sh           \
 	test-pre.sh          \
 	test-run.sh          \
 	test-save-restore.sh \
@@ -29,7 +29,6 @@ EXTRA_DIST = $(TESTS) $(check_DATA) \
 	test-fns.sh.in              \
 	test-frame.sh.in            \
 	test-journal.sh.in          \
-	test-io.sh.in               \
 	test-pre.sh.in              \
 	test-run.sh.in              \
 	test-save-restore.sh.in     \</diff>
      <filename>test/unit/Makefile.am</filename>
    </modified>
    <modified>
      <diff>@@ -25,16 +25,16 @@ test_breakpoint()
 
     # Test parameter count checking for _Dbg_set_brkpt
     _Dbg_set_brkpt 
-    assertNotEquals '0' &quot;$?&quot;
+    assertNotEquals '_Dbg_set_brkpt no parms - should be bad' '0' &quot;$?&quot;
     _Dbg_set_brkpt 1 2 3 4 5
-    assertNotEquals '0' &quot;$?&quot;
+    assertNotEquals '_Dbg_set_brkpt parms - should be good' '0' &quot;$?&quot;
 
-    assertEquals 0 $_Dbg_brkpt_count
+    assertEquals '$_Dbg_brkpt_count should be 0' 0 $_Dbg_brkpt_count
 
     # This should work
     _Dbg_set_brkpt test.sh 5 0
     assertEquals 'Breakpoint 1 set in file test.sh, line 5.' &quot;${msgs[-1]}&quot; 
-    assertEquals 1 $_Dbg_brkpt_count
+    assertEquals '$_Dbg_brkpt_count should be 1' 1 $_Dbg_brkpt_count
     msgs=()
 
     # Test parameter count checking for _Dbg_unset_brkpt</diff>
      <filename>test/unit/test-break.sh.in</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,12 @@ test_msg()
     assertEquals 'fo ' &quot;$msg&quot;
 }
 
+test_undefined()
+{
+    typeset msg=$(_Dbg_undefined_cmd foo bar)
+    assertEquals 'Undefined foo command &quot;bar&quot;. Try &quot;help&quot;.' &quot;$msg&quot;
+}
+
 top_srcdir=@top_srcdir@
 . ${top_srcdir}/lib/msg.sh
 </diff>
      <filename>test/unit/test-msg.sh.in</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4e6b2449662d04ec03c89382dce3f96bd2a02353</id>
    </parent>
  </parents>
  <author>
    <name>R. Bernstein</name>
    <email>rocky@gnu.org</email>
  </author>
  <url>http://github.com/rocky/kshdb/commit/3f41480aa006669e2f382596bcf4f48cab056603</url>
  <id>3f41480aa006669e2f382596bcf4f48cab056603</id>
  <committed-date>2009-06-10T12:03:53-07:00</committed-date>
  <authored-date>2009-06-10T12:03:53-07:00</authored-date>
  <message> break.sh: use functions for better localization</message>
  <tree>156d01fe88466c3821ddddde45f90abb032b76e0</tree>
  <committer>
    <name>R. Bernstein</name>
    <email>rocky@gnu.org</email>
  </committer>
</commit>
