This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MI testsuite to use PTY for inferior


On Sun, Jul 31, 2005 at 10:16:31AM +1200, Nick Roberts wrote:
> Bob Rossi writes:
>  > > This seems to try to open a new pty even if inferior_pty is false.  Shouldn't
>  > > the condition, here and elsewhere, be:
>  > > 
>  > > if { $inferior_pty } {
>  > 
>  > I think this could be a style issue, but I'm not sure. I only create the
>  > inferior_pty variable if mi_gdb_start's INFERIOR_PTY is true. Then I
>  > check in later calls to see if the variable inferior_pty exists via
>  > 'info exists inferior_pty'. 
> 
> Perhaps I've not understood the context but what if somenone uses:
> 
> if {[mi_gdb_start false]} {
> 
> as a condition for a test?

Hi Nick,

Now I see your point, sorry I didn't see it earlier.

The code in mi_gdb_start,

    if { [llength $args] == 1} {
        set inferior_pty [lindex $args 0]
    }   

does not really do what I intended. Probably this would be closer.

    if { [llength $args] == 1} {
       if { [lindex $args 0] } {
        set inferior_pty true
       }
    }   

However, since that's pretty ugly, I'll take your suggestion and always
create and assign inferior_pty a value. Then I'll check it for the value
of "true" before executing any code.

Thanks again,
Bob Rossi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]