Forum > General

problem using ARM cross compiler with classes

(1/2) > >>

petex:
hello,
I can cross-compile a simple program for the raspberry pi (linux) using windows pc. If i introduce the unit "Classes" i get an exeption in the initialisation:


--- Quote ---An unhandled exception occurred at $00010D10:
EAccessViolation: Access violation

--- End quote ---

this is my program :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program test ;{$define unix}  {$mode objfpc}{$H+} uses   cthreads,   unix,  sysutils,  classes; //var//    parseStrings : TStringList ;begin   writeln('TEST');//  parseStrings := TStringList.Create;  while true do; end.  
Are there any obvious solutions or things to try before i try and debug it.

I don't have a lazarus debugger working with the rpi and presumably i would need to use gdb and backtrace.

cdbc:
Hi

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program test ;{$define unix} //<-- if you compile on linux, mac, unix,// the above gets defined automagically {$mode objfpc}{$H+} uses   cthreads,   ///// unix, ///// not unix, but  baseunix, // <-- if you need it at all...  sysutils,  classes;These corrections should let you compile and get on with it...
Regards Benny

Thaddy:
Try it like this (tested):
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program test ;{$mode objfpc}{$H+}uses{$ifdef unix}   cthreads,// automatic{$endif}  classes; var  parseStrings : TStringList ;begin  parseStrings := TStringList.Create;  try    // do someting    parseStrings.Add('TEST');    writeln(parseStrings.text);  finally    parseStrings.Free;  end;  end.

cdbc:
Thanks Thaddy =^
Cannot test - I ain't got no winders.
Regards Benny

petex:
The test program (and my program) work on a pi 2 Model B. (that system has the debugger etc so i was going to investigate the crash but discovered it worked ok)

I get the exception trying to run it on a pi zero.

Both devices have the same operating system version.


--- Quote ---EAccessViolation: Access violation
  $00010E30
  $B6DC1884


--- End quote ---


 I did a command "ldd test" on both machines and get the following:

Pi Model B

--- Quote ---linux-vdso.so.1 (0x7eefd000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x76f50000)
        libdl.so.2 => /lib/libdl.so.2 (0x76f20000)
        libc.so.6 => /lib/libc.so.6 (0x76db0000)
        /lib/ld-linux-armhf.so.3 (0x76f75000)


--- End quote ---

Pi zero W

--- Quote ---libpthread.so.0 => /lib/libpthread.so.0 (0xb6f20000)
        libdl.so.2 => /lib/libdl.so.2 (0xb6ef0000)
        libc.so.6 => /lib/libc.so.6 (0xb6d80000)
        /lib/ld-linux-armhf.so.3 (0xb6f4c000)


--- End quote ---

I don't know if this is a red herring, but the difference is "linux-vdso.so.1" and apparently this isn't really a library module.

Pi zero  cpu


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---processor       : 0model name      : ARMv6-compatible processor rev 7 (v6l)BogoMIPS        : 697.95Features        : half thumb fastmult vfp edsp java tlsCPU implementer : 0x41CPU architecture: 7CPU variant     : 0x0CPU part        : 0xb76CPU revision    : 7 Hardware        : BCM2835Revision        : 9000c1Serial          : 000000003f115cb7Model           : Raspberry Pi Zero W Rev 1.1  

Navigation

[0] Message Index

[#] Next page

Go to full version