On Mon, 2008-11-03 at 19:14 +0100, Jonas Maebe wrote:
> On 03 Nov 2008, at 01:06, Terry Kemp wrote:
> 
> > I'm getting a runtime error 231 when starting program on arm.
> > Stems from ANSI2WIDEMOVE in cwstring.pp returning ESysEBADF (9).
> >
> > Do I need to define something on arm for widestrings?
> 
> Run time error 231 in the unix wide string manager means that iconv  
> returned an unexpected error code (in the sens that it's not supported  
> by the code in the cwstring unit). Since you already compiled the  
> cwstring unit with debug information, you can step into it (or set a  
> breakpoint) and see what the error code is (or just add a writeln).  
> Once you find out, it'll probably be easier to figure out what the  
> problem is.
> 
> 
> Jonas
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Hi 

Attached is a gdb log.

The problem seems to be here...
fpc_char_to_uchar (C=38 '&') at ustrings.inc:644
644       widestringmanager.Ansi2UnicodeMoveProc(@c, w, 1);
(gdb) p w
$18 = (WIDESTRING) 0x0

where w is suddenly undefined.

thoughts?

Terry

(gdb) r -qws
Starting program: /home/root/project2 -qws
[HINT] TWinControl.CreateWnd creating Handle during loading Form1:TForm1 csDesig
ning=False
[HINT] TWinControl.CreateWnd creating Handle during loading Panel2:TPanel csDesi
gning=False
[HINT] TWinControl.CreateWnd creating Handle during loading StatusBar1:TStatusBa
r csDesigning=False
[HINT] TWinControl.CreateWnd creating Handle during loading BitBtn4:TBitBtn csDe
signing=False
[HINT] TWinControl.CreateWnd creating Handle during loading BitBtn1:TBitBtn csDe
signing=False
[HINT] TWinControl.CreateWnd creating Handle during loading BitBtn7:TBitBtn csDe
signing=False
[HINT] TWinControl.CreateWnd creating Handle during loading BitBtn8:TBitBtn csDe
signing=False
[HINT] TWinControl.CreateWnd creating Handle during loading Panel3:TPanel csDesi
gning=False

Breakpoint 1, TQTSTATICTEXT__SETTEXT (W=0x413d5a28, this=0x411c34c0)
    at qtwidgets.pas:4177
4177        AmpersandPos := Pos('&', W);
(gdb) p W
$11 = (WIDESTRING) 0x413d5a28
(gdb) p W^
$12 = 80 'P'
(gdb) p W[0]
$13 = 80 'P'
(gdb) p W[1]
$14 = 114 'r'
(gdb) p W[2]
$15 = 111 'o'
(gdb) p @
A syntax error in expression, near `'.
(gdb) p @W
$16 = (PWIDESTRING) 0xbe8aff58
(gdb) s
POS (C=38 '&', S=0x413d5a28) at ustrings.inc:1570
1570      wc:=c;
(gdb) p wc
$17 = 31248 #16
(gdb) p wc^
Attempt to take contents of a non-pointer value.
(gdb) s
fpc_char_to_uchar (C=38 '&') at ustrings.inc:643
643     begin
(gdb) s
fpc_pushexceptaddr (FT=1, _BUF=0xbe8afe28, _NEWADDR=0xbe8afe50)
    at except.inc:89
89      except.inc: No such file or directory.
        in except.inc
(gdb) s
90      in except.inc
(gdb) s
91      in except.inc
(gdb) s
92      in except.inc
(gdb) s
93      in except.inc
(gdb) s
94      in except.inc
(gdb) s
95      in except.inc
(gdb) s
SETJMP (S=
      {V1 = 1092367552, V2 = 1779220, V3 = 1092070912, V4 = 997416, V5 = 0, V6 
= 0, SL = 1076936704, FP = 3196780184, SP = 3196780052, PC = 177708})
    at setjump.inc:20
20      setjump.inc: No such file or directory.
        in setjump.inc
(gdb) s
21      in setjump.inc
(gdb) s
fpc_char_to_uchar (C=38 '&') at ustrings.inc:644
644       widestringmanager.Ansi2UnicodeMoveProc(@c, w, 1);
(gdb) p w
$18 = (WIDESTRING) 0x0
(gdb) p w^
Cannot access memory at address 0x0
(gdb) p w[1]
Cannot access memory at address 0x2
(gdb) p c
$19 = 38 '&'
(gdb) p @c
$20 = (ANSISTRING) 0xbe8afe6c
(gdb) s
ANSI2WIDEMOVE (SOURCE=0xbe8afe6c, DEST=0x0, LEN=1) at cwstring.pp:231
231         writeln('source ', source);
(gdb) c
Continuing.
source &��䊾|�����
dest 
len 1
Ansi2WideMove 9
Runtime error 231 at $0009D6C0
  $0009D6C0  ANSI2WIDEMOVE,  line 272 of ../unix/cwstring.pp
  $0002B654  fpc_char_to_uchar,  line 644 of 
/build/gumstix/gumstix-fpc/fpc-svn/rtl/inc/ustrings.inc
  $0002BDC4  POS,  line 1570 of 
/build/gumstix/gumstix-fpc/fpc-svn/rtl/inc/ustrings.inc
  $001B26A0  TQTSTATICTEXT__SETTEXT,  line 4177 of qtwidgets.pas
  $001A17A4  TQTWSWINCONTROL__SETTEXT,  line 360 of qtwscontrols.pp
  $000EA9A4  TWINCONTROL__WSSETTEXT,  line 4754 of ./include/wincontrol.inc
  $000EEF88  TWINCONTROL__INITIALIZEWND,  line 6615 of ./include/wincontrol.inc
  $000EEA98  TWINCONTROL__CREATEWND,  line 6525 of ./include/wincontrol.inc
  $000EE5E4  TWINCONTROL__CREATEHANDLE,  line 6440 of ./include/wincontrol.inc
  $000EFAA0  TWINCONTROL__HANDLENEEDED,  line 6831 of ./include/wincontrol.inc


Program exited with code 0347.
(gdb) 

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to