diff mbox series

[v3,08/13] target/avr: Advance pc in avr_tr_breakpoint_check

Message ID 20210717221851.2124573-9-richard.henderson@linaro.org
State New
Headers show
Series tcg: breakpoint reorg | expand

Commit Message

Richard Henderson July 17, 2021, 10:18 p.m. UTC
Since 0b00b0c1e05b, tb->size must not be zero.
Advance pc so that the breakpoint covers the insn at the bp.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/avr/translate.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.25.1

Comments

Peter Maydell July 17, 2021, 11:33 p.m. UTC | #1
On Sat, 17 Jul 2021 at 23:18, Richard Henderson
<richard.henderson@linaro.org> wrote:
>

> Since 0b00b0c1e05b, tb->size must not be zero.

> Advance pc so that the breakpoint covers the insn at the bp.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/avr/translate.c | 1 +

>  1 file changed, 1 insertion(+)

>

> diff --git a/target/avr/translate.c b/target/avr/translate.c

> index 8237a03c23..d768063d65 100644

> --- a/target/avr/translate.c

> +++ b/target/avr/translate.c

> @@ -2950,6 +2950,7 @@ static bool avr_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cs,

>      DisasContext *ctx = container_of(dcbase, DisasContext, base);

>

>      gen_breakpoint(ctx);

> +    ctx->base.pc_next += 2; /* advance by minimum insn len so tb->size != 0 */

>      return true;

>  }


Reviewed-by: Peter Maydell <peter.maydell@linaro.org>


thanks
-- PMM
Philippe Mathieu-Daudé July 18, 2021, 7:54 a.m. UTC | #2
On 7/18/21 12:18 AM, Richard Henderson wrote:
> Since 0b00b0c1e05b, tb->size must not be zero.

> Advance pc so that the breakpoint covers the insn at the bp.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/avr/translate.c | 1 +

>  1 file changed, 1 insertion(+)


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Philippe Mathieu-Daudé July 19, 2021, 9:35 a.m. UTC | #3
On 7/18/21 12:18 AM, Richard Henderson wrote:
> Since 0b00b0c1e05b, tb->size must not be zero.

> Advance pc so that the breakpoint covers the insn at the bp.

> 


Resolves: https://gitlab.com/qemu-project/qemu/-/issues/489

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/avr/translate.c | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/target/avr/translate.c b/target/avr/translate.c

> index 8237a03c23..d768063d65 100644

> --- a/target/avr/translate.c

> +++ b/target/avr/translate.c

> @@ -2950,6 +2950,7 @@ static bool avr_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cs,

>      DisasContext *ctx = container_of(dcbase, DisasContext, base);

>  

>      gen_breakpoint(ctx);

> +    ctx->base.pc_next += 2; /* advance by minimum insn len so tb->size != 0 */

>      return true;

>  }

>  

>
diff mbox series

Patch

diff --git a/target/avr/translate.c b/target/avr/translate.c
index 8237a03c23..d768063d65 100644
--- a/target/avr/translate.c
+++ b/target/avr/translate.c
@@ -2950,6 +2950,7 @@  static bool avr_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cs,
     DisasContext *ctx = container_of(dcbase, DisasContext, base);
 
     gen_breakpoint(ctx);
+    ctx->base.pc_next += 2; /* advance by minimum insn len so tb->size != 0 */
     return true;
 }