blob: 2d2b65f54140b3ebe8f49097769a595b1b91ff4d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
other: 0.779
graphic: 0.775
performance: 0.722
semantic: 0.682
permissions: 0.681
network: 0.676
debug: 0.672
PID: 0.656
KVM: 0.649
vnc: 0.626
boot: 0.609
device: 0.609
socket: 0.591
files: 0.581
qemu-system-sparc singlestep not work in gdbstub
Debugging with gdb-stub does not work with qemu-system-sparc target
Qemu compiled from current git tree.
execution string: qemu-system-sparc.exe -s -S -m 256 -L Bios -hda
sparc.img -boot c
connect with telnet localhost 1234
enter '$s#73' (without quotes, this is single step command to gdb stub)
gdb stub reply '+' (without quotes, as it accept command)
After this qemu continuously execute instructions in single step mode
and does not exit to gdb stub after each executed instruction with
interrupt signal
("T%02xthread:%02x;" /gdb_vm_state_change in gdbstub.c/ );
If we look at target-sparc/translate.c, we can see that
gen_helper_debug() is not called in single step mode:
========================
if ((pc & TARGET_PAGE_MASK) == (tb->pc & TARGET_PAGE_MASK) &&
(npc & TARGET_PAGE_MASK) == (tb->pc & TARGET_PAGE_MASK) &&
!s->singlestep) {
/* jump to same page: we can use a direct jump */
tcg_gen_goto_tb(tb_num);
tcg_gen_movi_tl(cpu_pc, pc);
tcg_gen_movi_tl(cpu_npc, npc);
tcg_gen_exit_tb((long)tb + tb_num);
} else {
/* jump to another page: currently not optimized */
tcg_gen_movi_tl(cpu_pc, pc);
tcg_gen_movi_tl(cpu_npc, npc);
tcg_gen_exit_tb(0);
}
=========================
========================
/* if single step mode, we generate only one instruction and
generate an exception */
if (dc->singlestep) {
break;
}
========================
If we look similar code at target-sh4/translate.c we can see that is
called in this cases:
========================
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) &&
!ctx->singlestep_enabled) {
/* Use a direct jump if in same page and singlestep not enabled */
tcg_gen_goto_tb(n);
tcg_gen_movi_i32(cpu_pc, dest);
tcg_gen_exit_tb((long) tb + n);
} else {
tcg_gen_movi_i32(cpu_pc, dest);
if (ctx->singlestep_enabled)
gen_helper_debug();
tcg_gen_exit_tb(0);
}
========================
========================
if (tb->cflags & CF_LAST_IO)
gen_io_end();
if (env->singlestep_enabled) {
tcg_gen_movi_i32(cpu_pc, ctx.pc);
gen_helper_debug();
} else {
==========================
Triaging old bug reports ... Can you still reproduce this problem with the latest version of QEMU?
[Expired for QEMU because there has been no activity for 60 days.]
I'm sure this has been fixed years ago (and qemu-system-sparc single-step seems fine in local tests) so I'm marking this as "Fix released".
|