* [Qemu-devel] Cross-debugging support in QEMU using GDB
@ 2009-10-29 10:20 Boyapati, Anitha
2009-10-29 11:04 ` Alexander Graf
0 siblings, 1 reply; 6+ messages in thread
From: Boyapati, Anitha @ 2009-10-29 10:20 UTC (permalink / raw)
To: qemu-devel
I have couple of doubts w.r.t cross-debugging in Qemu.
(1) Can Qemu be run without OS support? If so, can I know some examples where this has been already done?
(2) Can Qemu be used like a simulator to carry out cross-debugging, typically running a dejaGNU for a target X (again without an OS support)? The documentation page http://www.qemu.org/qemu-doc.html#SEC1 refers to GDB usage with linux image. I would like to know if the same can be allowed for other cross-compiled executables. Essentially, what I am looking for is something like,
qemu-x -s <any_ELF_executable> [options]
targetx-gdb <any_ELF_executable>
where qemu-x is a user mode qemu for target X.
More on (2): if there is no OS, then I think a small application like bootloader should probably be present to launch the cross-compiled executable on to Qemu. Any further suggestions on how to make (2) possible? All the previous threads in developer mail archives dealt with debugging linux image in some form or the other.
Thanks
Anitha
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Cross-debugging support in QEMU using GDB
2009-10-29 10:20 [Qemu-devel] Cross-debugging support in QEMU using GDB Boyapati, Anitha
@ 2009-10-29 11:04 ` Alexander Graf
2009-10-29 11:10 ` Laurent Desnogues
2009-10-29 16:26 ` Boyapati, Anitha
0 siblings, 2 replies; 6+ messages in thread
From: Alexander Graf @ 2009-10-29 11:04 UTC (permalink / raw)
To: Boyapati, Anitha; +Cc: qemu-devel
Hi Anitha,
On 29.10.2009, at 11:20, Boyapati, Anitha wrote:
>
> I have couple of doubts w.r.t cross-debugging in Qemu.
>
> (1) Can Qemu be run without OS support? If so, can I know some
> examples where this has been already done?
That what user mode emulation is doing. Instead of emulating the
privileged mode and hardware, it only implements user mode, signals,
syscalls, etc. so an application can run.
Linux user mode emulation is exactly the mode Uli's S390 target
implements.
> (2) Can Qemu be used like a simulator to carry out cross-debugging,
> typically running a dejaGNU for a target X (again without an OS
> support)? The documentation page http://www.qemu.org/qemu-doc.html#SEC1
> refers to GDB usage with linux image. I would like to know if the
> same can be allowed for other cross-compiled executables.
> Essentially, what I am looking for is something like,
> qemu-x -s <any_ELF_executable> [options]
> targetx-gdb <any_ELF_executable>
Yes. qemu-x -g 1234 <file> <options>
And then use gdb -ex 'target remote localhost:1234'.
> where qemu-x is a user mode qemu for target X.
>
> More on (2): if there is no OS, then I think a small application
> like bootloader should probably be present to launch the cross-
> compiled executable on to Qemu. Any further suggestions on how to
> make (2) possible? All the previous threads in developer mail
> archives dealt with debugging linux image in some form or the other.
Qemu does that job, interpreting the ELF headers. I'm not sure where
the linking is done though, so maybe better read the code there :-).
Just try out qemu-i386 for now! Try to run a statically linked i386
binary on a non-i386 platform, so you get the hang of it.
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Cross-debugging support in QEMU using GDB
2009-10-29 11:04 ` Alexander Graf
@ 2009-10-29 11:10 ` Laurent Desnogues
2009-10-29 16:26 ` Boyapati, Anitha
1 sibling, 0 replies; 6+ messages in thread
From: Laurent Desnogues @ 2009-10-29 11:10 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-devel, Boyapati, Anitha
On Thu, Oct 29, 2009 at 12:04 PM, Alexander Graf <agraf@suse.de> wrote:
[...]
>> More on (2): if there is no OS, then I think a small application like
>> bootloader should probably be present to launch the cross-compiled
>> executable on to Qemu. Any further suggestions on how to make (2) possible?
>> All the previous threads in developer mail archives dealt with debugging
>> linux image in some form or the other.
>
> Qemu does that job, interpreting the ELF headers. I'm not sure where the
> linking is done though, so maybe better read the code there :-).
For dynamically linked programs, the simulated ld.so will be run so you
have no control over what's going on.
Laurent
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Qemu-devel] Cross-debugging support in QEMU using GDB
2009-10-29 11:04 ` Alexander Graf
2009-10-29 11:10 ` Laurent Desnogues
@ 2009-10-29 16:26 ` Boyapati, Anitha
2009-10-29 16:28 ` Alexander Graf
1 sibling, 1 reply; 6+ messages in thread
From: Boyapati, Anitha @ 2009-10-29 16:26 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-devel
Hello Alex,
> > Essentially, what I am looking for is something like,
> > qemu-x -s <any_ELF_executable> [options]
> > targetx-gdb <any_ELF_executable>
>
> Yes. qemu-x -g 1234 <file> <options>
> And then use gdb -ex 'target remote localhost:1234'.
>
> > where qemu-x is a user mode qemu for target X.
> >
> > More on (2): if there is no OS, then I think a small application
> > like bootloader should probably be present to launch the cross-
> > compiled executable on to Qemu. Any further suggestions on how to
> > make (2) possible? All the previous threads in developer mail
> > archives dealt with debugging linux image in some form or the other.
>
> Qemu does that job, interpreting the ELF headers. I'm not sure where
> the linking is done though, so maybe better read the code there :-).
>
> Just try out qemu-i386 for now! Try to run a statically linked i386
> binary on a non-i386 platform, so you get the hang of it.
>
Wow! I just got the gist of entire thing having done the same successfully for i386. Actually I got confused at multiple points purely because of my mistakes.
As I am running the entire setup on virtual box, I don't have bzImage. I continued my kernel debugging attempts with linux.img (me in sleep mode :P). Then I ran an avr32 version of qemu which gave some weird results (the patch Rabin gave has GDB support in its TODO list and I overlooked it).Indeed the advice greatly helped to sort out most of the issues :)
On the other hand, I think this can be documented in GDB usage section of QEMU documentation.
Thanks,
Anitha
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Cross-debugging support in QEMU using GDB
2009-10-29 16:26 ` Boyapati, Anitha
@ 2009-10-29 16:28 ` Alexander Graf
2009-10-29 16:44 ` Boyapati, Anitha
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Graf @ 2009-10-29 16:28 UTC (permalink / raw)
To: Boyapati, Anitha; +Cc: qemu-devel
On 29.10.2009, at 17:26, Boyapati, Anitha wrote:
>
> Hello Alex,
>
>>> Essentially, what I am looking for is something like,
>>> qemu-x -s <any_ELF_executable> [options]
>>> targetx-gdb <any_ELF_executable>
>>
>> Yes. qemu-x -g 1234 <file> <options>
>> And then use gdb -ex 'target remote localhost:1234'.
>>
>>> where qemu-x is a user mode qemu for target X.
>>>
>>> More on (2): if there is no OS, then I think a small application
>>> like bootloader should probably be present to launch the cross-
>>> compiled executable on to Qemu. Any further suggestions on how to
>>> make (2) possible? All the previous threads in developer mail
>>> archives dealt with debugging linux image in some form or the other.
>>
>> Qemu does that job, interpreting the ELF headers. I'm not sure where
>> the linking is done though, so maybe better read the code there :-).
>>
>> Just try out qemu-i386 for now! Try to run a statically linked i386
>> binary on a non-i386 platform, so you get the hang of it.
>>
>
> Wow! I just got the gist of entire thing having done the same
> successfully for i386. Actually I got confused at multiple points
> purely because of my mistakes.
>
> As I am running the entire setup on virtual box, I don't have
> bzImage. I continued my kernel debugging attempts with linux.img (me
> in sleep mode :P). Then I ran an avr32 version of qemu which gave
> some weird results (the patch Rabin gave has GDB support in its TODO
> list and I overlooked it).Indeed the advice greatly helped to sort
> out most of the issues :)
I'm glad it sorted things out.
> On the other hand, I think this can be documented in GDB usage
> section of QEMU documentation.
Patches to documentation bits are always welcome! Certain developers
(definitely me included) tend to forget that people actually read
documentation ;-)
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Qemu-devel] Cross-debugging support in QEMU using GDB
2009-10-29 16:28 ` Alexander Graf
@ 2009-10-29 16:44 ` Boyapati, Anitha
0 siblings, 0 replies; 6+ messages in thread
From: Boyapati, Anitha @ 2009-10-29 16:44 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-devel
> > On the other hand, I think this can be documented in GDB usage
> > section of QEMU documentation.
>
> Patches to documentation bits are always welcome! Certain developers
> (definitely me included) tend to forget that people actually read
> documentation ;-)
>
So am I! But I can't help contemplating that it certainly weighs much higher when one has to decide if it is worth pursuing a project especially when the required features are rarely used by others. I, for instance, would have given up qemu-avr32 project altogether had the GDB stub part of it is not supported. It is one thing to know that the feature is not working (can be fixed hopefully) and entirely another if the feature is not at all supported.
Aah! Not one more managerial preach again :)
Anitha
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-10-29 16:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29 10:20 [Qemu-devel] Cross-debugging support in QEMU using GDB Boyapati, Anitha
2009-10-29 11:04 ` Alexander Graf
2009-10-29 11:10 ` Laurent Desnogues
2009-10-29 16:26 ` Boyapati, Anitha
2009-10-29 16:28 ` Alexander Graf
2009-10-29 16:44 ` Boyapati, Anitha
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).