Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Maemo: Developers

Can't debug an application under FREMANTLE_ARMEL target in Scratchbox

 

 

Maemo developers RSS feed   Index | Next | Previous | View Threaded


burka.victor at yandex

Nov 24, 2009, 8:55 AM

Post #1 of 6 (800 views)
Permalink
Can't debug an application under FREMANTLE_ARMEL target in Scratchbox

Hello,

I'm trying to debug very simple application under FREMANTLE_ARMEL target and can't do that. What I got is the following:

1. The application:

#include <iostream>
using namespace std;

int main(int argc, char * argv[])
{
cout << "Hello 1" << endl;
return 0;
}

2. The build command:

[sbox-FREMANTLE_ARMEL: ~/Projects/simple] > g++ -Wall -g -o simple main.cpp

3. The debug command. I tried both :

3.1.

[sbox-FREMANTLE_ARMEL: ~/Projects/simple] > gdb simple
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi"...
(gdb) break main.cpp:6
Breakpoint 1 at 0x885c: file main.cpp, line 6.
(gdb) run
Starting program: /home/victor/Projects/simple/simple
Don't know how to run. Try "help target".
(gdb)

3.2.

[sbox-FREMANTLE_ARMEL: ~/Projects/simple] > native-gdb simple
GNU gdb (GDB) 6.8.50.20090417-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) break main.cpp:6
Breakpoint 1 at 0x885c: file main.cpp, line 6.
(gdb) run
Starting program: /home/victor/Projects/simple/simple
qemu: Unsupported syscall: 26
Hello 1
/home/bifh6/fremantle-arm-prereleased.cs2007q3/work/gdb-6.8.50.20090417/gdb/linux-nat.c:2973: internal-error: linux_nat_wait: Assertion `status == 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

-----

So everything works fine under FREMANTLE_X86 target if I type "native-gdb simple" but I want to understand why it doesn't work on FREMANTLE_ARMEL.

I also tried some simple Qt application on FREMANTLE_ARMEL. I run it and the debugger accepted the "break main.cpp:5" command but didn't stop there despite this is the first line of application in main function. The same application stopped in that line under FREMANTLE_X86

If anybody knows how to solve that problem, I would appreciate that.

Regards,
Victor
_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


agarcia at igalia

Nov 24, 2009, 9:02 AM

Post #2 of 6 (774 views)
Permalink
Re: Can't debug an application under FREMANTLE_ARMEL target in Scratchbox [In reply to]

On Tue, Nov 24, 2009 at 07:55:47PM +0300, Burka Victor wrote:

> I'm trying to debug very simple application under FREMANTLE_ARMEL
> target and can't do that.

The armel target is not meant to actually run or debug applications,
but only to compile them to use in the device.

If you want to debug your apps inside scratchbox, use the x86 target
instead.

Berto
_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


donaggio at gmail

Nov 24, 2009, 9:10 AM

Post #3 of 6 (768 views)
Permalink
Re: Can't debug an application under FREMANTLE_ARMEL target in Scratchbox [In reply to]

That's true, but sometime it happens that an application which runs just
fine under FREMANTLE_X86 immediatly crashes when executed in the device
itself.
It occured to me with the last version of grsync (in extras-devel and
-testing) and I'm waiting for the real device to try to understand what's
happening.

--
Luca Donaggio

On Tue, Nov 24, 2009 at 6:02 PM, Alberto Garcia <agarcia [at] igalia> wrote:

> On Tue, Nov 24, 2009 at 07:55:47PM +0300, Burka Victor wrote:
>
> > I'm trying to debug very simple application under FREMANTLE_ARMEL
> > target and can't do that.
>
> The armel target is not meant to actually run or debug applications,
> but only to compile them to use in the device.
>
> If you want to debug your apps inside scratchbox, use the x86 target
> instead.
>
> Berto
> _______________________________________________
> maemo-developers mailing list
> maemo-developers [at] maemo
> https://lists.maemo.org/mailman/listinfo/maemo-developers
>


Yalong.Sun at digia

Nov 24, 2009, 5:41 PM

Post #4 of 6 (757 views)
Permalink
RE: Can't debug an application under FREMANTLE_ARMEL target in Scratchbox [In reply to]

>-----Original Message-----
>From: maemo-developers-bounces [at] maemo
>[mailto:maemo-developers-bounces [at] maemo] On Behalf Of Alberto Garcia
>Sent: Wednesday, November 25, 2009 1:03 AM
>To: maemo-developers [at] maemo
>Subject: Re: Can't debug an application under FREMANTLE_ARMEL
>target in Scratchbox
>
>On Tue, Nov 24, 2009 at 07:55:47PM +0300, Burka Victor wrote:
>
>> I'm trying to debug very simple application under FREMANTLE_ARMEL
>> target and can't do that.
>
>The armel target is not meant to actually run or debug applications,
>but only to compile them to use in the device.
>
>If you want to debug your apps inside scratchbox, use the x86 target
>instead.
>

Yes, and there is another way to run your app in Scratchbox. To run emulator first then run your app inside the emulator. And it works for Diablo. I have not touched Fremantle but be curious that it should be a similar one there.

yalong

>Berto
>_______________________________________________
>maemo-developers mailing list
>maemo-developers [at] maemo
>https://lists.maemo.org/mailman/listinfo/maemo-developers
>
_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


kimmo.hamalainen at nokia

Nov 24, 2009, 11:56 PM

Post #5 of 6 (745 views)
Permalink
Re: Can't debug an application under FREMANTLE_ARMEL target in Scratchbox [In reply to]

On Tue, 2009-11-24 at 18:02 +0100, ext Alberto Garcia wrote:
> On Tue, Nov 24, 2009 at 07:55:47PM +0300, Burka Victor wrote:
>
> > I'm trying to debug very simple application under FREMANTLE_ARMEL
> > target and can't do that.
>
> The armel target is not meant to actually run or debug applications,
> but only to compile them to use in the device.

Yes, this is because Qemu does not completely emulate the ARM processor.
However, if you have a real ARM device, you could set up Scratchbox to
use CPU transparency over network to run the binaries in the real ARM
processor (like we did back in 2004-2005).

-Kimmo


_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


riku.voipio at nokia

Nov 25, 2009, 4:34 AM

Post #6 of 6 (747 views)
Permalink
Re: Can't debug an application under FREMANTLE_ARMEL target in Scratchbox [In reply to]

ext Burka Victor wrote:
> [sbox-FREMANTLE_ARMEL: ~/Projects/simple] > gdb simple
> GNU gdb 6.8
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi"...
> (gdb) break main.cpp:6
> Breakpoint 1 at 0x885c: file main.cpp, line 6.
> (gdb) run
> Starting program: /home/victor/Projects/simple/simple
> Don't know how to run. Try "help target".
> (gdb)

cross-gdb doesn't know howto run code. It is basically a tool to look at
coredumps.

>
> 3.2.
>
> [sbox-FREMANTLE_ARMEL: ~/Projects/simple] > native-gdb simple
> GNU gdb (GDB) 6.8.50.20090417-debian
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "arm-linux-gnueabi".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> (gdb) break main.cpp:6
> Breakpoint 1 at 0x885c: file main.cpp, line 6.
> (gdb) run
> Starting program: /home/victor/Projects/simple/simple
> qemu: Unsupported syscall: 26

qemu doesn't support ptrace syscall. gdb is basicly a glorified ptrace
wrapper. adding ptrace support to qemu would require quite a bit of
work.

> If anybody knows how to solve that problem, I would appreciate that.

Apart from from implementing ptrace in qemu, there little once can do
(currently). The closest one can do is abort(); at some point and the
use gdb to examine the coredump.

_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers

Maemo developers RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.