|
From: R. B. <ro...@pa...> - 2002-10-22 03:49:50
|
I was thinking about this problem and your patch some more. My mistake
before was trying to redirect stdout, not stderr. So a simple fix
would have just been to add "2>$_tty" to the "read" builtin when $_tty
is defined.
I don't think the builtin read needs to be changed at all.
Below is a patch that does just that. However.... when I run the
regression tests, test "misc" fails because lines don't appear:
prof1.cmd called
prof2.cmd called...
calling prof1.cmd...
prof1.cmd called
All of these are not printed from the shell test script, but instead
from the debugger command script which issues a debugger "print"
command for each of these.
It is then possble that _bashdb_cmd_source has bug in it, or at
minimum interacts funny with the code below. I think the problem is an
interaction between the "eval" a "read" command and the "exec" of
_bashdb_bash_source to reset the file descriptor.
Any thoughts or suggestions?
--- bashdb-cmds.inc.~1.72~ 2002-10-21 22:04:33.000000000 -0400
+++ bashdb-cmds.inc 2002-10-21 23:11:58.000000000 -0400
@@ -62,8 +62,16 @@
# Loop over debugger commands
IFS="$_bashdb_space_IFS";
- while read -e -p "bashdb${_bashdb_less}$_bashdb_hi${_bashdb_greater} " \
- _bashdb_cmd _bashdb_args <&$_bashdb_input_desc ; do
+
+ local _bashdb_redirect=''
+ if [[ -n "$_tty" ]] ; then
+ _bashdb_redirect="2>$_tty"
+ fi
+ local _bashdb_read_cmd=\
+"read -e -p 'bashdb${_bashdb_less}$_bashdb_hi${_bashdb_greater}' "\
+"_bashdb_cmd _bashdb_args <&$_bashdb_input_desc $_bashdb_redirect"
+
+ while eval $_bashdb_read_cmd ; do
# Set default next, step or skip command
if [[ -z $_bashdb_cmd ]]; then
|