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
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to