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: Need help adding a test in commands.exp


> The particular problem here is:
> 
> > +     send_gdb "run 1\n"
> > +     gdb_expect {
> > +         -re ".*factorial command-list executed.*1.*Program exited normally.*" {
> > +             pass "run factorial until breakpoint"
> > +         }
> > +         -re "" { fail "run factorial until breakpoint (no output)" }
> > +         timeout { fail "(timeout) run factorial until breakpoint" }
> > +     }
> 
> "" matches immediately, before the output has been produced.  You
> should explicitly match $gdb_prompt (which requires declaring it
> global).
> 
> There's some other problems here; you can't just send a "run" in the
> testsuite, and you can't require that the program accept arguments.
> Look for gdb_continue (I think) and a flag in the board description
> which describes whether argument passing works.

In case other dejagnu/expect newbies hit the problem:

Daniel's comment regarding ``send_gdb "run 1\n"'' was very pertinent.
I changed this line into ``gdb_run_cmd'' and that fixed the last FAIL.
Thanks again Daniel.

I shall create a PR and send a patch shortly.
-- 
Joel


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