Skip to contentSkip to conversation

About QEMU debugging console

Qemu-devel Zhiyuan Shao 6 participants 10 messages Oct 26, 2010 – Oct 31, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi team,

I am a Qemu User, and using Qemu 0.13.0 to debugging the linux kernel code (Qemu+GDB).

During the usage, I found the Qemu debugging console (i.e., entered by pressing Ctl+Alt+2 in Qemu SDL window or by passing "-monitor stdio" to Qemu in the command line) is rather difficult to use. It can not show some important information, e.g., on i386 platform, which is my major interest, it can not show IDT, GDT information. Regarding the page mapping information, "info tlb" actually do a really bad job.

On this side, I think Bochs is good. Unfortunately, it seems do not support gdb-stub debugging and general purpose debugging at the same time.

I do not know if the Qemu team had made any plans to improve this? such as embedding the bochs debugging alike functionalities in future Qemu releases?

Thanks!
Zhiyuan

#1 lore raw
Quoted 11 lines · Zhiyuan Shao

Hi team,

I am a Qemu User, and using Qemu 0.13.0 to debugging the linux kernel code (Qemu+GDB).

During the usage, I found the Qemu debugging console (i.e., entered by pressing Ctl+Alt+2 in Qemu SDL window or by passing "-monitor stdio" to Qemu in the command line) is rather difficult to use. It can not show some important information, e.g., on i386 platform, which is my major interest, it can not show IDT, GDT information. Regarding the page mapping information, "info tlb" actually do a really bad job.

How is that bad?

Quoted 7 lines

On this side, I think Bochs is good. Unfortunately, it seems do not support gdb-stub debugging and general purpose debugging at the same time.

I do not know if the Qemu team had made any plans to improve this? such as embedding the bochs debugging alike functionalities in future Qemu releases?

Perhaps nobody were aware that there were any lack of functionalities. I think these should be very easy to add.

#2 lore raw
Quoted 6 lines · Blue Swirl
Quoted 5 lines · Zhiyuan Shao

Hi team,

I am a Qemu User, and using Qemu 0.13.0 to debugging the linux kernel code (Qemu+GDB).

Quoted 9 lines
Quoted 6 lines

During the usage, I found the Qemu debugging console (i.e., entered by pressing Ctl+Alt+2 in Qemu SDL window or by passing "-monitor stdio" to Qemu in the command line) is rather difficult to use. It can not show some important information, e.g., on i386 platform, which is my major interest, it can not show IDT, GDT information. Regarding the page mapping information, "info tlb" actually do a really bad job.

How is that bad?

I booted a Linux OS (i386 with PAE support), and has following virtual-to-physical mappings:
[0xff00-0000,0xffbf-ffff] -> [0x0000-0000, 0x00bf-ffff] [0x0000-0000,0x00ff-ffff] -> [0x0000-0000, 0x00ff-ffff]

while now, with "info mem" command of Qemu debugging console, the output is like:
(qemu) info mem
00000000-00400000 00400000 -r-
00c00000-00c08000 00008000 -rw
00c08000-00c09000 00001000 ur-
00c09000-00c0a000 00001000 urw
00c0e000-00c0f000 00001000 urw
00c10000-00c11000 00001000 -r-
00c11000-00c12000 00001000 ur-
00c12000-00c13000 00001000 -r-
00c14000-00c16000 00002000 -r-
00c1b000-00c1e000 00003000 -rw
00c20000-00c40000 00020000 -rw
00c40000-00c41000 00001000 -r-
00c41000-00c42000 00001000 ur-
00c42000-00c43000 00001000 -rw
00c44000-00c60000 0001c000 -rw
00c67000-00c70000 00009000 -rw
00c71000-00c74000 00003000 ur-
00c75000-00c76000 00001000 urw
00c77000-00c78000 00001000 ur-
00c78000-00c79000 00001000 -rw
00c7a000-00d00000 00086000 -rw
00d18000-00d19000 00001000 urw
00d19000-00d1a000 00001000 -rw
00d1d000-00d1e000 00001000 -r-
00d22000-00d23000 00001000 -r-
00d2a000-00d2b000 00001000 -rw
00df0000-00df1000 00001000 -r-
00df1000-00df2000 00001000 urw
00df4000-00df5000 00001000 -r-
00df5000-00df6000 00001000 urw
00df7000-00df8000 00001000 urw
01000000-01400000 00400000 -rw
01400000-01800000 00400000 -r-
01800000-01c00000 00400000 urw
01c00000-02000000 00400000 -rw
04c00000-05000000 00400000 ur-
05c00000-06000000 00400000 -rw
0bc00000-0c000000 00400000 -r-
0c800000-0cc00000 00400000 urw
0d800000-0e000000 00800000 ur-
0e400000-0e800000 00400000 ur-
10400000-10800000 00400000 -rw
12000000-12001000 00001000 -rw
12002000-12003000 00001000 -rw
12004000-12005000 00001000 -rw
12006000-12007000 00001000 -rw
12008000-12009000 00001000 -rw
1200a000-1200b000 00001000 -rw
1200c000-1200d000 00001000 -rw
1200e000-1200f000 00001000 -rw
13bf0000-13bf1000 00001000 -rw
13bf2000-13bf3000 00001000 -rw
13bf4000-13bf5000 00001000 -rw
13bf6000-13bf7000 00001000 -rw
13bf8000-13bf9000 00001000 -rw
13bfa000-13bfb000 00001000 -rw

Donot know what the "active virtual memory mappings" means for "info mem" command, but the results displayed is not very likely being correct.

While with "info tlb" command:

(qemu) info tlb
00000000: 15c00000 -PDA-T--
00c00000: f000f000 G-D-C--W
00c01000: f000f000 G-D-C--W
00c02000: f000e000 --D----W
00c03000: f000f000 G-D-C--W
00c04000: f000f000 G-D-C--W
00c05000: f000f000 G-D-C--W
00c06000: f000f000 G-D-C--W
00c07000: f000f000 G-D-C--W
00c08000: f000f000 ---A--U-
00c09000: f000e000 G-----UW
00c0e000: f000e000 G-D-C-UW
00c10000: c0008000 G--ACT--
00c11000: f000f000 --D--TU-
00c12000: f000f000 --D-----
00c14000: f000e000 G--ACT--
00c15000: f000f000 --D-CT--
00c1b000: f000f000 G-D-C--W
00c1c000: f000f000 G-D-C--W
00c1d000: f000f000 G-D-C--W
00c20000: f000f000 G-D-C--W
00c21000: f000f000 G-D-C--W
00c22000: f000f000 G-D-C--W
00c23000: f000f000 G-D-C--W
00c24000: f000f000 G-D-C--W
00c25000: f000f000 G-D-C--W
00c26000: f000f000 G-D-C--W
00c27000: f000f000 G-D-C--W
00c28000: f000f000 G-D-C--W
00c29000: f000f000 G-D-C--W
00c2a000: f000f000 G-D-C--W
00c2b000: f000f000 G-D-C--W
00c2c000: f000f000 G-D-C--W
00c2d000: f000f000 G-D-C--W
00c2e000: f000f000 G-D-C--W
00c2f000: f000f000 G-D-C--W
00c30000: f000f000 G-D-C--W
00c31000: f000f000 G-D-C--W
00c32000: f000f000 G-D-C--W
00c33000: f000f000 G-D-C--W
00c34000: f000f000 G-D-C--W
00c35000: f000f000 G-D-C--W
00c36000: f000f000 G-D-C--W
00c37000: f000f000 G-D-C--W
00c38000: f000f000 G-D-C--W
00c39000: f000f000 G-D-C--W
00c3a000: f000f000 G-D-C--W
00c3b000: f000f000 G-D-C--W
00c3c000: f000f000 G-D-C--W
00c3d000: f000f000 G-D-C--W
00c3e000: f000f000 G-D-C--W
00c3f000: f000f000 G-D-C--W
00c40000: f000e000 --D-CT--
00c41000: 9fc00000 ---ACTU-
00c42000: f000f000 G-D-C--W
00c44000: f000f000 G-D-C--W
00c45000: f000f000 G-D-C--W
00c46000: f000f000 G-D-C--W
00c47000: f000f000 G-D-C--W
00c48000: f000f000 G-D-C--W
00c49000: f000f000 G-D-C--W
00c4a000: f000f000 G-D-C--W
00c4b000: f000f000 G-D-C--W
00c4c000: f000f000 G-D-C--W
00c4d000: f000f000 G-D-C--W
00c4e000: f000f000 G-D-C--W
00c4f000: f000f000 G-D-C--W
00c50000: f000f000 G-D-C--W
00c51000: f000f000 G-D-C--W
00c52000: f000f000 G-D-C--W
00c53000: f000f000 G-D-C--W
00c54000: f000f000 G-D-C--W
00c55000: f000f000 G-D-C--W
00c56000: f000f000 G-D-C--W
00c57000: f000f000 G-D-C--W
00c58000: f000f000 G-D-C--W
00c59000: f000f000 G-D-C--W
00c5a000: f000f000 G-D-C--W
00c5b000: f000f000 G-D-C--W
00c5c000: f000f000 G-D-C--W
00c5d000: f000f000 G-D-C--W
00c5e000: f000f000 G-D-C--W
00c5f000: f000f000 G-D-C--W
00c67000: f000f000 G-D-C--W
00c68000: f000f000 G-D-C--W
00c69000: f000f000 G-D-C--W
00c6a000: f000f000 G-D-C--W
00c6b000: f000f000 G-D-C--W
00c6c000: f000f000 G-D-C--W
00c6d000: f000f000 G-D-C--W
00c6e000: f000f000 G-D-C--W
00c6f000: f000f000 G-D-C--W
00c71000: f000f000 G-D---U-
00c72000: f000f000 G-D---U-
00c73000: f000f000 G-D---U-
00c75000: f000e000 --DA--UW
00c77000: f000f000 G-D---U-
00c78000: f000f000 G-D-C--W
00c7a000: f000f000 G-D-C--W
00c7b000: f000f000 G-D-C--W
00c7c000: f000f000 G-D-C--W
00c7d000: f000f000 G-D-C--W
00c7e000: f000f000 G-D-C--W
00c7f000: f000f000 G-D-C--W
00c80000: f000f000 G-D-C--W
00c81000: f000f000 G-D-C--W
00c82000: f000f000 G-D-C--W
00c83000: f000f000 G-D-C--W
00c84000: f000f000 G-D-C--W
00c85000: f000f000 G-D-C--W
00c86000: f000f000 G-D-C--W
00c87000: f000f000 G-D-C--W
00c88000: f000f000 G-D-C--W
00c89000: f000f000 G-D-C--W
00c8a000: f000f000 G-D-C--W
00c8b000: f000f000 G-D-C--W
00c8c000: f000f000 G-D-C--W
00c8d000: f000f000 G-D-C--W
00c8e000: f000f000 G-D-C--W
00c8f000: f000f000 G-D-C--W
00c90000: f000f000 G-D-C--W
00c91000: f000f000 G-D-C--W
00c92000: f000f000 G-D-C--W
00c93000: f000f000 G-D-C--W
00c94000: f000f000 G-D-C--W
00c95000: f000f000 G-D-C--W
00c96000: f000f000 G-D-C--W
00c97000: f000f000 G-D-C--W
00c98000: f000f000 G-D-C--W
00c99000: f000f000 G-D-C--W
00c9a000: f000f000 G-D-C--W
00c9b000: f000f000 G-D-C--W
00c9c000: f000f000 G-D-C--W
00c9d000: f000f000 G-D-C--W
00c9e000: f000f000 G-D-C--W
00c9f000: f000f000 G-D-C--W
00ca0000: f000f000 G-D-C--W
00ca1000: f000f000 G-D-C--W
00ca2000: f000f000 G-D-C--W
00ca3000: f000f000 G-D-C--W
00ca4000: f000f000 G-D-C--W
00ca5000: f000f000 G-D-C--W
00ca6000: f000f000 G-D-C--W
00ca7000: f000f000 G-D-C--W
00ca8000: f000f000 G-D-C--W
00ca9000: f000f000 G-D-C--W
00caa000: f000f000 G-D-C--W
00cab000: f000f000 G-D-C--W
00cac000: f000f000 G-D-C--W
00cad000: f000f000 G-D-C--W
00cae000: f000f000 G-D-C--W
00caf000: f000f000 G-D-C--W
00cb0000: f000f000 G-D-C--W
00cb1000: f000f000 G-D-C--W
00cb2000: f000f000 G-D-C--W
00cb3000: f000f000 G-D-C--W
00cb4000: f000f000 G-D-C--W
00cb5000: f000f000 G-D-C--W
00cb6000: f000f000 G-D-C--W
00cb7000: f000f000 G-D-C--W
00cb8000: f000f000 G-D-C--W
00cb9000: f000f000 G-D-C--W
00cba000: f000f000 G-D-C--W
00cbb000: f000f000 G-D-C--W
00cbc000: f000f000 G-D-C--W
00cbd000: f000f000 G-D-C--W
00cbe000: f000f000 G-D-C--W
00cbf000: f000f000 G-D-C--W
00cc0000: f000f000 G-D-C--W
00cc1000: f000f000 G-D-C--W
00cc2000: f000f000 G-D-C--W
00cc3000: f000f000 G-D-C--W
00cc4000: f000f000 G-D-C--W
00cc5000: f000f000 G-D-C--W
00cc6000: f000f000 G-D-C--W
00cc7000: f000f000 G-D-C--W
00cc8000: f000f000 G-D-C--W
00cc9000: f000f000 G-D-C--W
00cca000: f000f000 G-D-C--W
00ccb000: f000f000 G-D-C--W
00ccc000: f000f000 G-D-C--W
00ccd000: f000f000 G-D-C--W
00cce000: f000f000 G-D-C--W
00ccf000: f000f000 G-D-C--W
00cd0000: f000f000 G-D-C--W
00cd1000: f000f000 G-D-C--W
00cd2000: f000f000 G-D-C--W
00cd3000: f000f000 G-D-C--W
00cd4000: f000f000 G-D-C--W
00cd5000: f000f000 G-D-C--W
00cd6000: f000f000 G-D-C--W
00cd7000: f000f000 G-D-C--W
00cd8000: f000f000 G-D-C--W
00cd9000: f000f000 G-D-C--W
00cda000: f000f000 G-D-C--W
00cdb000: f000f000 G-D-C--W
00cdc000: f000f000 G-D-C--W
00cdd000: f000f000 G-D-C--W
00cde000: f000f000 G-D-C--W
00cdf000: f000f000 G-D-C--W
00ce0000: f000f000 G-D-C--W
00ce1000: f000f000 G-D-C--W
00ce2000: f000f000 G-D-C--W
00ce3000: f000f000 G-D-C--W
00ce4000: f000f000 G-D-C--W
00ce5000: f000f000 G-D-C--W
00ce6000: f000f000 G-D-C--W
00ce7000: f000f000 G-D-C--W
00ce8000: f000f000 G-D-C--W
00ce9000: f000f000 G-D-C--W
00cea000: f000f000 G-D-C--W
00ceb000: f000f000 G-D-C--W
00cec000: f000f000 G-D-C--W
00ced000: f000f000 G-D-C--W
00cee000: f000f000 G-D-C--W
00cef000: f000f000 G-D-C--W
00cf0000: f000f000 G-D-C--W
00cf1000: f000f000 G-D-C--W
00cf2000: f000f000 G-D-C--W
00cf3000: f000f000 G-D-C--W
00cf4000: f000f000 G-D-C--W
00cf5000: f000f000 G-D-C--W
00cf6000: f000f000 G-D-C--W
00cf7000: f000f000 G-D-C--W
00cf8000: f000f000 G-D-C--W
00cf9000: f000f000 G-D-C--W
00cfa000: f000f000 G-D-C--W
00cfb000: f000f000 G-D-C--W
00cfc000: f000f000 G-D-C--W
00cfd000: f000f000 G-D-C--W
00cfe000: f000f000 G-D-C--W
00cff000: f000f000 G-D-C--W
00d18000: d4000000 ------UW
00d19000: 00000000 -------W
00d1d000: 00c00000 G-------
00d22000: 00085000 G-DACT--
00d2a000: c0003000 G--A---W
00df0000: fe830000 --------
00df1000: 003f7000 G-DACTUW
00df4000: fe827000 --D-----
00df5000: a87cb000 --DACTUW
00df7000: 00000000 -----TUW
01000000: e4500000 GPDACT-W
01400000: 24500000 -P-A----
01800000: e0200000 GPDACTUW
01c00000: 00e00000 GP---T-W
04c00000: b8a00000 GP---TU-
05c00000: e2000000 GP-----W
0bc00000: 75f00000 GP---T--
0c800000: 13e00000 -PDACTUW
0d800000: 90f00000 GPDA--U-
0dc00000: 00200000 -P---TU-
0e400000: 00000000 -P---TU-
10400000: 90900000 -PDA-T-W
12000000: 002a8000 --DA---W
12002000: 00200000 --DA---W
12004000: 00400000 --DA---W
12006000: 00600000 --DA---W
12008000: 00800000 --DA---W
1200a000: 00a00000 --DA---W
1200c000: 00c00000 --DA---W
1200e000: 00e00000 --DA---W
13bf0000: 002a8000 --DA---W
13bf2000: 00200000 --DA---W
13bf4000: 00400000 --DA---W
13bf6000: 00600000 --DA---W
13bf8000: 00800000 --DA---W
13bfa000: 00a00000 --DA---W
(qemu)

Is here someone can explain such output?

Quoted 11 lines
Quoted 7 lines

On this side, I think Bochs is good. Unfortunately, it seems do not support gdb-stub debugging and general purpose debugging at the same time.

I do not know if the Qemu team had made any plans to improve this? such as embedding the bochs debugging alike functionalities in future Qemu releases?

Perhaps nobody were aware that there were any lack of functionalities. I think these should be very easy to add.

This should be not so hard, and I may have a try in the close future. The difficulty here is that you have to consider several paging techniques invented by Intel, such as, i386, PAE, PSE(36), x86_64. And these works ONLY for the i386 platform.

I just wondering: It is for sure that I am not the very first person who encounter such problems in the history of Qemu development. Why these simple functionalities were not added to the main release till now?

Thank!

#3 lore raw
Quoted 358 lines · Zhiyuan Shao
Quoted 6 lines · Blue Swirl
Quoted 5 lines · Zhiyuan Shao

Hi team,

I am a Qemu User, and using Qemu 0.13.0 to debugging the linux kernel code (Qemu+GDB).

Quoted 9 lines
Quoted 6 lines

During the usage, I found the Qemu debugging console (i.e., entered by pressing Ctl+Alt+2 in Qemu SDL window or by passing "-monitor stdio" to Qemu in the command line) is rather difficult to use. It can not show some important information, e.g., on i386 platform, which is my major interest, it can not show IDT, GDT information. Regarding the page mapping information, "info tlb" actually do a really bad job.

How is that bad?

I booted a Linux OS (i386 with PAE support), and has following virtual-to-physical mappings:
[0xff00-0000,0xffbf-ffff] -> [0x0000-0000, 0x00bf-ffff] [0x0000-0000,0x00ff-ffff] -> [0x0000-0000, 0x00ff-ffff]

while now, with "info mem" command of Qemu debugging console, the output is like:
(qemu) info mem
00000000-00400000 00400000 -r-
00c00000-00c08000 00008000 -rw
00c08000-00c09000 00001000 ur-
00c09000-00c0a000 00001000 urw
00c0e000-00c0f000 00001000 urw
00c10000-00c11000 00001000 -r-
00c11000-00c12000 00001000 ur-
00c12000-00c13000 00001000 -r-
00c14000-00c16000 00002000 -r-
00c1b000-00c1e000 00003000 -rw
00c20000-00c40000 00020000 -rw
00c40000-00c41000 00001000 -r-
00c41000-00c42000 00001000 ur-
00c42000-00c43000 00001000 -rw
00c44000-00c60000 0001c000 -rw
00c67000-00c70000 00009000 -rw
00c71000-00c74000 00003000 ur-
00c75000-00c76000 00001000 urw
00c77000-00c78000 00001000 ur-
00c78000-00c79000 00001000 -rw
00c7a000-00d00000 00086000 -rw
00d18000-00d19000 00001000 urw
00d19000-00d1a000 00001000 -rw
00d1d000-00d1e000 00001000 -r-
00d22000-00d23000 00001000 -r-
00d2a000-00d2b000 00001000 -rw
00df0000-00df1000 00001000 -r-
00df1000-00df2000 00001000 urw
00df4000-00df5000 00001000 -r-
00df5000-00df6000 00001000 urw
00df7000-00df8000 00001000 urw
01000000-01400000 00400000 -rw
01400000-01800000 00400000 -r-
01800000-01c00000 00400000 urw
01c00000-02000000 00400000 -rw
04c00000-05000000 00400000 ur-
05c00000-06000000 00400000 -rw
0bc00000-0c000000 00400000 -r-
0c800000-0cc00000 00400000 urw
0d800000-0e000000 00800000 ur-
0e400000-0e800000 00400000 ur-
10400000-10800000 00400000 -rw
12000000-12001000 00001000 -rw
12002000-12003000 00001000 -rw
12004000-12005000 00001000 -rw
12006000-12007000 00001000 -rw
12008000-12009000 00001000 -rw
1200a000-1200b000 00001000 -rw
1200c000-1200d000 00001000 -rw
1200e000-1200f000 00001000 -rw
13bf0000-13bf1000 00001000 -rw
13bf2000-13bf3000 00001000 -rw
13bf4000-13bf5000 00001000 -rw
13bf6000-13bf7000 00001000 -rw
13bf8000-13bf9000 00001000 -rw
13bfa000-13bfb000 00001000 -rw

Donot know what the "active virtual memory mappings" means for "info mem" command, but the results displayed is not very likely being correct.

While with "info tlb" command:

(qemu) info tlb
00000000: 15c00000 -PDA-T--
00c00000: f000f000 G-D-C--W
00c01000: f000f000 G-D-C--W
00c02000: f000e000 --D----W
00c03000: f000f000 G-D-C--W
00c04000: f000f000 G-D-C--W
00c05000: f000f000 G-D-C--W
00c06000: f000f000 G-D-C--W
00c07000: f000f000 G-D-C--W
00c08000: f000f000 ---A--U-
00c09000: f000e000 G-----UW
00c0e000: f000e000 G-D-C-UW
00c10000: c0008000 G--ACT--
00c11000: f000f000 --D--TU-
00c12000: f000f000 --D-----
00c14000: f000e000 G--ACT--
00c15000: f000f000 --D-CT--
00c1b000: f000f000 G-D-C--W
00c1c000: f000f000 G-D-C--W
00c1d000: f000f000 G-D-C--W
00c20000: f000f000 G-D-C--W
00c21000: f000f000 G-D-C--W
00c22000: f000f000 G-D-C--W
00c23000: f000f000 G-D-C--W
00c24000: f000f000 G-D-C--W
00c25000: f000f000 G-D-C--W
00c26000: f000f000 G-D-C--W
00c27000: f000f000 G-D-C--W
00c28000: f000f000 G-D-C--W
00c29000: f000f000 G-D-C--W
00c2a000: f000f000 G-D-C--W
00c2b000: f000f000 G-D-C--W
00c2c000: f000f000 G-D-C--W
00c2d000: f000f000 G-D-C--W
00c2e000: f000f000 G-D-C--W
00c2f000: f000f000 G-D-C--W
00c30000: f000f000 G-D-C--W
00c31000: f000f000 G-D-C--W
00c32000: f000f000 G-D-C--W
00c33000: f000f000 G-D-C--W
00c34000: f000f000 G-D-C--W
00c35000: f000f000 G-D-C--W
00c36000: f000f000 G-D-C--W
00c37000: f000f000 G-D-C--W
00c38000: f000f000 G-D-C--W
00c39000: f000f000 G-D-C--W
00c3a000: f000f000 G-D-C--W
00c3b000: f000f000 G-D-C--W
00c3c000: f000f000 G-D-C--W
00c3d000: f000f000 G-D-C--W
00c3e000: f000f000 G-D-C--W
00c3f000: f000f000 G-D-C--W
00c40000: f000e000 --D-CT--
00c41000: 9fc00000 ---ACTU-
00c42000: f000f000 G-D-C--W
00c44000: f000f000 G-D-C--W
00c45000: f000f000 G-D-C--W
00c46000: f000f000 G-D-C--W
00c47000: f000f000 G-D-C--W
00c48000: f000f000 G-D-C--W
00c49000: f000f000 G-D-C--W
00c4a000: f000f000 G-D-C--W
00c4b000: f000f000 G-D-C--W
00c4c000: f000f000 G-D-C--W
00c4d000: f000f000 G-D-C--W
00c4e000: f000f000 G-D-C--W
00c4f000: f000f000 G-D-C--W
00c50000: f000f000 G-D-C--W
00c51000: f000f000 G-D-C--W
00c52000: f000f000 G-D-C--W
00c53000: f000f000 G-D-C--W
00c54000: f000f000 G-D-C--W
00c55000: f000f000 G-D-C--W
00c56000: f000f000 G-D-C--W
00c57000: f000f000 G-D-C--W
00c58000: f000f000 G-D-C--W
00c59000: f000f000 G-D-C--W
00c5a000: f000f000 G-D-C--W
00c5b000: f000f000 G-D-C--W
00c5c000: f000f000 G-D-C--W
00c5d000: f000f000 G-D-C--W
00c5e000: f000f000 G-D-C--W
00c5f000: f000f000 G-D-C--W
00c67000: f000f000 G-D-C--W
00c68000: f000f000 G-D-C--W
00c69000: f000f000 G-D-C--W
00c6a000: f000f000 G-D-C--W
00c6b000: f000f000 G-D-C--W
00c6c000: f000f000 G-D-C--W
00c6d000: f000f000 G-D-C--W
00c6e000: f000f000 G-D-C--W
00c6f000: f000f000 G-D-C--W
00c71000: f000f000 G-D---U-
00c72000: f000f000 G-D---U-
00c73000: f000f000 G-D---U-
00c75000: f000e000 --DA--UW
00c77000: f000f000 G-D---U-
00c78000: f000f000 G-D-C--W
00c7a000: f000f000 G-D-C--W
00c7b000: f000f000 G-D-C--W
00c7c000: f000f000 G-D-C--W
00c7d000: f000f000 G-D-C--W
00c7e000: f000f000 G-D-C--W
00c7f000: f000f000 G-D-C--W
00c80000: f000f000 G-D-C--W
00c81000: f000f000 G-D-C--W
00c82000: f000f000 G-D-C--W
00c83000: f000f000 G-D-C--W
00c84000: f000f000 G-D-C--W
00c85000: f000f000 G-D-C--W
00c86000: f000f000 G-D-C--W
00c87000: f000f000 G-D-C--W
00c88000: f000f000 G-D-C--W
00c89000: f000f000 G-D-C--W
00c8a000: f000f000 G-D-C--W
00c8b000: f000f000 G-D-C--W
00c8c000: f000f000 G-D-C--W
00c8d000: f000f000 G-D-C--W
00c8e000: f000f000 G-D-C--W
00c8f000: f000f000 G-D-C--W
00c90000: f000f000 G-D-C--W
00c91000: f000f000 G-D-C--W
00c92000: f000f000 G-D-C--W
00c93000: f000f000 G-D-C--W
00c94000: f000f000 G-D-C--W
00c95000: f000f000 G-D-C--W
00c96000: f000f000 G-D-C--W
00c97000: f000f000 G-D-C--W
00c98000: f000f000 G-D-C--W
00c99000: f000f000 G-D-C--W
00c9a000: f000f000 G-D-C--W
00c9b000: f000f000 G-D-C--W
00c9c000: f000f000 G-D-C--W
00c9d000: f000f000 G-D-C--W
00c9e000: f000f000 G-D-C--W
00c9f000: f000f000 G-D-C--W
00ca0000: f000f000 G-D-C--W
00ca1000: f000f000 G-D-C--W
00ca2000: f000f000 G-D-C--W
00ca3000: f000f000 G-D-C--W
00ca4000: f000f000 G-D-C--W
00ca5000: f000f000 G-D-C--W
00ca6000: f000f000 G-D-C--W
00ca7000: f000f000 G-D-C--W
00ca8000: f000f000 G-D-C--W
00ca9000: f000f000 G-D-C--W
00caa000: f000f000 G-D-C--W
00cab000: f000f000 G-D-C--W
00cac000: f000f000 G-D-C--W
00cad000: f000f000 G-D-C--W
00cae000: f000f000 G-D-C--W
00caf000: f000f000 G-D-C--W
00cb0000: f000f000 G-D-C--W
00cb1000: f000f000 G-D-C--W
00cb2000: f000f000 G-D-C--W
00cb3000: f000f000 G-D-C--W
00cb4000: f000f000 G-D-C--W
00cb5000: f000f000 G-D-C--W
00cb6000: f000f000 G-D-C--W
00cb7000: f000f000 G-D-C--W
00cb8000: f000f000 G-D-C--W
00cb9000: f000f000 G-D-C--W
00cba000: f000f000 G-D-C--W
00cbb000: f000f000 G-D-C--W
00cbc000: f000f000 G-D-C--W
00cbd000: f000f000 G-D-C--W
00cbe000: f000f000 G-D-C--W
00cbf000: f000f000 G-D-C--W
00cc0000: f000f000 G-D-C--W
00cc1000: f000f000 G-D-C--W
00cc2000: f000f000 G-D-C--W
00cc3000: f000f000 G-D-C--W
00cc4000: f000f000 G-D-C--W
00cc5000: f000f000 G-D-C--W
00cc6000: f000f000 G-D-C--W
00cc7000: f000f000 G-D-C--W
00cc8000: f000f000 G-D-C--W
00cc9000: f000f000 G-D-C--W
00cca000: f000f000 G-D-C--W
00ccb000: f000f000 G-D-C--W
00ccc000: f000f000 G-D-C--W
00ccd000: f000f000 G-D-C--W
00cce000: f000f000 G-D-C--W
00ccf000: f000f000 G-D-C--W
00cd0000: f000f000 G-D-C--W
00cd1000: f000f000 G-D-C--W
00cd2000: f000f000 G-D-C--W
00cd3000: f000f000 G-D-C--W
00cd4000: f000f000 G-D-C--W
00cd5000: f000f000 G-D-C--W
00cd6000: f000f000 G-D-C--W
00cd7000: f000f000 G-D-C--W
00cd8000: f000f000 G-D-C--W
00cd9000: f000f000 G-D-C--W
00cda000: f000f000 G-D-C--W
00cdb000: f000f000 G-D-C--W
00cdc000: f000f000 G-D-C--W
00cdd000: f000f000 G-D-C--W
00cde000: f000f000 G-D-C--W
00cdf000: f000f000 G-D-C--W
00ce0000: f000f000 G-D-C--W
00ce1000: f000f000 G-D-C--W
00ce2000: f000f000 G-D-C--W
00ce3000: f000f000 G-D-C--W
00ce4000: f000f000 G-D-C--W
00ce5000: f000f000 G-D-C--W
00ce6000: f000f000 G-D-C--W
00ce7000: f000f000 G-D-C--W
00ce8000: f000f000 G-D-C--W
00ce9000: f000f000 G-D-C--W
00cea000: f000f000 G-D-C--W
00ceb000: f000f000 G-D-C--W
00cec000: f000f000 G-D-C--W
00ced000: f000f000 G-D-C--W
00cee000: f000f000 G-D-C--W
00cef000: f000f000 G-D-C--W
00cf0000: f000f000 G-D-C--W
00cf1000: f000f000 G-D-C--W
00cf2000: f000f000 G-D-C--W
00cf3000: f000f000 G-D-C--W
00cf4000: f000f000 G-D-C--W
00cf5000: f000f000 G-D-C--W
00cf6000: f000f000 G-D-C--W
00cf7000: f000f000 G-D-C--W
00cf8000: f000f000 G-D-C--W
00cf9000: f000f000 G-D-C--W
00cfa000: f000f000 G-D-C--W
00cfb000: f000f000 G-D-C--W
00cfc000: f000f000 G-D-C--W
00cfd000: f000f000 G-D-C--W
00cfe000: f000f000 G-D-C--W
00cff000: f000f000 G-D-C--W
00d18000: d4000000 ------UW
00d19000: 00000000 -------W
00d1d000: 00c00000 G-------
00d22000: 00085000 G-DACT--
00d2a000: c0003000 G--A---W
00df0000: fe830000 --------
00df1000: 003f7000 G-DACTUW
00df4000: fe827000 --D-----
00df5000: a87cb000 --DACTUW
00df7000: 00000000 -----TUW
01000000: e4500000 GPDACT-W
01400000: 24500000 -P-A----
01800000: e0200000 GPDACTUW
01c00000: 00e00000 GP---T-W
04c00000: b8a00000 GP---TU-
05c00000: e2000000 GP-----W
0bc00000: 75f00000 GP---T--
0c800000: 13e00000 -PDACTUW
0d800000: 90f00000 GPDA--U-
0dc00000: 00200000 -P---TU-
0e400000: 00000000 -P---TU-
10400000: 90900000 -PDA-T-W
12000000: 002a8000 --DA---W
12002000: 00200000 --DA---W
12004000: 00400000 --DA---W
12006000: 00600000 --DA---W
12008000: 00800000 --DA---W
1200a000: 00a00000 --DA---W
1200c000: 00c00000 --DA---W
1200e000: 00e00000 --DA---W
13bf0000: 002a8000 --DA---W
13bf2000: 00200000 --DA---W
13bf4000: 00400000 --DA---W
13bf6000: 00600000 --DA---W
13bf8000: 00800000 --DA---W
13bfa000: 00a00000 --DA---W
(qemu)

Quoted 1 line

Is here someone can explain such output?

The output is generated in monitor.c:1812:1926. The functions use only uint32_t, so I suppose PAE support has not been added.

Quoted 12 lines
Quoted 11 lines
Quoted 7 lines

On this side, I think Bochs is good. Unfortunately, it seems do not support gdb-stub debugging and general purpose debugging at the same time.

I do not know if the Qemu team had made any plans to improve this? such as embedding the bochs debugging alike functionalities in future Qemu releases?

Perhaps nobody were aware that there were any lack of functionalities. I think these should be very easy to add.

Quoted 8 lines

This should be not so hard, and I may have a try in the close future. The difficulty here is that you have to consider several paging techniques invented by Intel, such as, i386, PAE, PSE(36), x86_64. And these works ONLY for the i386 platform.

I just wondering: It is for sure that I am not the very first person who encounter such problems in the history of Qemu development. Why these simple functionalities were not added to the main release till now?

I think that you really are the first one to report, so nobody has ever needed such functionalities yet. In fact, I searched mail archives and there was nothing relevant for PAE.

#4 lore raw
Quoted 381 lines · Blue Swirl
Quoted 358 lines · Zhiyuan Shao
Quoted 6 lines · Blue Swirl
Quoted 5 lines · Zhiyuan Shao

Hi team,

I am a Qemu User, and using Qemu 0.13.0 to debugging the linux kernel code (Qemu+GDB).

Quoted 9 lines
Quoted 6 lines

During the usage, I found the Qemu debugging console (i.e., entered by pressing Ctl+Alt+2 in Qemu SDL window or by passing "-monitor stdio" to Qemu in the command line) is rather difficult to use. It can not show some important information, e.g., on i386 platform, which is my major interest, it can not show IDT, GDT information. Regarding the page mapping information, "info tlb" actually do a really bad job.

How is that bad?

I booted a Linux OS (i386 with PAE support), and has following virtual-to-physical mappings:
[0xff00-0000,0xffbf-ffff] -> [0x0000-0000, 0x00bf-ffff] [0x0000-0000,0x00ff-ffff] -> [0x0000-0000, 0x00ff-ffff]

while now, with "info mem" command of Qemu debugging console, the output is like:
(qemu) info mem
00000000-00400000 00400000 -r-
00c00000-00c08000 00008000 -rw
00c08000-00c09000 00001000 ur-
00c09000-00c0a000 00001000 urw
00c0e000-00c0f000 00001000 urw
00c10000-00c11000 00001000 -r-
00c11000-00c12000 00001000 ur-
00c12000-00c13000 00001000 -r-
00c14000-00c16000 00002000 -r-
00c1b000-00c1e000 00003000 -rw
00c20000-00c40000 00020000 -rw
00c40000-00c41000 00001000 -r-
00c41000-00c42000 00001000 ur-
00c42000-00c43000 00001000 -rw
00c44000-00c60000 0001c000 -rw
00c67000-00c70000 00009000 -rw
00c71000-00c74000 00003000 ur-
00c75000-00c76000 00001000 urw
00c77000-00c78000 00001000 ur-
00c78000-00c79000 00001000 -rw
00c7a000-00d00000 00086000 -rw
00d18000-00d19000 00001000 urw
00d19000-00d1a000 00001000 -rw
00d1d000-00d1e000 00001000 -r-
00d22000-00d23000 00001000 -r-
00d2a000-00d2b000 00001000 -rw
00df0000-00df1000 00001000 -r-
00df1000-00df2000 00001000 urw
00df4000-00df5000 00001000 -r-
00df5000-00df6000 00001000 urw
00df7000-00df8000 00001000 urw
01000000-01400000 00400000 -rw
01400000-01800000 00400000 -r-
01800000-01c00000 00400000 urw
01c00000-02000000 00400000 -rw
04c00000-05000000 00400000 ur-
05c00000-06000000 00400000 -rw
0bc00000-0c000000 00400000 -r-
0c800000-0cc00000 00400000 urw
0d800000-0e000000 00800000 ur-
0e400000-0e800000 00400000 ur-
10400000-10800000 00400000 -rw
12000000-12001000 00001000 -rw
12002000-12003000 00001000 -rw
12004000-12005000 00001000 -rw
12006000-12007000 00001000 -rw
12008000-12009000 00001000 -rw
1200a000-1200b000 00001000 -rw
1200c000-1200d000 00001000 -rw
1200e000-1200f000 00001000 -rw
13bf0000-13bf1000 00001000 -rw
13bf2000-13bf3000 00001000 -rw
13bf4000-13bf5000 00001000 -rw
13bf6000-13bf7000 00001000 -rw
13bf8000-13bf9000 00001000 -rw
13bfa000-13bfb000 00001000 -rw

Donot know what the "active virtual memory mappings" means for "info mem" command, but the results displayed is not very likely being correct.

While with "info tlb" command:

(qemu) info tlb
00000000: 15c00000 -PDA-T--
00c00000: f000f000 G-D-C--W
00c01000: f000f000 G-D-C--W
00c02000: f000e000 --D----W
00c03000: f000f000 G-D-C--W
00c04000: f000f000 G-D-C--W
00c05000: f000f000 G-D-C--W
00c06000: f000f000 G-D-C--W
00c07000: f000f000 G-D-C--W
00c08000: f000f000 ---A--U-
00c09000: f000e000 G-----UW
00c0e000: f000e000 G-D-C-UW
00c10000: c0008000 G--ACT--
00c11000: f000f000 --D--TU-
00c12000: f000f000 --D-----
00c14000: f000e000 G--ACT--
00c15000: f000f000 --D-CT--
00c1b000: f000f000 G-D-C--W
00c1c000: f000f000 G-D-C--W
00c1d000: f000f000 G-D-C--W
00c20000: f000f000 G-D-C--W
00c21000: f000f000 G-D-C--W
00c22000: f000f000 G-D-C--W
00c23000: f000f000 G-D-C--W
00c24000: f000f000 G-D-C--W
00c25000: f000f000 G-D-C--W
00c26000: f000f000 G-D-C--W
00c27000: f000f000 G-D-C--W
00c28000: f000f000 G-D-C--W
00c29000: f000f000 G-D-C--W
00c2a000: f000f000 G-D-C--W
00c2b000: f000f000 G-D-C--W
00c2c000: f000f000 G-D-C--W
00c2d000: f000f000 G-D-C--W
00c2e000: f000f000 G-D-C--W
00c2f000: f000f000 G-D-C--W
00c30000: f000f000 G-D-C--W
00c31000: f000f000 G-D-C--W
00c32000: f000f000 G-D-C--W
00c33000: f000f000 G-D-C--W
00c34000: f000f000 G-D-C--W
00c35000: f000f000 G-D-C--W
00c36000: f000f000 G-D-C--W
00c37000: f000f000 G-D-C--W
00c38000: f000f000 G-D-C--W
00c39000: f000f000 G-D-C--W
00c3a000: f000f000 G-D-C--W
00c3b000: f000f000 G-D-C--W
00c3c000: f000f000 G-D-C--W
00c3d000: f000f000 G-D-C--W
00c3e000: f000f000 G-D-C--W
00c3f000: f000f000 G-D-C--W
00c40000: f000e000 --D-CT--
00c41000: 9fc00000 ---ACTU-
00c42000: f000f000 G-D-C--W
00c44000: f000f000 G-D-C--W
00c45000: f000f000 G-D-C--W
00c46000: f000f000 G-D-C--W
00c47000: f000f000 G-D-C--W
00c48000: f000f000 G-D-C--W
00c49000: f000f000 G-D-C--W
00c4a000: f000f000 G-D-C--W
00c4b000: f000f000 G-D-C--W
00c4c000: f000f000 G-D-C--W
00c4d000: f000f000 G-D-C--W
00c4e000: f000f000 G-D-C--W
00c4f000: f000f000 G-D-C--W
00c50000: f000f000 G-D-C--W
00c51000: f000f000 G-D-C--W
00c52000: f000f000 G-D-C--W
00c53000: f000f000 G-D-C--W
00c54000: f000f000 G-D-C--W
00c55000: f000f000 G-D-C--W
00c56000: f000f000 G-D-C--W
00c57000: f000f000 G-D-C--W
00c58000: f000f000 G-D-C--W
00c59000: f000f000 G-D-C--W
00c5a000: f000f000 G-D-C--W
00c5b000: f000f000 G-D-C--W
00c5c000: f000f000 G-D-C--W
00c5d000: f000f000 G-D-C--W
00c5e000: f000f000 G-D-C--W
00c5f000: f000f000 G-D-C--W
00c67000: f000f000 G-D-C--W
00c68000: f000f000 G-D-C--W
00c69000: f000f000 G-D-C--W
00c6a000: f000f000 G-D-C--W
00c6b000: f000f000 G-D-C--W
00c6c000: f000f000 G-D-C--W
00c6d000: f000f000 G-D-C--W
00c6e000: f000f000 G-D-C--W
00c6f000: f000f000 G-D-C--W
00c71000: f000f000 G-D---U-
00c72000: f000f000 G-D---U-
00c73000: f000f000 G-D---U-
00c75000: f000e000 --DA--UW
00c77000: f000f000 G-D---U-
00c78000: f000f000 G-D-C--W
00c7a000: f000f000 G-D-C--W
00c7b000: f000f000 G-D-C--W
00c7c000: f000f000 G-D-C--W
00c7d000: f000f000 G-D-C--W
00c7e000: f000f000 G-D-C--W
00c7f000: f000f000 G-D-C--W
00c80000: f000f000 G-D-C--W
00c81000: f000f000 G-D-C--W
00c82000: f000f000 G-D-C--W
00c83000: f000f000 G-D-C--W
00c84000: f000f000 G-D-C--W
00c85000: f000f000 G-D-C--W
00c86000: f000f000 G-D-C--W
00c87000: f000f000 G-D-C--W
00c88000: f000f000 G-D-C--W
00c89000: f000f000 G-D-C--W
00c8a000: f000f000 G-D-C--W
00c8b000: f000f000 G-D-C--W
00c8c000: f000f000 G-D-C--W
00c8d000: f000f000 G-D-C--W
00c8e000: f000f000 G-D-C--W
00c8f000: f000f000 G-D-C--W
00c90000: f000f000 G-D-C--W
00c91000: f000f000 G-D-C--W
00c92000: f000f000 G-D-C--W
00c93000: f000f000 G-D-C--W
00c94000: f000f000 G-D-C--W
00c95000: f000f000 G-D-C--W
00c96000: f000f000 G-D-C--W
00c97000: f000f000 G-D-C--W
00c98000: f000f000 G-D-C--W
00c99000: f000f000 G-D-C--W
00c9a000: f000f000 G-D-C--W
00c9b000: f000f000 G-D-C--W
00c9c000: f000f000 G-D-C--W
00c9d000: f000f000 G-D-C--W
00c9e000: f000f000 G-D-C--W
00c9f000: f000f000 G-D-C--W
00ca0000: f000f000 G-D-C--W
00ca1000: f000f000 G-D-C--W
00ca2000: f000f000 G-D-C--W
00ca3000: f000f000 G-D-C--W
00ca4000: f000f000 G-D-C--W
00ca5000: f000f000 G-D-C--W
00ca6000: f000f000 G-D-C--W
00ca7000: f000f000 G-D-C--W
00ca8000: f000f000 G-D-C--W
00ca9000: f000f000 G-D-C--W
00caa000: f000f000 G-D-C--W
00cab000: f000f000 G-D-C--W
00cac000: f000f000 G-D-C--W
00cad000: f000f000 G-D-C--W
00cae000: f000f000 G-D-C--W
00caf000: f000f000 G-D-C--W
00cb0000: f000f000 G-D-C--W
00cb1000: f000f000 G-D-C--W
00cb2000: f000f000 G-D-C--W
00cb3000: f000f000 G-D-C--W
00cb4000: f000f000 G-D-C--W
00cb5000: f000f000 G-D-C--W
00cb6000: f000f000 G-D-C--W
00cb7000: f000f000 G-D-C--W
00cb8000: f000f000 G-D-C--W
00cb9000: f000f000 G-D-C--W
00cba000: f000f000 G-D-C--W
00cbb000: f000f000 G-D-C--W
00cbc000: f000f000 G-D-C--W
00cbd000: f000f000 G-D-C--W
00cbe000: f000f000 G-D-C--W
00cbf000: f000f000 G-D-C--W
00cc0000: f000f000 G-D-C--W
00cc1000: f000f000 G-D-C--W
00cc2000: f000f000 G-D-C--W
00cc3000: f000f000 G-D-C--W
00cc4000: f000f000 G-D-C--W
00cc5000: f000f000 G-D-C--W
00cc6000: f000f000 G-D-C--W
00cc7000: f000f000 G-D-C--W
00cc8000: f000f000 G-D-C--W
00cc9000: f000f000 G-D-C--W
00cca000: f000f000 G-D-C--W
00ccb000: f000f000 G-D-C--W
00ccc000: f000f000 G-D-C--W
00ccd000: f000f000 G-D-C--W
00cce000: f000f000 G-D-C--W
00ccf000: f000f000 G-D-C--W
00cd0000: f000f000 G-D-C--W
00cd1000: f000f000 G-D-C--W
00cd2000: f000f000 G-D-C--W
00cd3000: f000f000 G-D-C--W
00cd4000: f000f000 G-D-C--W
00cd5000: f000f000 G-D-C--W
00cd6000: f000f000 G-D-C--W
00cd7000: f000f000 G-D-C--W
00cd8000: f000f000 G-D-C--W
00cd9000: f000f000 G-D-C--W
00cda000: f000f000 G-D-C--W
00cdb000: f000f000 G-D-C--W
00cdc000: f000f000 G-D-C--W
00cdd000: f000f000 G-D-C--W
00cde000: f000f000 G-D-C--W
00cdf000: f000f000 G-D-C--W
00ce0000: f000f000 G-D-C--W
00ce1000: f000f000 G-D-C--W
00ce2000: f000f000 G-D-C--W
00ce3000: f000f000 G-D-C--W
00ce4000: f000f000 G-D-C--W
00ce5000: f000f000 G-D-C--W
00ce6000: f000f000 G-D-C--W
00ce7000: f000f000 G-D-C--W
00ce8000: f000f000 G-D-C--W
00ce9000: f000f000 G-D-C--W
00cea000: f000f000 G-D-C--W
00ceb000: f000f000 G-D-C--W
00cec000: f000f000 G-D-C--W
00ced000: f000f000 G-D-C--W
00cee000: f000f000 G-D-C--W
00cef000: f000f000 G-D-C--W
00cf0000: f000f000 G-D-C--W
00cf1000: f000f000 G-D-C--W
00cf2000: f000f000 G-D-C--W
00cf3000: f000f000 G-D-C--W
00cf4000: f000f000 G-D-C--W
00cf5000: f000f000 G-D-C--W
00cf6000: f000f000 G-D-C--W
00cf7000: f000f000 G-D-C--W
00cf8000: f000f000 G-D-C--W
00cf9000: f000f000 G-D-C--W
00cfa000: f000f000 G-D-C--W
00cfb000: f000f000 G-D-C--W
00cfc000: f000f000 G-D-C--W
00cfd000: f000f000 G-D-C--W
00cfe000: f000f000 G-D-C--W
00cff000: f000f000 G-D-C--W
00d18000: d4000000 ------UW
00d19000: 00000000 -------W
00d1d000: 00c00000 G-------
00d22000: 00085000 G-DACT--
00d2a000: c0003000 G--A---W
00df0000: fe830000 --------
00df1000: 003f7000 G-DACTUW
00df4000: fe827000 --D-----
00df5000: a87cb000 --DACTUW
00df7000: 00000000 -----TUW
01000000: e4500000 GPDACT-W
01400000: 24500000 -P-A----
01800000: e0200000 GPDACTUW
01c00000: 00e00000 GP---T-W
04c00000: b8a00000 GP---TU-
05c00000: e2000000 GP-----W
0bc00000: 75f00000 GP---T--
0c800000: 13e00000 -PDACTUW
0d800000: 90f00000 GPDA--U-
0dc00000: 00200000 -P---TU-
0e400000: 00000000 -P---TU-
10400000: 90900000 -PDA-T-W
12000000: 002a8000 --DA---W
12002000: 00200000 --DA---W
12004000: 00400000 --DA---W
12006000: 00600000 --DA---W
12008000: 00800000 --DA---W
1200a000: 00a00000 --DA---W
1200c000: 00c00000 --DA---W
1200e000: 00e00000 --DA---W
13bf0000: 002a8000 --DA---W
13bf2000: 00200000 --DA---W
13bf4000: 00400000 --DA---W
13bf6000: 00600000 --DA---W
13bf8000: 00800000 --DA---W
13bfa000: 00a00000 --DA---W
(qemu)

Quoted 1 line

Is here someone can explain such output?

The output is generated in monitor.c:1812:1926. The functions use only uint32_t, so I suppose PAE support has not been added.

Quoted 17 lines
Quoted 11 lines
Quoted 7 lines

On this side, I think Bochs is good. Unfortunately, it seems do not support gdb-stub debugging and general purpose debugging at the same time.

I do not know if the Qemu team had made any plans to improve this? such as embedding the bochs debugging alike functionalities in future Qemu releases?

Perhaps nobody were aware that there were any lack of functionalities. I think these should be very easy to add.

This should be not so hard, and I may have a try in the close future. The difficulty here is that you have to consider several paging techniques invented by Intel, such as, i386, PAE, PSE(36), x86_64. And these works ONLY for the i386 platform.

Quoted 8 lines
Quoted 3 lines

I just wondering: It is for sure that I am not the very first person who encounter such problems in the history of Qemu development. Why these simple functionalities were not added to the main release till now?

I think that you really are the first one to report, so nobody has ever needed such functionalities yet. In fact, I searched mail archives and there was nothing relevant for PAE.

OK, If I get some time in the close future, I will try to improve the relevant part (todo list: PAE/PSE(36), IDT, GDT, x86_64, possibly pipe-like feature) of Qemu that I think it will be helpful for people debugging code on the i386 platform.

Anyway, are such improvements interested in Qemu community? If so, I will submit the code patch I made based on 0.13.0 to this list. Do hope later version of Qemu supports these.

#5 lore raw

Am 28.10.2010 04:20, schrieb Zhiyuan Shao:

Quoted 8 lines

OK, If I get some time in the close future, I will try to improve the relevant part (todo list: PAE/PSE(36), IDT, GDT, x86_64, possibly pipe-like feature) of Qemu that I think it will be helpful for people debugging code on the i386 platform.

Anyway, are such improvements interested in Qemu community? If so, I will submit the code patch I made based on 0.13.0 to this list. Do hope later version of Qemu supports these.

Yes, definitely. You can always work around it, e.g. by directly inspecting memory, so I didn't care enough to implement it, but having it seems certainly convenient.

Kevin

#6 lore raw
In reply to Zhiyuan Shao
Quoted 8 lines · Zhiyuan Shao

Hi team,

I am a Qemu User, and using Qemu 0.13.0 to debugging the linux kernel code (Qemu+GDB).

During the usage, I found the Qemu debugging console (i.e., entered by pressing Ctl+Alt+2 in Qemu SDL window or by passing "-monitor stdio" to Qemu in the command line) is rather difficult to use.

Regarding usability in this scenario: You know that there is QEMU monitor pass-through via gdb "monitor" command?

Quoted 5 lines

It can not show
some important information, e.g., on i386 platform, which is my major interest, it can not show IDT, GDT information. Regarding the page mapping information, "info tlb" actually do a really bad job.

Quoted 7 lines

On this side, I think Bochs is good. Unfortunately, it seems do not support gdb-stub debugging and general purpose debugging at the same time.

I do not know if the Qemu team had made any plans to improve this? such as embedding the bochs debugging alike functionalities in future Qemu releases?

The most important lacking feature is proper system-level debugging support for gdb (via gdbstub). Once gdb has full access to all CPU states of the x86 targets, you can pretty-print whatever you want inside gdb via some nice Python scripts etc.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#7 lore raw
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Zhiyuan Shao

Hi team,

I am a Qemu User, and using Qemu 0.13.0 to debugging the linux kernel code (Qemu+GDB).

Quoted 7 lines
Quoted 3 lines

During the usage, I found the Qemu debugging console (i.e., entered by pressing Ctl+Alt+2 in Qemu SDL window or by passing "-monitor stdio" to Qemu in the command line) is rather difficult to use.

Regarding usability in this scenario: You know that there is QEMU monitor pass-through via gdb "monitor" command?

Yes, Just learned to use that. By gdb "monitor" command, the output of QEMU debugging console is redirected to gdb.

Quoted 9 lines
Quoted 9 lines

It can not show
some important information, e.g., on i386 platform, which is my major interest, it can not show IDT, GDT information. Regarding the page mapping information, "info tlb" actually do a really bad job.

On this side, I think Bochs is good. Unfortunately, it seems do not support gdb-stub debugging and general purpose debugging at the same time.

Quoted 9 lines
Quoted 3 lines

I do not know if the Qemu team had made any plans to improve this? such as embedding the bochs debugging alike functionalities in future Qemu releases?

The most important lacking feature is proper system-level debugging support for gdb (via gdbstub). Once gdb has full access to all CPU states of the x86 targets, you can pretty-print whatever you want inside gdb via some nice Python scripts etc.

Are you mean that it is the responsibility of gdb to parse the output data of qemu built-in commands and generate user-friend output? Or grant gdb full access to the target machine, which is emulated by Qemu, and it is the responsibility of gdb again to generate easy-to-read output for the users?

I think the first solution sounds more feasible, however, we still need more helpful built-in commands in Qemu.
And it is hard to implement the second solution: By doing this, we may need to have full support from GDB community.

Maybe, I am wrong. If possible, please give us more advices.

Thanks!

Quoted 2 lines

Jan

Zhiyuan

#9 lore raw
In reply to a message not in the archive
Quoted 35 lines · Zhiyuan Shao
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Zhiyuan Shao

Hi team,

I am a Qemu User, and using Qemu 0.13.0 to debugging the linux kernel code (Qemu+GDB).

Quoted 7 lines
Quoted 3 lines

During the usage, I found the Qemu debugging console (i.e., entered by pressing Ctl+Alt+2 in Qemu SDL window or by passing "-monitor stdio" to Qemu in the command line) is rather difficult to use.

Regarding usability in this scenario: You know that there is QEMU monitor pass-through via gdb "monitor" command?

Yes, Just learned to use that. By gdb "monitor" command, the output of QEMU debugging console is redirected to gdb.

Quoted 9 lines
Quoted 9 lines

It can not show
some important information, e.g., on i386 platform, which is my major interest, it can not show IDT, GDT information. Regarding the page mapping information, "info tlb" actually do a really bad job.

On this side, I think Bochs is good. Unfortunately, it seems do not support gdb-stub debugging and general purpose debugging at the same time.

Quoted 9 lines
Quoted 3 lines

I do not know if the Qemu team had made any plans to improve this? such as embedding the bochs debugging alike functionalities in future Qemu releases?

The most important lacking feature is proper system-level debugging support for gdb (via gdbstub). Once gdb has full access to all CPU states of the x86 targets, you can pretty-print whatever you want inside gdb via some nice Python scripts etc.

Quoted 5 lines

Are you mean that it is the responsibility of gdb to parse the output data of qemu built-in commands and generate user-friend output? Or grant gdb full access to the target machine, which is emulated by Qemu, and it is the responsibility of gdb again to generate easy-to-read output for the users?

More the latter: The full register set (including MSRs) need to be made available to gdb via the remote protocol, and gdb has to be taught interpreting it. This is e.g. required to understand the current operating mode (16/32/64 bit) and legacy segmentation.

Moreover, once you have access to the control registers (and some MSRs), you can easily parse and dump the page table hierarchy in gdb extension scripts (preferably in Python these days). That's way better than overloading QEMU with more of such things.

Quoted 5 lines

I think the first solution sounds more feasible, however, we still need more helpful built-in commands in Qemu.
And it is hard to implement the second solution: By doing this, we may need to have full support from GDB community.

For sure. But the major issue is more about resources to work on this than gdb community support. Browse their mailing list archive to find that they are actually supportive regarding this topic.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#10 lore raw

Am 29.10.2010 um 09:32 schrieb Jan Kiszka:

Quoted 17 lines · Zhiyuan Shao
Quoted 11 lines · Jan Kiszka
Quoted 5 lines

The most important lacking feature is proper system-level debugging support for gdb (via gdbstub). Once gdb has full access to all CPU states of the x86 targets, you can pretty-print whatever you want inside gdb via some nice Python scripts etc.

Are you mean that it is the responsibility of gdb to parse the output data of qemu built-in commands and generate user-friend output? Or grant gdb full access to the target machine, which is emulated by Qemu, and it is the responsibility of gdb again to generate easy-to-read output for the users?

More the latter: The full register set (including MSRs) need to be made available to gdb via the remote protocol, and gdb has to be taught interpreting it. This is e.g. required to understand the current operating mode (16/32/64 bit) and legacy segmentation.

[...]

Quoted 8 lines
Quoted 4 lines

I think the first solution sounds more feasible, however, we still need more helpful built-in commands in Qemu.
And it is hard to implement the second solution: By doing this, we may need to have full support from GDB community.

For sure. But the major issue is more about resources to work on this than gdb community support. Browse their mailing list archive to find that they are actually supportive regarding this topic.

Since this seems a recurring topic, maybe you should put this onto the GSoC ideas list?

Regards,
Andreas