* [Qemu-devel] Problem in setting breakpoints at kernel code using "qemu and gdb"
@ 2011-04-14 15:16 Amirali Shambayati
2011-04-15 5:38 ` Craig Brozefsky
0 siblings, 1 reply; 3+ messages in thread
From: Amirali Shambayati @ 2011-04-14 15:16 UTC (permalink / raw)
To: qemu-devel
Dear all,
I want to use combination of qemu and gdb to debug my modified linux
kernel code. First I tried this
link:http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html
to configure eclipse CDT and qemu to achieve my goal.
According to the tutorial, I tried following command to run qemu:
sudo qemu -s -S -hda linux-0.2.img -append "root=/dev/sda" -kernel
/mnt/build/linux-2.6/arch/x86/boot/bzImage
As I used my modified kernel code, I encountered with kernel oops; So
I tried to find the related code line which causes problem, using
breakpoints.
Now my problem is, when I set breakpoints before start debugging in
eclipse, it seems that it ignores breakpoints and kernel goes to oops
condition again.
Also I tried combination of gdb and qemu using following commands:
#gdb
(gdb) symbol-file vmlinux.o
(gdb) target remote localhost:1234
(gdb) break scsi_lib.c 1420
(gdb) c
I tried above commands to check if stops at breakpoint or not. I put a
printk after breakpoint line. It printed it and it means that it has
ignored breakpoint.
Would you guide me what is wrong with what I have done?
It's related to my thesis project, and I need to pass this step as
soon as possible.
Thanks in advance,
--
Amirali Shambayati
Bachelor Student
Computer Engineering Department
Sharif University of Technology
Tehran, Iran
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Problem in setting breakpoints at kernel code using "qemu and gdb"
2011-04-14 15:16 [Qemu-devel] Problem in setting breakpoints at kernel code using "qemu and gdb" Amirali Shambayati
@ 2011-04-15 5:38 ` Craig Brozefsky
2011-04-15 10:39 ` Amirali Shambayati
0 siblings, 1 reply; 3+ messages in thread
From: Craig Brozefsky @ 2011-04-15 5:38 UTC (permalink / raw)
To: Amirali Shambayati; +Cc: qemu-devel
On Thu, Apr 14, 2011 at 10:16 AM, Amirali Shambayati
<amirali.shambayati@gmail.com> wrote:
>
> Also I tried combination of gdb and qemu using following commands:
> #gdb
> (gdb) symbol-file vmlinux.o
> (gdb) target remote localhost:1234
> (gdb) break scsi_lib.c 1420
> (gdb) c
>
> I tried above commands to check if stops at breakpoint or not. I put a
> printk after breakpoint line. It printed it and it means that it has
> ignored breakpoint.
Try using a hbreak, hardware breakpoint, instead of the software breakpoint.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Problem in setting breakpoints at kernel code using "qemu and gdb"
2011-04-15 5:38 ` Craig Brozefsky
@ 2011-04-15 10:39 ` Amirali Shambayati
0 siblings, 0 replies; 3+ messages in thread
From: Amirali Shambayati @ 2011-04-15 10:39 UTC (permalink / raw)
To: Craig Brozefsky; +Cc: qemu-devel
That works well. Thanks so much Craig.
On Fri, Apr 15, 2011 at 10:08 AM, Craig Brozefsky <craig@red-bean.com> wrote:
> On Thu, Apr 14, 2011 at 10:16 AM, Amirali Shambayati
> <amirali.shambayati@gmail.com> wrote:
>
>>
>> Also I tried combination of gdb and qemu using following commands:
>> #gdb
>> (gdb) symbol-file vmlinux.o
>> (gdb) target remote localhost:1234
>> (gdb) break scsi_lib.c 1420
>> (gdb) c
>>
>> I tried above commands to check if stops at breakpoint or not. I put a
>> printk after breakpoint line. It printed it and it means that it has
>> ignored breakpoint.
>
> Try using a hbreak, hardware breakpoint, instead of the software breakpoint.
>
--
Amirali Shambayati
Bachelor Student
Computer Engineering Department
Sharif University of Technology
Tehran, Iran
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-15 10:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-14 15:16 [Qemu-devel] Problem in setting breakpoints at kernel code using "qemu and gdb" Amirali Shambayati
2011-04-15 5:38 ` Craig Brozefsky
2011-04-15 10:39 ` Amirali Shambayati
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).