Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Debug - HowTo ?



Helmut Jarausch writes:
 > I would like to debug zsh with the multiline input problem.

There has to be something about this somewhere in the zsh-list archives,
because I reported it more than three years ago.

 > So I need a way to run zsh under a debugger such that the input to zsh
 > does not get confused with the input to the debugger.
 > Furthermore zsh must think it gets its input from a true xterm not from a 
 > standard input via the debugger.

function gdbterm () {
    xterm -title GDBterm -e sh -c "tty ; exec xterm -e gdb $*"
}

Running "gdbterm zsh" will produce two xterm windows, with gdb running
inside the second one.  The first one will display its tty name; suppose
for example that it is /dev/ttyXX.  In the xterm with the (gdb) prompt,
type

    run </dev/ttyXX >/dev/ttyXX 2>&1

and your zsh prompt will show up in the first xterm.

When you quit gdb, both xterms will disappear.

You can do this with other debuggers if they happen to understand full
redirection syntax.

Phil Pennock writes:
 > Unless you want to debug the initialisation too, start zsh in one xterm,
 > note its pid, attach to the running process with gdb in another window
 > (or using ddd).

If you're using ddd, the "run in terminal window" switch uses an xterm, so
you don't need any of this trickery.



Messages sorted by: Reverse Date, Date, Thread, Author