Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-05

Help with the IDE

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hello and good day,

As a pascal programmer, I used many years Borland Pascal 7.01. To escape the 16 bit limitations, I've migrated to Virtual Pascal 2.1 The IDE is very similar between them, VP obviously is more user friendly.
The look & feel of the IDE was the major factor wich keeped me far from FPC.
Now, Virtual Pascal is almost dead, as BP7 was long time ago. Migrating my code to FPC to benefit from is more updated features slows my enthousiasm. I will must face the built-in IDE, basically unchanged. Still version 1.0.10.
Can I directly suggest some modifications to the person responsable with the IDE improvements.
Is there a more friendly IDE ?(Lazarus excluded)
Basically, my suggestions go to :
- using relative paths for configurations (portable)
- avoid to add config files to the working folder by setup switch
- automatic go to error if stop on first error in setup
- persistent gray window autohide when compile finish and focus the message window on success or go to error on fail
- compiler result message window print success in green and fail in red
- built-in help in configuration windows for noobs like me
- eliminate the browse for files bug to open files in upper folders (Invalid drive or directory) when up by 3-4 levels
- help files preindexed in the download package
- label for help files (context sensitive help open the first founded instance, without prompt if founded in bp.tph or FPC help, etc)
- examples in contextual help, because not all users are advanced or remember how to do old things and compiller messages are criptical
- since some code behaviour changed from bp7, similar functions are supposed known and undocumented
- help files in a more compact form, compressed, zipped. It's a nightmare to spread 10500 files on the drive. Search in zip files if index is external should be fast enough.
- zip file with units, needed unit is decompressed on first use others remain in zip archive.
- modular install. User can choose only win32 stuff, help and ignore other platforms, precompiled units or uncompiled versions to be compiled at runtime and available for step by step run for debug and learn. Unit sources can stay in compressed zips with external index, on demand first use decompress them based on index.

Please redirect my message to the right person for more details, or tell me gow to contact him directly.

Many thanks in advance.

Best regards, Simionescu
Unknown author
to Unknown author

If you're looking for a GUI IDE, try the Lazarus IDE. I use FPC extensively to code Linux libs and console applications. I use Lazarus as my editor/IDE, it has all I need and more.

Give it a try.
http://www.lazarus.freepaascal.org

Nino

//**************************************************
Show quoted text 48 lines
Hello and good day, As a pascal programmer, I used many years Borland Pascal 7.01. To escape the 16 bit limitations, I've migrated to Virtual Pascal 2.1 The IDE is very similar between them, VP obviously is more user friendly. The look & feel of the IDE was the major factor wich keeped me far from FPC. Now, Virtual Pascal is almost dead, as BP7 was long time ago. Migrating my code to FPC to benefit from is more updated features slows my enthousiasm. I will must face the built-in IDE, basically unchanged. Still version 1.0.10. Can I directly suggest some modifications to the person responsable with the IDE improvements. Is there a more friendly IDE ?(Lazarus excluded) Basically, my suggestions go to : - using relative paths for configurations (portable) - avoid to add config files to the working folder by setup switch - automatic go to error if stop on first error in setup - persistent gray window autohide when compile finish and focus the message window on success or go to error on fail - compiler result message window print success in green and fail in red - built-in help in configuration windows for noobs like me - eliminate the browse for files bug to open files in upper folders (Invalid drive or directory) when up by 3-4 levels - help files preindexed in the download package - label for help files (context sensitive help open the first founded instance, without prompt if founded in bp.tph or FPC help, etc) - examples in contextual help, because not all users are advanced or remember how to do old things and compiller messages are criptical - since some code behaviour changed from bp7, similar functions are supposed known and undocumented - help files in a more compact form, compressed, zipped. It's a nightmare to spread 10500 files on the drive. Search in zip files if index is external should be fast enough. - zip file with units, needed unit is decompressed on first use others remain in zip archive. - modular install. User can choose only win32 stuff, help and ignore other platforms, precompiled units or uncompiled versions to be compiled at runtime and available for step by step run for debug and learn. Unit sources can stay in compressed zips with external index, on demand first use decompress them based on index. Please redirect my message to the right person for more details, or tell me gow to contact him directly. Many thanks in advance.
ajv
to Unknown author: As a pascal programmer, I used many years Borland Pascal 7.01. To escape the 16 bit…

I have a problem with file region locking under Linux. First I start setup to create a file and writelock range 10..30 -------------------------------------------------------------- program setup;

{$mode delphi}{$H+}
Uses    cthreads, Classes, SysUtils, BaseUnix;
Const   Fn      = '/home/anthony/test_lock';
       F_RDLCK = 0;
       F_WRLCK = 1;
       F_UNLCK = 2;
Var     F, I    : Integer;
       Region  : FLock;
Begin
  If FileExists (Fn) Then DeleteFile (Fn);
  F := FpOpen (Fn, O_RDWR Or O_CREAT, $1B6);  // $1B6 = o666
  For I := 0 To 255 Do FpWrite (F, I, 1);
  With Region Do
  Begin
     l_type  := F_WRLCK; l_whence := SEEK_SET;
     l_start := 10;      l_len    := 20
  End;
  If FpFcntl (F, F_SETLK, Region) = -1 Then
     WriteLn ('unable to apply writelock');   //  <-- OK
  Sleep (20000);                              // Sleep 20 Sec
  FpClose (F);
End.
--------------------------------------------------------------------------------------

Then within 20 seconds i start test to obtain a readlock on 80. This fails. Why? What am I doing wrong?
--------------------------------------------------------------------------------------

program test;
{$mode delphi}{$H+}
Uses    cthreads, Classes, SysUtils, BaseUnix;
Const   Fn      = '/home/anthony/test_lock';
       F_RDLCK = 0;
       F_WRLCK = 1;
       F_UNLCK = 2;
Var     F, I    : Integer;
       Region  : FLock;
Begin
  F := FpOpen (Fn, O_RDWR Or O_CREAT, $1B6);   // $1B6 = o666
  With Region Do
  Begin
     l_type  := F_RDLCK; l_whence := SEEK_SET;
     l_start := 80;      l_len    := 1
  End;
  If FpFcntl (F, F_SETLK, Region) = -1 Then
     WriteLn ('unable to apply readlock on 80');   // <-- Error
  FpClose (F);
End.
------------------------------------------------------------------------------------

Thanks

Jonas Maebe
to ajv
ajv wrote 12 lines
With Region Do Begin l_type := F_WRLCK; l_whence := SEEK_SET; l_start := 10; l_len := 20 End; If FpFcntl (F, F_SETLK, Region) = -1 Then WriteLn ('unable to apply writelock'); // <-- OK Sleep (20000); // Sleep 20 Sec FpClose (F); End. -------------------------------------------------------------------------------------- Then within 20 seconds i start test to obtain a readlock on 80. This fails. Why? What am I doing wrong?

Your test works fine under Solaris. It's a bug somewhere in the FPC Linux units. strace shows this for your first program:

fcntl(3, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=10, len=0}) = 0

As you can see, "len=0" is passed to the system call (instead of len=20), so it locks the entire file. That's the reason why the other program is unable to lock anything else.

Jonas

Jonas Maebe
to Jonas Maebe: Your test works fine under Solaris. It's a bug somewhere in the FPC Linux units. strace…
Jonas Maebe wrote 24 lines
On 03 May 2009, at 14:09, ajv wrote: > With Region Do Begin > l_type := F_WRLCK; l_whence := SEEK_SET; > l_start := 10; l_len := 20 > End; > If FpFcntl (F, F_SETLK, Region) = -1 Then > WriteLn ('unable to apply writelock'); // <-- OK > Sleep (20000); // Sleep 20 Sec > FpClose (F); > End. > -------------------------------------------------------------------------------------- > Then within 20 seconds i start test to obtain a readlock on 80. > This fails. Why? What am I doing wrong? Your test works fine under Solaris. It's a bug somewhere in the FPC Linux units. strace shows this for your first program: fcntl(3, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=10, len=0}) = 0 As you can see, "len=0" is passed to the system call (instead of len=20), so it locks the entire file. That's the reason why the other program is unable to lock anything else.

It's similar to http://bugs.freepascal.org/view.php?id=13363 : the kernel's off_t is 32 bit on 32 bit systems. It's defined as 64 bit in the Linux rtl for all platforms.

Jonas

ajv
to Jonas Maebe

Dear Jonas Maebe,

Thank you very much for the research you have done on this subject. I was unaware of the power of strace, I have never used this application, I will go into it.
I see your name in the referred bug, I think you are the maintainer of this subject?
Do I have to report this as a bug or is it included in the mentioned bug?

Best regards, Anthony Vogelaar

==================================================================

Jonas Maebe wrote 39 lines
On 03 May 2009, at 14:51, Jonas Maebe wrote: > On 03 May 2009, at 14:09, ajv wrote: > >> With Region Do Begin >> l_type := F_WRLCK; l_whence := SEEK_SET; >> l_start := 10; l_len := 20 >> End; >> If FpFcntl (F, F_SETLK, Region) = -1 Then >> WriteLn ('unable to apply writelock'); // <-- OK >> Sleep (20000); // Sleep 20 Sec >> FpClose (F); >> End. >> -------------------------------------------------------------------------------------- >> >> Then within 20 seconds i start test to obtain a readlock on 80. >> This fails. Why? What am I doing wrong? > > Your test works fine under Solaris. It's a bug somewhere in the FPC > Linux units. strace shows this for your first program: > > fcntl(3, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=10, len=0}) = 0 > > As you can see, "len=0" is passed to the system call (instead of > len=20), so it locks the entire file. That's the reason why the other > program is unable to lock anything else. It's similar to http://bugs.freepascal.org/view.php?id=13363 : the kernel's off_t is 32 bit on 32 bit systems. It's defined as 64 bit in the Linux rtl for all platforms. Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Jonas Maebe
to ajv
ajv wrote 5 lines
Thank you very much for the research you have done on this subject. I was unaware of the power of strace, I have never used this application, I will go into it. I see your name in the referred bug, I think you are the maintainer of this subject?

Not really, although I sometimes do some Linux work.

Do I have to report this as a bug or is it included in the mentioned bug?

It's safest to report a separate bug, as the fix is different.

Jonas