This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH] fix record "run" regression


On 07/11/2014 06:26 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
> 
> Pedro> The comment is stale now.  If we can indeed use gdb_run_cmd,
> Pedro> then I don't think we need the $use_gdb_stub check?
> 
> The use_gdb_stub check is there so that we skip the test on target
> remote, which I think shouldn't be expected to work, as you can't re-run
> there.  But I think I must be missing something.

It was explained in the sentence just below:

> That gets us coverage for "target rem; record; target rem;"
> too.

... because gdb_run_cmd does "target remote" instead of "run"
against remote targets.

In general, if we can write a test in a way that runs against
any target, it's best to not restrict it, even if what is
tested against some target board isn't exactly the bug the
test was written for, as it gives us wider coverage.

In this case, if we write:

 gdb_run_cmd
 gdb_test_multiple "" "restarting inferior" {
     -re "Breakpoint .* main .*${gdb_prompt} " {
 	pass "restarting inferior"
     }
 }

We'll still make sure that "run; record; run" works,
but in addition, we'll also make sure that
"target rem; record; target rem" (and likewise target sim
or whatever means gdb_run_cmd uses to spawn a particular
target) works too.

-- 
Pedro Alves


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