Re: [PATCH] add -s option to make -break-insert support dprintf

Yao Qi
2013-04-20T08:20:19Z

On 04/15/2013 10:57 PM, Hui Zhu wrote:
> + mi_run_cmd
> + set msg "mi 1st dprintf"
> + gdb_expect {
> + -re ".*At foo entry.*arg=1234, g=1234.*" {

Hui,
Probably we need to remove the trailing ".*" above. Then, the rest of
the output will be matched ...

> + pass $msg
> + }
> + -re ".*$mi_gdb_prompt$" {
> + fail $msg
> + }
> + timeout {
> + fail $msg
> + }
> + }
> + mi_expect_stop ".*" ".*" ".*" ".*" ".*" "" "$msg stop"

... here.

> +
> + set msg "mi 2nd dprintf"
> + mi_send_resuming_command "exec-continue" "$msg continue"
> + gdb_expect {
> + -re ".*At foo entry.*arg=1235, g=2222.*" {

We need append "$mi_gdb_prompt$" to the end of the pattern above to eat
all the output, otherwise, these output will make troubles to the rest
of the tests.

> + pass $msg
> + }
> + -re ".*$mi_gdb_prompt$" {
> + fail $msg
> + }
> + timeout {
> + fail $msg
> + }
> + }

I can get some fails on my machine, similar to fails that Pedro pointed
out. With these change above, I don't see fails any more.

b.t.w,

+# To make sure set dprintf-style agent get right output.
+mi_gdb_test "pwd" ".*"

This line is odd to me, and looks it only papers over the problem
somewhere else.

--
Yao (é½å°§)