Quantcast

help :-( wm61 dll

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

help :-( wm61 dll

Danny Backx
David already helped me to find a really silly error in a previous
version.

When I try the stuff in
http://danny.backx.info/download/cegcc/wm61.tar.gz I get different
results on different devices.

I would expect the application to report the value 3 three times, but it
doesn't. This is with the code in SVN.

Does anyone see what the problem is ?

Thanks,

        Danny

pavilion: {248} tar tvfz /tmp/wm61.tar.gz
drwxrwxr-x danny/danny       0 2010-03-05 20:53 ./
-rw-rw-r-- danny/danny    2278 2010-03-05 20:53 ./t.o
-rw-rw-r-- danny/danny     177 2010-03-04 22:46 ./t.c
-rwxrwxr-x danny/danny   31086 2010-03-05 20:53 ./l.dll
-rw-rw-r-- danny/danny  121010 2010-03-05 20:53 ./l.dll.objdump
-rw-rw-r-- danny/danny     442 2010-03-04 22:48 ./main.c
-rw-rw-r-- danny/danny    2589 2010-03-05 20:53 ./l.o
-rwxrwxr-x danny/danny   31022 2010-03-05 20:53 ./t.dll
-rw-rw-r-- danny/danny    2621 2010-03-05 20:53 ./main.o
-rw-rw-r-- danny/danny  242699 2010-03-05 20:53 ./t.dll.od
-rw-rw-r-- danny/danny    1459 2010-03-05 20:07 ./Makefile
-rwxrwxr-x danny/danny   29106 2010-03-05 20:53 ./main.exe
-rw-rw-r-- danny/danny  121536 2010-03-05 20:53 ./t.dll.objdump
-rw-rw-r-- danny/danny  239433 2010-03-05 20:53 ./l.dll.od
-rw-rw-r-- danny/danny     235 2010-03-04 22:45 ./l.c
pavilion: {249} ls -l /tmp/wm61.tar.gz
-rw-rw-r-- 1 danny danny 174685 2010-03-05 20:54 /tmp/wm61.tar.gz
pavilion: {250} more *.c
::::::::::::::
l.c
::::::::::::::
#include <windows.h>

int a[5] = { 3, 4, 5, 6, 0 };

void foo(void)
{
        a[0] = 1;
        a[1] = 2;
        a[2] = 3;
        a[3] = 0;
}

void localquery(void)
{
        wchar_t s[32];

        wsprintf(s, L"localquery() -> %d", a[0]);
        MessageBoxW(0, s, L"info", 0);
}
::::::::::::::
main.c
::::::::::::::
#ifdef __UNDER_CE__
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>

extern int fun(void);

#ifdef __UNDER_CE__
int APIENTRY WinMain(HINSTANCE inst, HINSTANCE pi, LPWSTR cmd, int show)
{
        int x;
        wchar_t s[32];

        localquery();
        x = fun();
        wsprintf(s, L"fun() -> %d", x);
        MessageBox(0, s, L"info", 0);
        return 0;
}
#else
int main(int argc, char *argv[])
{
        int x = fun();

        printf("fun() -> %d\n", x);
        return 0;
}
#endif
::::::::::::::
t.c
::::::::::::::
#include <windows.h>

extern int a[];

int fun(void)
{
        wchar_t s[32];
        int     r;

        r = a[0];

        wsprintf(s, L"remote query -> %d", r);
        MessageBoxW(0, s, L"info", 0);
        return r;
}
pavilion: {251}
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help :-( wm61 dll

David Sveningsson
On 2010-03-05 20:57, Danny Backx wrote:
> David already helped me to find a really silly error in a previous
> version.
>
> When I try the stuff in
> http://danny.backx.info/download/cegcc/wm61.tar.gz I get different
> results on different devices.
>
> I would expect the application to report the value 3 three times, but it
> doesn't. This is with the code in SVN.

On my device it actually does.

I run it on an XPERIA X1 with CE-OS 5.2.19608 (Build 19608.1.2.60)

> Does anyone see what the problem is ?

Just to make sure the code is correct I compiled it with MSVC and indeed
3 is reported three times.

The only changes made to the code is adding __declspec(dllexport) and
__declspec(dllimport)

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help :-( wm61 dll

Danny Backx
On Mon, 2010-03-08 at 13:15 +0100, David Sveningsson wrote:

> On 2010-03-05 20:57, Danny Backx wrote:
> > David already helped me to find a really silly error in a previous
> > version.
> >
> > When I try the stuff in
> > http://danny.backx.info/download/cegcc/wm61.tar.gz I get different
> > results on different devices.
> >
> > I would expect the application to report the value 3 three times, but it
> > doesn't. This is with the code in SVN.
>
> On my device it actually does.
>
> I run it on an XPERIA X1 with CE-OS 5.2.19608 (Build 19608.1.2.60)

Is that with the EXE and two DLLs that I provided, or recompiled
versions ?

> > Does anyone see what the problem is ?
>
> Just to make sure the code is correct I compiled it with MSVC and indeed
> 3 is reported three times.

Can you send me the binaries for that ?

> The only changes made to the code is adding __declspec(dllexport) and
> __declspec(dllimport)

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help :-( wm61 dll

David Sveningsson
On 2010-03-08 17:24, Danny Backx wrote:

> On Mon, 2010-03-08 at 13:15 +0100, David Sveningsson wrote:
>> On 2010-03-05 20:57, Danny Backx wrote:
>>> David already helped me to find a really silly error in a previous
>>> version.
>>>
>>> When I try the stuff in
>>> http://danny.backx.info/download/cegcc/wm61.tar.gz I get different
>>> results on different devices.
>>>
>>> I would expect the application to report the value 3 three times, but it
>>> doesn't. This is with the code in SVN.
>>
>> On my device it actually does.
>>
>> I run it on an XPERIA X1 with CE-OS 5.2.19608 (Build 19608.1.2.60)
>
> Is that with the EXE and two DLLs that I provided, or recompiled
> versions ?

Recompiled, I just tried your binary and only localquery returns 3,
remotequery and fun returns garbage.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help :-( wm61 dll

Danny Backx
In reply to this post by Danny Backx
On Tue, 2010-03-09 at 12:46 +0100, David Sveningsson wrote:

> On 2010-03-08 22:29, Danny Backx wrote:
> > On Mon, 2010-03-08 at 19:48 +0100, David Sveningsson wrote:
> >> Danny Backx wrote:
> >>> On Mon, 2010-03-08 at 17:29 +0100, David Sveningsson wrote:
> >>>> On 2010-03-08 17:24, Danny Backx wrote:
> >>>>>> Just to make sure the code is correct I compiled it with MSVC and indeed
> >>>>>> 3 is reported three times.
> >>>>> Can you send me the binaries for that ?
> >>>
> >>>> Recompiled, I just tried your binary and only localquery returns 3,
> >>>> remotequery and fun returns garbage.
> >>>
> >>> So you recompiled with cegcc *and* with MSVC and got working EXEs
> >>> twice ?
> >>
> >> Actually with mingw32ce, but yes.
> >
> > I'd like those EXE/DLLs too please.
> >
> > Danny
> >
>
>
> See http://dump.sidvind.com/wm61_declspec.tar.gz
>
> I just noticed something strange.
>
> The original source you provided does actually *not* work, both
> remotequery and fun reports garbage. But with my declspec modifications
> it works, when compiled both with mingw32ce and msvc. A diff is also
> provided.
>
> Also, running your binaries directly (without recompiling) gives the
> same result as the recompiled.
>
> The archive contains three sets of binaries:
>
> * Your original source, recompiled with mingw32ce (not working) [a]
> * My modifications, compiled with mingw32ce (working) [b]
> * Binaries produced by msvc (working) [msvc]

Different here.

Several differences, I'll focus on one : both the stuff in directory b
and in directory msvc fail between the first and second dialog - meaning
the second dialog never apppears.

I've just done a debugging session with "b" :
pavilion: {41} arm-mingw32ce-gdb main.exe
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-mingw32ce"...
(gdb) target remote htc:9999
Remote debugging using htc:9999
[New Thread 1186696638]
Error while mapping shared library sections:
coredll.dll.0413.mui: No such file or directory.
Error while mapping shared library sections:
coredll.dll: No such file or directory.
Reading symbols from /home/danny/david/wm61/b/t.dll...done.
Loaded symbols for t.dll
Reading symbols from /home/danny/david/wm61/b/l.dll...done.
Loaded symbols for l.dll
Symbol file not found for coredll.dll.0413.mui
Symbol file not found for coredll.dll
WinMainCRTStartup (hInst=0x45feeede, hPrevInst=0x0,
lpCmdLine=0x31befed0, nCmdShow=5)
    at /temp/cegcc/trunk/cegcc/src/mingw/crt3.c:35
35      /temp/cegcc/trunk/cegcc/src/mingw/crt3.c: No such file or
directory.
        in /temp/cegcc/trunk/cegcc/src/mingw/crt3.c
(gdb) l WinMain
7       int __declspec(dllimport) fun(void);
8       void __declspec(dllimport) localquery(void);
9      
10      #ifdef __UNDER_CE__
11      int APIENTRY WinMain(HINSTANCE inst, HINSTANCE pi, LPWSTR cmd,
int show)
12      {
13              int x;
14              wchar_t s[32];
15      
16              localquery();
(gdb) break 16
Breakpoint 1 at 0x11070: file main.c, line 16.
(gdb) c
Continuing.

Breakpoint 1, WinMain (inst=0x45feeede, pi=0x0, cmd=0x31befed0, show=5)
at main.c:16
16              localquery();
(gdb) s
localquery () at l.c:17
17              wsprintf(s, L"localquery() -> %d", a[0]);
(gdb) n
18              MessageBoxW(0, s, L"info", 0);
(gdb) n
Error while mapping shared library sections:
commctrl.dll: No such file or directory.
Error while mapping shared library sections:
ole32.dll: No such file or directory.
Error while mapping shared library sections:
oleaut32.dll: No such file or directory.
Error while mapping shared library sections:
htmlview.dll: No such file or directory.
Error while mapping shared library sections:
ossvcs.dll: No such file or directory.
Error while mapping shared library sections:
aygshell.dll: No such file or directory.
Error while mapping shared library sections:
et9ime.dll: No such file or directory.
++ [ImeInquire]
-- [ImeInquire]
++ [ImeSetActiveContext]
++ [ImeSetActiveContext]
-- [ImeSetActiveContext]
++ [ImeSetActiveContext]
Error while mapping shared library sections:
et9disinput.dll: No such file or directory.
Error while mapping shared library sections:
et9dictionary.dll: No such file or directory.
-- [ImeSetActiveContext]
-- [ImeSetActiveContext]
++ [ImeSetActiveContext]
-- [ImeSetActiveContext]
++ [ImeSetActiveContext]
++ [ImeSetActiveContext]
-- [ImeSetActiveContext]
++ [ImeSetActiveContext]
-- [ImeSetActiveContext]
-- [ImeSetActiveContext]
++ [ImeSetActiveContext]
-- [ImeSetActiveContext]
19      }
(gdb) s
WinMain (inst=0x45feeede, pi=0x0, cmd=0x31befed0, show=5) at main.c:17
17              x = fun();
(gdb) s
fun () at t.c:10
10              r = a[0];
(gdb) p a
$1 = 0x1062000
(gdb) p a[0]
$2 = 3
(gdb) s
Data Abort: Thread=84aaac64 Proc=80338930 'main.exe'
AKY=00800001 PC=0105109c(t.dll+0x0000109c) RA=00011078(main.exe
+0x00001078) BVA=310ac3c8 FSR=00000007

Program received signal SIGSEGV, Segmentation fault.
0x0105109c in fun () at t.c:10
10              r = a[0];
(gdb)

and the b/t.dll.objdump file reads :
1000108c <fun>:
1000108c:       e92d4800        push    {fp, lr}
10001090:       e28db004        add     fp, sp, #4
10001094:       e24dd044        sub     sp, sp, #68     ; 0x44
10001098:       e59f3044        ldr     r3, [pc, #68]   ; 100010e4 <fun
+0x58>
1000109c:       e5933000        ldr     r3, [r3]
100010a0:       e5933000        ldr     r3, [r3]
100010a4:       e50b3008        str     r3, [fp, #-8]
[...]
100010e4:       1000320c        andne   r3, r0, ip, lsl #4
100010e8:       10003000        andne   r3, r0, r0
100010ec:       10003028        andne   r3, r0, r8, lsr #32

Meaning, I think, that it does indeed crash in that statement. The
double "ldr r3, [r3]" seems odd. Even more odd is that the code in
a/t.dll.objdump is different : it looks exactly the same except only one
of these "ldr r3, [r3]" instructions.

Trying to figure out which one is correct, and how to debug at the
assembler level :-(

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help :-( wm61 dll

Danny Backx
On Wed, 2010-03-10 at 21:15 +0100, Danny Backx wrote:
> Meaning, I think, that it does indeed crash in that statement. The
> double "ldr r3, [r3]" seems odd. Even more odd is that the code in
> a/t.dll.objdump is different : it looks exactly the same except only one
> of these "ldr r3, [r3]" instructions.
>
> Trying to figure out which one is correct, and how to debug at the
> assembler level :-(

It would appear that in this sample program, the crash is legitimate
because - yet again - an invalid pointer is read. The value of 0x16342b8
which is in r3 is not a valid pointer.

In the second debugging session below I dug deeper and fixed the value
of r3 which executing, which made the program work well.

I'll try to find the cause of this now...

        Danny

pavilion: {294} arm-mingw32ce-gdb main.exe
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-mingw32ce"...
(gdb) target remote ipaq:9999
Remote debugging using ipaq:9999
[New Thread 616578450]
Error while mapping shared library sections:
coredll.dll.0409.mui: No such file or directory.
Error while mapping shared library sections:
coredll.dll: No such file or directory.
Reading symbols from /home/danny/simple/wince/t.dll...done.
Loaded symbols for t.dll
Reading symbols from /home/danny/simple/wince/l.dll...done.
Loaded symbols for l.dll
Symbol file not found for coredll.dll.0409.mui
Symbol file not found for coredll.dll
WinMainCRTStartup (hInst=0x254a42f6, hPrevInst=0x0,
lpCmdLine=0x2211fed8, nCmdShow=5)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/crt3.c:35
35      {
(gdb) info share
>From        To          Syms Read   Shared Object Library
0x01571000  0x01574064  Yes         t.dll
0x01581000  0x01584068  Yes         l.dll
                        No          coredll.dll.0409.mui
                        No          coredll.dll
(gdb) l
30       * This function is called from the entry point for all
programs.
31       */
32      void
33      WinMainCRTStartup (HINSTANCE hInst, HINSTANCE hPrevInst,
34                         LPWSTR lpCmdLine, int nCmdShow)
35      {
36        int nRet;
37      
38        /*
39         * Initialize floating point unit.
(gdb) l WinMain
6      
7       extern int fun(void);
8      
9       #ifdef __UNDER_CE__
10      int APIENTRY WinMain(HINSTANCE inst, HINSTANCE pi, LPWSTR cmd,
int show)
11      {
12              int x;
13              wchar_t s[32];
14      
15              localquery();
(gdb) break localquery
Breakpoint 1 at 0x15810e0: file l.c, line 17.
(gdb) c
Continuing.

Breakpoint 1, localquery () at l.c:17
17              wsprintf(s, L"localquery() -> %d", a[0]);
(gdb) n
18              MessageBoxW(0, s, L"info", 0);
(gdb) p a
$1 = {3, 4, 5, 6, 0}
(gdb) p &a
$2 = (int (*)[5]) 0x1582000
(gdb) x/32xb 0x1582000
0x1582000 <a>:  0x03    0x00    0x00    0x00    0x04    0x00    0x00
0x00
0x1582008 <a+8>:        0x05    0x00    0x00    0x00    0x06    0x00
0x00    0x00
0x1582010 <a+16>:       0x00    0x00    0x00    0x00    0x18    0x18
0x58    0x01
0x1582018 <first_atexit>:       0x60    0x00    0x12    0x00    0x64
0x00    0x12    0x00
(gdb) fin
Run till exit from #0  localquery () at l.c:18
Error while mapping shared library sections:
ole32.dll: No such file or directory.
Error while mapping shared library sections:
ossvcs.dll: No such file or directory.
Error while mapping shared library sections:
commctrl.dll: No such file or directory.
Error while mapping shared library sections:
aygshell.dll: No such file or directory.
Error while mapping shared library sections:
oleaut32.dll: No such file or directory.
Error while mapping shared library sections:
compime.dll: No such file or directory.
Error while mapping shared library sections:
shellres.dll: No such file or directory.
WinMain (inst=0x254a42f6, pi=0x0, cmd=0x2211fed8, show=5) at main.c:16
16              x = fun();
(gdb) si
0x00011794 in fun ()
(gdb) display/x $pc
1: /x $pc = 0x11794
(gdb) si
0x00011798 in fun ()
1: /x $pc = 0x11798
(gdb) display/i $pc
2: x/i $pc
0x11798 <fun+4>:        ldr     pc, [r12]
(gdb) si
fun () at t.c:6
6       {
2: x/i $pc
0x157108c <fun>:        push    {r11, lr}
1: /x $pc = 0x157108c
(gdb)
0x01571090      6       {
2: x/i $pc
0x1571090 <fun+4>:      add     r11, sp, #4     ; 0x4
1: /x $pc = 0x1571090
(gdb)
0x01571094      6       {
2: x/i $pc
0x1571094 <fun+8>:      sub     sp, sp, #68     ; 0x44
1: /x $pc = 0x1571094
(gdb)
10              r = a[0];
2: x/i $pc
0x1571098 <fun+12>:     ldr     r3, [pc, #64]   ; 0x15710e0 <__fu0_a>
1: /x $pc = 0x1571098
(gdb) info reg
r0             0x1      1
r1             0x2      2
r2             0x10     16
r3             0x0      0
r4             0x254a42f6       625623798
r5             0x2      2
r6             0x11000  69632
r7             0x1ffcc74        33541236
r8             0x1ffc9e0        33540576
r9             0x2211fed8       571604696
r10            0x254a42f6       625623798
r11            0x2211fdd0       571604432
r12            0x131f0  78320
sp             0x2211fd88       0x2211fd88
lr             0x11078  69752
pc             0x1571098        0x1571098 <fun+12>
fps            0x0      0
cpsr           0x60000010       1610612752
(gdb) x/32xb 0x15710e0
0x15710e0 <__fu0_a>:    0xb8    0x42    0x63    0x01    0x00    0x30
0x57    0x01
0x15710e8 <__fu0_a+8>:  0x28    0x30    0x57    0x01    0x04    0x30
0x9f    0xe5
0x15710f0 <__atexit_first+4>:   0x00    0x00    0x93    0xe5    0x0e
0xf0    0xa0    0xe1
0x15710f8 <__atexit_first+12>:  0x04    0x20    0x57    0x01    0x92
0x01    0x00    0xea
(gdb) si
0x0157109c      10              r = a[0];
2: x/i $pc
0x157109c <fun+16>:     ldr     r3, [r3]
1: /x $pc = 0x157109c
(gdb) info reg
r0             0x1      1
r1             0x2      2
r2             0x10     16
r3             0x16342b8        23282360
r4             0x254a42f6       625623798
r5             0x2      2
r6             0x11000  69632
r7             0x1ffcc74        33541236
r8             0x1ffc9e0        33540576
r9             0x2211fed8       571604696
r10            0x254a42f6       625623798
r11            0x2211fdd0       571604432
r12            0x131f0  78320
sp             0x2211fd88       0x2211fd88
lr             0x11078  69752
pc             0x157109c        0x157109c <fun+16>
fps            0x0      0
cpsr           0x60000010       1610612752
(gdb) x/32xb 0x16342b8
0x16342b8:      Cannot access memory at address 0x16342b8
(gdb) si
Data Abort: Thread=8556c640 Proc=8034e160 'main.exe'
AKY=00010001 PC=0157109c(t.dll+0x0000109c) RA=00011078(main.exe
+0x00001078) BVA=236342b8 FSR=00000007

Program received signal SIGSEGV, Segmentation fault.
0x0157109c in fun () at t.c:10
10              r = a[0];
2: x/i $pc
0x157109c <fun+16>:     ldr     r3, [r3]
1: /x $pc = 0x157109c
(gdb)


pavilion: {405} arm-mingw32ce-gdb main.exe
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-mingw32ce"...
(gdb) target remote ipaq:9999
Remote debugging using ipaq:9999
[New Thread -434447242]
Error while mapping shared library sections:
coredll.dll.0409.mui: No such file or directory.
Error while mapping shared library sections:
coredll.dll: No such file or directory.
Reading symbols from /home/danny/simple/wince/array/t.dll...done.
Loaded symbols for t.dll
Reading symbols from /home/danny/simple/wince/array/l.dll...done.
Loaded symbols for l.dll
Symbol file not found for coredll.dll.0409.mui
Symbol file not found for coredll.dll
WinMainCRTStartup (hInst=0xe5d68efa, hPrevInst=0x0,
lpCmdLine=0x1c11fed8, nCmdShow=5)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/crt3.c:35
35      {
(gdb) l WinMain
6      
7       extern int fun(void);
8      
9       #ifdef __UNDER_CE__
10      int APIENTRY WinMain(HINSTANCE inst, HINSTANCE pi, LPWSTR cmd,
int show)
11      {
12              int x;
13              wchar_t s[32];
14      
15              localquery();
(gdb) break 16
Breakpoint 1 at 0x11074: file main.c, line 16.
(gdb) c
Continuing.
Error while mapping shared library sections:
ole32.dll: No such file or directory.
Error while mapping shared library sections:
ossvcs.dll: No such file or directory.
Error while mapping shared library sections:
commctrl.dll: No such file or directory.
Error while mapping shared library sections:
aygshell.dll: No such file or directory.
Error while mapping shared library sections:
oleaut32.dll: No such file or directory.
Error while mapping shared library sections:
compime.dll: No such file or directory.
Error while mapping shared library sections:
shellres.dll: No such file or directory.

Breakpoint 1, WinMain (inst=0xe5d68efa, pi=0x0, cmd=0x1c11fed8, show=5)
at main.c:16
16              x = fun();
(gdb) display/i $pc
1: x/i $pc
0x11074 <WinMain+32>:   bl      0x11794 <fun>
(gdb) si
0x00011794 in fun ()
1: x/i $pc
0x11794 <fun>:  ldr     r12, [pc, #0]   ; 0x1179c <fun+8>
(gdb)
0x00011798 in fun ()
1: x/i $pc
0x11798 <fun+4>:        ldr     pc, [r12]
(gdb)
fun () at t.c:6
6       {
1: x/i $pc
0x14e108c <fun>:        push    {r11, lr}
(gdb)
0x014e1090      6       {
1: x/i $pc
0x14e1090 <fun+4>:      add     r11, sp, #4     ; 0x4
(gdb)
0x014e1094      6       {
1: x/i $pc
0x14e1094 <fun+8>:      sub     sp, sp, #68     ; 0x44
(gdb)
10              r = a[0];
1: x/i $pc
0x14e1098 <fun+12>:     ldr     r3, [pc, #64]   ; 0x14e10e0 <__fu0_a>
(gdb) info reg
r0             0x1      1
r1             0x2      2
r2             0x10     16
r3             0x0      0
r4             0xe5d68efa       3856043770
r5             0x2      2
r6             0x11000  69632
r7             0x1ffcc74        33541236
r8             0x1ffc9e0        33540576
r9             0x1c11fed8       470941400
r10            0xe5d68efa       3856043770
r11            0x1c11fdd0       470941136
r12            0x131f0  78320
sp             0x1c11fd88       0x1c11fd88
lr             0x11078  69752
pc             0x14e1098        0x14e1098 <fun+12>
fps            0x0      0
cpsr           0x60000010       1610612752
(gdb) x/32bx 0x14e10e0
0x14e10e0 <__fu0_a>:    0xf8    0x1f    0x4f    0x01    0x00    0x30
0x4e    0x01
0x14e10e8 <__fu0_a+8>:  0x28    0x30    0x4e    0x01    0x04    0x30
0x9f    0xe5
0x14e10f0 <__atexit_first+4>:   0x00    0x00    0x93    0xe5    0x0e
0xf0    0xa0    0xe1
0x14e10f8 <__atexit_first+12>:  0x04    0x20    0x4e    0x01    0x92
0x01    0x00    0xea
(gdb) si
0x014e109c      10              r = a[0];
1: x/i $pc
0x14e109c <fun+16>:     ldr     r3, [r3]
(gdb) l fun
1       #include <windows.h>
2      
3       extern int a[];
4      
5       int fun(void)
6       {
7               wchar_t s[32];
8               int     r;
9      
10              r = a[0];
(gdb) p &fun
$1 = (int (*)(void)) 0x14e108c <fun>
(gdb) disas &fun
Dump of assembler code for function fun:
0x014e108c <fun+0>:     push    {r11, lr}
0x014e1090 <fun+4>:     add     r11, sp, #4     ; 0x4
0x014e1094 <fun+8>:     sub     sp, sp, #68     ; 0x44
0x014e1098 <fun+12>:    ldr     r3, [pc, #64]   ; 0x14e10e0 <__fu0_a>
0x014e109c <fun+16>:    ldr     r3, [r3]
0x014e10a0 <fun+20>:    str     r3, [r11, #-8]
0x014e10a4 <fun+24>:    sub     r3, r11, #72    ; 0x48
0x014e10a8 <fun+28>:    mov     r0, r3
0x014e10ac <fun+32>:    ldr     r1, [pc, #48]   ; 0x14e10e4 <__fu0_a+4>
0x014e10b0 <fun+36>:    ldr     r2, [r11, #-8]
0x014e10b4 <fun+40>:    bl      0x14e1710 <wsprintfW>
0x014e10b8 <fun+44>:    sub     r3, r11, #72    ; 0x48
0x014e10bc <fun+48>:    mov     r0, #0  ; 0x0
0x014e10c0 <fun+52>:    mov     r1, r3
0x014e10c4 <fun+56>:    ldr     r2, [pc, #28]   ; 0x14e10e8 <__fu0_a+8>
0x014e10c8 <fun+60>:    mov     r3, #0  ; 0x0
0x014e10cc <fun+64>:    bl      0x14e171c <MessageBoxW>
0x014e10d0 <fun+68>:    ldr     r3, [r11, #-8]
0x014e10d4 <fun+72>:    mov     r0, r3
0x014e10d8 <fun+76>:    sub     sp, r11, #4     ; 0x4
0x014e10dc <fun+80>:    pop     {r11, pc}
0x014e10e0 <__fu0_a+0>: strdeq  r1, [pc, #-248] ; 0x14e0ff0
0x014e10e4 <__fu0_a+4>: cmpeq   lr, r0
0x014e10e8 <__fu0_a+8>: cmpeq   lr, r8, lsr #32
End of assembler dump.
(gdb) bt
#0  0x014e109c in fun () at t.c:10
#1  0x00011078 in WinMain (inst=0xe5d68efa, pi=0x0, cmd=0x1c11fed8,
show=5) at main.c:16
#2  0x0001103c in WinMainCRTStartup (hInst=0xe5d68efa, hPrevInst=<value
optimized out>,
    lpCmdLine=<value optimized out>, nCmdShow=<value optimized out>)

at /home/danny/src/cegcc/svn.sf.net/cegcc/trunk/cegcc/src/mingw/crt3.c:62
(gdb) disass localquery
Dump of assembler code for function localquery:
0x014f10d4 <localquery+0>:      push    {r11, lr}
0x014f10d8 <localquery+4>:      add     r11, sp, #4     ; 0x4
0x014f10dc <localquery+8>:      sub     sp, sp, #64     ; 0x40
0x014f10e0 <localquery+12>:     ldr     r3, [pc, #52]   ; 0x14f111c
<localquery+72>
0x014f10e4 <localquery+16>:     ldr     r3, [r3]
0x014f10e8 <localquery+20>:     sub     r2, r11, #68    ; 0x44
0x014f10ec <localquery+24>:     mov     r0, r2
0x014f10f0 <localquery+28>:     ldr     r1, [pc, #40]   ; 0x14f1120
<localquery+76>
0x014f10f4 <localquery+32>:     mov     r2, r3
0x014f10f8 <localquery+36>:     bl      0x14f174c <wsprintfW>
0x014f10fc <localquery+40>:     sub     r3, r11, #68    ; 0x44
0x014f1100 <localquery+44>:     mov     r0, #0  ; 0x0
0x014f1104 <localquery+48>:     mov     r1, r3
0x014f1108 <localquery+52>:     ldr     r2, [pc, #20]   ; 0x14f1124
<localquery+80>
0x014f110c <localquery+56>:     mov     r3, #0  ; 0x0
0x014f1110 <localquery+60>:     bl      0x14f1758 <MessageBoxW>
0x014f1114 <localquery+64>:     sub     sp, r11, #4     ; 0x4
0x014f1118 <localquery+68>:     pop     {r11, pc}
0x014f111c <localquery+72>:     mrseq   r2, SPSR
0x014f1120 <localquery+76>:     mrseq   r3, SPSR
0x014f1124 <localquery+80>:     cmpeq   pc, r8, lsr #32
End of assembler dump.
(gdb) x/32xb 0x014f111c
0x14f111c <localquery+72>:      0x00    0x20    0x4f    0x01    0x00
0x30    0x4f    0x01
0x14f1124 <localquery+80>:      0x28    0x30    0x4f    0x01    0x04
0x30    0x9f    0xe5
0x14f112c <__atexit_first+4>:   0x00    0x00    0x93    0xe5    0x0e
0xf0    0xa0    0xe1
0x14f1134 <__atexit_first+12>:  0x18    0x20    0x4f    0x01    0x92
0x01    0x00    0xea
(gdb) x/32xb 0x014f2000
0x14f2000 <a>:  0x03    0x00    0x00    0x00    0x04    0x00    0x00
0x00
0x14f2008 <a+8>:        0x05    0x00    0x00    0x00    0x06    0x00
0x00    0x00
0x14f2010 <a+16>:       0x00    0x00    0x00    0x00    0x18    0x18
0x4f    0x01
0x14f2018 <first_atexit>:       0x60    0x00    0x12    0x00    0x64
0x00    0x12    0x00
(gdb) info reg
r0             0x1      1
r1             0x2      2
r2             0x10     16
r3             0x14f1ff8        21962744
r4             0xe5d68efa       3856043770
r5             0x2      2
r6             0x11000  69632
r7             0x1ffcc74        33541236
r8             0x1ffc9e0        33540576
r9             0x1c11fed8       470941400
r10            0xe5d68efa       3856043770
r11            0x1c11fdd0       470941136
r12            0x131f0  78320
sp             0x1c11fd88       0x1c11fd88
lr             0x11078  69752
pc             0x14e109c        0x14e109c <fun+16>
fps            0x0      0
cpsr           0x60000010       1610612752
(gdb) set $r3 0x14f2000
A syntax error in expression, near `0x14f2000'.
(gdb) set $r3 x14f2000
A syntax error in expression, near `x14f2000'.
(gdb) set $r3 0
A syntax error in expression, near `0'.
(gdb) set $r3=0
(gdb) info reg
r0             0x1      1
r1             0x2      2
r2             0x10     16
r3             0x0      0
r4             0xe5d68efa       3856043770
r5             0x2      2
r6             0x11000  69632
r7             0x1ffcc74        33541236
r8             0x1ffc9e0        33540576
r9             0x1c11fed8       470941400
r10            0xe5d68efa       3856043770
r11            0x1c11fdd0       470941136
r12            0x131f0  78320
sp             0x1c11fd88       0x1c11fd88
lr             0x11078  69752
pc             0x14e109c        0x14e109c <fun+16>
fps            0x0      0
cpsr           0x60000010       1610612752
(gdb) set $r3=0x14f2000
(gdb) info reg
r0             0x1      1
r1             0x2      2
r2             0x10     16
r3             0x14f2000        21962752
r4             0xe5d68efa       3856043770
r5             0x2      2
r6             0x11000  69632
r7             0x1ffcc74        33541236
r8             0x1ffc9e0        33540576
r9             0x1c11fed8       470941400
r10            0xe5d68efa       3856043770
r11            0x1c11fdd0       470941136
r12            0x131f0  78320
sp             0x1c11fd88       0x1c11fd88
lr             0x11078  69752
pc             0x14e109c        0x14e109c <fun+16>
fps            0x0      0
cpsr           0x60000010       1610612752
(gdb) si
0x014e10a0      10              r = a[0];
1: x/i $pc
0x14e10a0 <fun+20>:     str     r3, [r11, #-8]
(gdb) info reg
r0             0x1      1
r1             0x2      2
r2             0x10     16
r3             0x3      3
r4             0xe5d68efa       3856043770
r5             0x2      2
r6             0x11000  69632
r7             0x1ffcc74        33541236
r8             0x1ffc9e0        33540576
r9             0x1c11fed8       470941400
r10            0xe5d68efa       3856043770
r11            0x1c11fdd0       470941136
r12            0x131f0  78320
sp             0x1c11fd88       0x1c11fd88
lr             0x11078  69752
pc             0x14e10a0        0x14e10a0 <fun+20>
fps            0x0      0
cpsr           0x60000010       1610612752
(gdb) si
12              wsprintf(s, L"remote query -> %d", r);
1: x/i $pc
0x14e10a4 <fun+24>:     sub     r3, r11, #72    ; 0x48
(gdb) c
Continuing.

Program exited normally.
(gdb) q





--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help :-( wm61 dll

Vincent Richomme
On Sat, 13 Mar 2010 09:47:09 +0100, Danny Backx
<[hidden email]>
wrote:
> On Wed, 2010-03-10 at 21:15 +0100, Danny Backx wrote:
>> Meaning, I think, that it does indeed crash in that statement. The
>> double "ldr r3, [r3]" seems odd. Even more odd is that the code in
>> a/t.dll.objdump is different : it looks exactly the same except only
one

>> of these "ldr r3, [r3]" instructions.
>>
>> Trying to figure out which one is correct, and how to debug at the
>> assembler level :-(
>
> It would appear that in this sample program, the crash is legitimate
> because - yet again - an invalid pointer is read. The value of 0x16342b8
> which is in r3 is not a valid pointer.
>
> In the second debugging session below I dug deeper and fixed the value
> of r3 which executing, which made the program work well.
>
> I'll try to find the cause of this now...
>

Ok when reading some post on mingw mailing list,I could read the following
lines :

"With those conditions, the  lack of an -enable-auto-import switch does
not
cause the 0xc0000005 error  that ld warns about here:

"warning: auto-importing has been activated without --enable-auto-import
specified on the command line.
This should work unless it involves constant data structures referencing"

If you want to make --enable-auto-import the default, which makes sense
with
Kai's pseudo-reloc fixes, the place to do it is in src/ld/pe.em (not in
gcc
specs)."


It looks like some of the issues you have reported about external symbols.
Maybe it can help ?





------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: help :-( wm61 dll

Danny Backx
On Mon, 2010-03-15 at 13:25 +0100, Vincent Richomme wrote:
> Ok when reading some post on mingw mailing list,I could read the following
> lines :
>
> "With those conditions, the  lack of an -enable-auto-import switch does
> not
> cause the 0xc0000005 error  that ld warns about here:

>
> It looks like some of the issues you have reported about external symbols.
> Maybe it can help ?

Thanks for the pointer, yes this may be the same or a similar issue.

I'm now looking into the way the imports and exports are handled in my
example.

        Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cegcc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Loading...