[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ddd/dbx wrongly add command line arguments
From: |
Andreas Zeller |
Subject: |
Re: ddd/dbx wrongly add command line arguments |
Date: |
20 Dec 2000 20:53:25 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
Tuomo Takkula <tuomo@cs.chalmers.se> writes:
> If invoked with dbx as minor debugger ddd changes the command
> line arguments by adding things like like ">2 tty" to it. I think this is
> a bug. argv[argc+1] is supposed to be '\0' according to the C standard and
> some (my) programs expect that this remains so.
The enclosed patch should make DDD work again; please let me know if
it works. As a temporary workaround, you can disable the redirection
by running your program in the console (instead of the execution
window).
Best wishes,
Andreas
Index: exectty.C
===================================================================
RCS file: /cvsroot/ddd/ddd/ddd/exectty.C,v
retrieving revision 1.65
diff -c -r1.65 exectty.C
*** exectty.C 2000/12/19 15:45:49 1.65
--- exectty.C 2000/12/20 19:52:03
***************
*** 624,651 ****
}
case DBX:
! // DBX has its own parsing, in several variants.
! if (gdb->has_print_r_option())
{
- // SUN DBX 3.x interprets `COMMAND 2>&1' such that COMMAND
- // runs in the background. Use this kludge instead.
- // Tuomo Takkula <tuomo@cs.chalmers.se> reports this also
- // happens for SUN DBX 4.0.
-
- if (!has_redirection(args, "2>"))
- gdb_redirection += " 2> " + tty_name;
- if (!has_redirection(args, ">"))
- gdb_redirection += " > " + tty_name;
- }
- else if (gdb->has_err_redirection())
- {
// DEC DBX and AIX DBX use csh-style redirection.
if (!has_redirection(args, ">"))
gdb_redirection += " >& " + tty_name;
}
else
{
! // SUN DBX 1.x does not allow to redirect stderr. Play it safe.
if (!has_redirection(args, ">"))
gdb_redirection += " > " + tty_name;
}
--- 624,644 ----
}
case DBX:
! if (gdb->has_err_redirection())
{
// DEC DBX and AIX DBX use csh-style redirection.
if (!has_redirection(args, ">"))
gdb_redirection += " >& " + tty_name;
}
else
{
! // SUN DBX 3.x interprets `COMMAND 2>&1' such that COMMAND
! // runs in the background.
!
! // Tuomo Takkula <tuomo@cs.chalmers.se> reports that SUN DBX
! // (4.0 and later) cannot even parse '2>' properly.
!
! // Consequence: Play it safe. Do not redirect stderr.
if (!has_redirection(args, ">"))
gdb_redirection += " > " + tty_name;
}
--
Andreas Zeller Universitaet Passau
http://www.fmi.uni-passau.de/st/staff/zeller/