Debugging Xenomai kernel
Dear,
I'm trying to debug Xenomai kernel with GDB and Qemu. So, I launch Xenomai in Qemu and make it waiting for GDB. Then I start GDB and connect them to Qemu, make breakpoint at the desired function to debug and start Xenomai. If the function belongs to the linux kernel, the execution stop at the breakpoint. But, if the function belongs to the Xenomai nucleus, GDB recognize the breakpoint at the execution but don't stop.
Is it possible to debug Xenomai with GDB and Qemu? Is it the good way to debug?
Thank you for your attention and your help.
Sincerely,
Omar ZENATI
Quoted 3 lines · zenati
Dear,
I'm trying to debug Xenomai kernel with GDB and Qemu.
QEMU in emulation or KVM mode?
Quoted 7 lines
So, I launch
Xenomai in Qemu and make it waiting for GDB. Then I start GDB and connect them to Qemu, make breakpoint at the desired function to debug and start Xenomai. If the function belongs to the linux kernel, the execution stop at the breakpoint. But, if the function belongs to the Xenomai nucleus, GDB recognize the breakpoint at the execution but don't stop.
Is Xenomai built as module or part of the main kernel image? The latter is simpler to handle as you don't have to deal with modules as symbol sources, find out their addresses, and load them at the right location.
Quoted 2 lines
Is it possible to debug Xenomai with GDB and Qemu?
Definitely.
Quoted 6 lines
Is it the good way to debug?
Thank you for your attention and your help.
Sincerely,Omar ZENATI
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 6 lines · Jan Kiszka
Quoted 3 lines · zenati
Dear,
I'm trying to debug Xenomai kernel with GDB and Qemu.
QEMU in emulation or KVM mode?
I'm using Qemu in emulation mode.
Quoted 11 lines
Quoted 7 lines
So, I launch
Xenomai in Qemu and make it waiting for GDB. Then I start GDB and connect them to Qemu, make breakpoint at the desired function to debug and start Xenomai. If the function belongs to the linux kernel, the execution stop at the breakpoint. But, if the function belongs to the Xenomai nucleus, GDB recognize the breakpoint at the execution but don't stop.Is Xenomai built as module or part of the main kernel image? The latter is simpler to handle as you don't have to deal with modules as symbol sources, find out their addresses, and load them at the right location.
Xenomai is built as a part of the main kernel.
Quoted 11 lines
Quoted 1 line
Is it possible to debug Xenomai with GDB and Qemu?
Definitely.
Quoted 6 lines
Is it the good way to debug?
Thank you for your attention and your help.
Sincerely,Omar ZENATI
Jan
Omar ZENATI
Quoted 8 lines · zenati
Quoted 6 lines · Jan Kiszka
Quoted 3 lines · zenati
Dear,
I'm trying to debug Xenomai kernel with GDB and Qemu.
QEMU in emulation or KVM mode?
I'm using Qemu in emulation mode.
What's your target arch? x84-64, x86-32, or some ARM or PPC etc.?
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
So, I launch
Xenomai in Qemu and make it waiting for GDB. Then I start GDB and connect them to Qemu, make breakpoint at the desired function to debug and start Xenomai. If the function belongs to the linux kernel, the execution stop at the breakpoint. But, if the function belongs to the Xenomai nucleus, GDB recognize the breakpoint at the execution but don't stop.
Quoted 5 lines
Quoted 4 lines
Is Xenomai built as module or part of the main kernel image? The latter is simpler to handle as you don't have to deal with modules as symbol sources, find out their addresses, and load them at the right location.
Xenomai is built as a part of the main kernel.
OK. Check during runtime of the guest if the disassembly at the desired breakpoint address matches the compiled code. Maybe there is some accidental discrepancy.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 10 lines · Jan Kiszka
Quoted 8 lines · zenati
Quoted 6 lines · Jan Kiszka
Quoted 3 lines · zenati
Dear,
I'm trying to debug Xenomai kernel with GDB and Qemu.
QEMU in emulation or KVM mode?
I'm using Qemu in emulation mode.
What's your target arch? x84-64, x86-32, or some ARM or PPC etc.
x86-32
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
So, I launch
Xenomai in Qemu and make it waiting for GDB. Then I start GDB and connect them to Qemu, make breakpoint at the desired function to debug and start Xenomai. If the function belongs to the linux kernel, the execution stop at the breakpoint. But, if the function belongs to the Xenomai nucleus, GDB recognize the breakpoint at the execution but don't stop.
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Is Xenomai built as module or part of the main kernel image? The latter is simpler to handle as you don't have to deal with modules as symbol sources, find out their addresses, and load them at the right location.
Xenomai is built as a part of the main kernel.
OK. Check during runtime of the guest if the disassembly at the desired breakpoint address matches the compiled code. Maybe there is some accidental discrepancy.
The breakpoints match correctly the compiled code. Anyway, it must stop at the breakpoint. No?
Quoted 2 lines
Jan
Quoted 23 lines · zenati
Quoted 10 lines · Jan Kiszka
Quoted 8 lines · zenati
Quoted 6 lines · Jan Kiszka
Quoted 3 lines · zenati
Dear,
I'm trying to debug Xenomai kernel with GDB and Qemu.
QEMU in emulation or KVM mode?
I'm using Qemu in emulation mode.
What's your target arch? x84-64, x86-32, or some ARM or PPC etc.
x86-32
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
So, I launch
Xenomai in Qemu and make it waiting for GDB. Then I start GDB and connect them to Qemu, make breakpoint at the desired function to debug and start Xenomai. If the function belongs to the linux kernel, the execution stop at the breakpoint. But, if the function belongs to the Xenomai nucleus, GDB recognize the breakpoint at the execution but don't stop.Is Xenomai built as module or part of the main kernel image? The latter is simpler to handle as you don't have to deal with modules as symbol sources, find out their addresses, and load them at the right location.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Xenomai is built as a part of the main kernel.
OK. Check during runtime of the guest if the disassembly at the desired breakpoint address matches the compiled code. Maybe there is some accidental discrepancy.
The breakpoints match correctly the compiled code. Anyway, it must stop at the breakpoint. No?
...if the guest actually executes that address.
I haven't used x86 QEMU in emulation mode for quite a while to debug something. Maybe we have a regression there. What's your QEMU version? Do you have a chance to test with a KVM host? It's faster anyway.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 28 lines · Jan Kiszka
Quoted 27 lines · zenati
Quoted 10 lines · Jan Kiszka
Quoted 8 lines · zenati
Quoted 6 lines · Jan Kiszka
Quoted 3 lines · zenati
Dear,
I'm trying to debug Xenomai kernel with GDB and Qemu.
QEMU in emulation or KVM mode?
I'm using Qemu in emulation mode.
What's your target arch? x84-64, x86-32, or some ARM or PPC etc.
x86-32
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
So, I launch
Xenomai in Qemu and make it waiting for GDB. Then I start GDB and connect them to Qemu, make breakpoint at the desired function to debug and start Xenomai. If the function belongs to the linux kernel, the execution stop at the breakpoint. But, if the function belongs to the Xenomai nucleus, GDB recognize the breakpoint at the execution but don't stop.Quoted 5 lines
Quoted 4 lines
Is Xenomai built as module or part of the main kernel image? The latter is simpler to handle as you don't have to deal with modules as symbol sources, find out their addresses, and load them at the right location.
Xenomai is built as a part of the main kernel.
OK. Check during runtime of the guest if the disassembly at the desired breakpoint address matches the compiled code. Maybe there is some accidental discrepancy.
Quoted 6 lines
Quoted 2 lines
The breakpoints match correctly the compiled code. Anyway, it must stop at the breakpoint. No?
...if the guest actually executes that address.
I haven't used x86 QEMU in emulation mode for quite a while to debug something. Maybe we have a regression there. What's your QEMU version?
QEMU PC emulator version 0.12.3 (qemu-kvm-0.12.3), Copyright (c) 2003-2008 Fabrice Bellard
Quoted 1 line
Do you have a chance to test with a KVM host? It's faster anyway.
I never used it before... But I'm ready to test it if there is no others ways to debug.
Quoted 2 lines
Jan
Omar ZENATi