Re: [Lazarus] newbie questions

2012-06-01 Thread leledumbo
> it "uses windows, graph;" where can I find reference info, examples 
   and other doc about these libs? 

Windows unit is a binding to Windows API. It's not documented as it would be
HUGE work and too duplicated since MSDN already documents it very well. The
problem is that you have to understand C a bit, in particular, how to map C
things to their Pascal equivalent, when reading MSDN docs.

>  if I vould like to port this program under Linux I imagine that the 
   "windows" lib could be unusable. The shortest way to do it is ... ? 
   Hints on how to do it are where? 

Depends on how tight the code is to Windows API. In short, you have to find
all Windows API specific usage, and replace it with its equivalent on your
target platform. Using LCL (via LCLType, LCLProc and LCLIntf), some of the
Windows API specific things are made cross-platform with the same interface
as Windows API one. This is not the recommended way to write cross-platform
apps, but it can't help quick and dirty porting. You can find some articles
regarding multiplatform programming here:
http://wiki.freepascal.org/Multiplatform_Programming_Guide


--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-newbie-questions-tp4024223p4024289.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] crash on bootstrap

2012-06-01 Thread leledumbo
Platform + OS + widgetset please...

--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-crash-on-bootstrap-tp4024245p4024288.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] A few questions

2012-06-01 Thread leledumbo
> How is the status of latest Lazarus on Ubuntu?   I had very bad experience
during Ubuntu 11.04 and 11.10, notable problem is Laz does not play well
with Unity global menu.

It works fine, very fine... but on KDE XD

* I always hate Gnome, now I even hate Unity more than Gnome

--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-A-few-questions-tp4024280p4024287.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Undefined identifier: RequireDerivedFormResource

2012-06-01 Thread leledumbo
http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-February/060229.html

--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Undefined-identifier-RequireDerivedFormResource-tp4024284p4024286.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Reinier Olislagers
On 2-6-2012 0:39, Marco van de Voort wrote:
> On Fri, Jun 01, 2012 at 07:41:33PM +0200, Reinier Olislagers wrote:
>>> I don't know what is different here. Maybe I must start cleaning the path.
>> That's what I'd suspect, too...
>>
>> 
>> Perhaps you'll become another convert to fpcup... (Remembered your forum
>> post a while ago where you mentioned you didn't use it yet :)
>>
>> Fpcup fiddles with the path so you don't have to (it works e.g. if
>> Delphi make is in your path) and if it doesn't work you can release your
>> frustrations by complaining to me ;)
>> 
> If fpcup calls "make.exe" on windows, it will suffer from the same fate.
No, it won't ;)

It calls make but changes the PATH before doing that to exclude anything
except the FPC dir (or Lazarus, FPC bin dir later on) and a
bootstrap/binutils dir where you can store or let fpcup download a
bootstrap compiler, make.exe etc.

Tested with a Delphi6 install which puts Delphi make in the path.

Reinier

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Undefined identifier: RequireDerivedFormResource

2012-06-01 Thread Xiangrong Fang
in the project main file, the following line is added (not by me):

RequireDerivedFormResource := True;

But while compiling it tell me this identifier is not defined. What's this
for?

Thanks,
Shannon
--
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] A few questions

2012-06-01 Thread Xiangrong Fang
Hi Mattias,

1) About Laz on Ubuntu 12.04:  it is quite OK, except that the installing
process is still very tricky and after install it has 2 minor problems:

- on first start, it always complains that FPC source is not found.
- on program termination (if run within the IDE), the attached error is
shown.

2) About the bug I reported. I confirm that it does NOT appear on Ubuntu,
but only Windows. And it appears on both Win7 and WinXP, both laz v0.9.30.4
and the bleeding edge nightly build.

3) I used the correct form of FloodFill, now the compiler is happy, but
there is no flood fill at all (both on windows and linux).  btw, to make
sure I use it correctly, I just need to specify a point within the shape I
want to fill, right?

Shannon

2012/6/2 Mattias Gaertner 

> On Sat, 2 Jun 2012 09:16:54 +0800
> Xiangrong Fang  wrote:
>
> > Hi There,
> >
> > I've been away from Laz for a few months.  And just tried the daily build
> > on Windows. Now having a few questions:
> >
> > 1) How is the status of latest Lazarus on Ubuntu?   I had very bad
> > experience during Ubuntu 11.04 and 11.10, notable problem is Laz does not
> > play well with Unity global menu.
>
> Can you be more specific?
>
>
> >[...]
> > 3)  I tried to use TCanvas.FloodFill, but compiler told me incorrect
> number
> > of arguments. I traced down into the fpcanvas source, the signature is
> > correct, I wonder if that method is implemented or not?
>
> The FPCanvas.FloodFill(x,y) is not implemented in the LCL. It
> "reintroduces" another FloodFill(X, Y: Integer; FillColor: TColor;
> FillStyle: TFillStyle). This means the compiler message is correct.
>
> The "find declaration" ignores the "reintroduce" and finds more than
> the compiler.
>
> Just add the two parameters.
>
> Keep in mind that FloodFill can be very slow.
>
> Mattias
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



--
<>--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] A few questions

2012-06-01 Thread Mattias Gaertner
On Sat, 2 Jun 2012 09:16:54 +0800
Xiangrong Fang  wrote:

> Hi There,
> 
> I've been away from Laz for a few months.  And just tried the daily build
> on Windows. Now having a few questions:
> 
> 1) How is the status of latest Lazarus on Ubuntu?   I had very bad
> experience during Ubuntu 11.04 and 11.10, notable problem is Laz does not
> play well with Unity global menu.

Can you be more specific?

 
>[...]
> 3)  I tried to use TCanvas.FloodFill, but compiler told me incorrect number
> of arguments. I traced down into the fpcanvas source, the signature is
> correct, I wonder if that method is implemented or not?

The FPCanvas.FloodFill(x,y) is not implemented in the LCL. It
"reintroduces" another FloodFill(X, Y: Integer; FillColor: TColor;
FillStyle: TFillStyle). This means the compiler message is correct.

The "find declaration" ignores the "reintroduce" and finds more than
the compiler.

Just add the two parameters.

Keep in mind that FloodFill can be very slow.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 02/06/2012 01:41, Benito van der Zander wrote:


A few mails ago you were advertising to add even more pitfalls, that 
could have all side effects. And about the fact that things can 
happen you said: "You said that, but I have never seen it happen. "
Well now you have seen it happen. 
No, I said I had never seen that, when calling my own commands, with 
the exception, that I saw it, when Lazarus was running its command.



Anyways, "reset debugger" is supposed to kill gdb.
It closes the process that runs gdb.  That normally exits gdb. But 
apparently not always.


As you can see, another thing that needs to be improved.





btw trailing quotes, with no further reply to it, are a form of 
over-quoting. I hope it hasn't damaged my network cable

SCNR
That's different, my laptop has never been that hot before, not even 
when playing computer games


Well I gave you a SCNR for the pun. Not meaning to downplay the problem 
you had. The rest was unrelated (I have no problems with a few extra 
lines, but I thought on that mail it was a bit much: 2 pages with 0 
lines reply to it.)




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] A few questions

2012-06-01 Thread Xiangrong Fang
Hi There,

I've been away from Laz for a few months.  And just tried the daily build
on Windows. Now having a few questions:

1) How is the status of latest Lazarus on Ubuntu?   I had very bad
experience during Ubuntu 11.04 and 11.10, notable problem is Laz does not
play well with Unity global menu.

2) There is a problem with Canvas, I reported a bug already (
http://bugs.freepascal.org/view.php?id=22163)  Please create a new project,
add an Form.OnPaint event handler:

procedure TForm1.FormPaint(Sender: TObject);
begin
  with Canvas do begin
Pen.Width:=1;
Pen.Color:=clRed;
MoveTo(0, 0);
LineTo(100, 0);
LineTo(0, 100);
LineTo(0, 0);
MoveTo(Width - 1, Height - 1);
LineTo(Width - 101, Height - 1);
LineTo(Width - 1, Height - 101);
LineTo(Width - 1, Height - 1);
  end;
end;

While the program is running there are two triangles on the top left and
bottom right corner of the form.  Now you maximize the form, the 2
triangles are redrawn. But then you restore the form, the bottom triangle
is NOT drawn!

3)  I tried to use TCanvas.FloodFill, but compiler told me incorrect number
of arguments. I traced down into the fpcanvas source, the signature is
correct, I wonder if that method is implemented or not?

Thanks!
Shannon

--
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Hans-Peter Diettrich

Marco van de Voort schrieb:


FPC make is mingw shell, which tries to execute "sh" is found.

See http://www.stack.nl/~marcov/buildfaq/#toc-Subsection-1.2.4

(though that is about mingw make calling cygwin sh.exe but same thing. 


I remember seeing questions of this problem also before. How to solve it?


Don't put sh.exe in your path or in the dir with "make.exe" in it.


I use a standard Windows console for make. There I replace the entire 
PATH before make, with only the FPC bin directory to use. This way no 
other programs or scripts can get into the way.


DoDi


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Benito van der Zander


A few mails ago you were advertising to add even more pitfalls, that 
could have all side effects. And about the fact that things can happen 
you said: "You said that, but I have never seen it happen. "
Well now you have seen it happen. 
No, I said I had never seen that, when calling my own commands, with the 
exception, that I saw it, when Lazarus was running its command.



Anyways, "reset debugger" is supposed to kill gdb.



btw trailing quotes, with no further reply to it, are a form of 
over-quoting. I hope it hasn't damaged my network cable

SCNR
That's different, my laptop has never been that hot before, not even 
when playing computer games



On 06/01/12 23:17, Martin wrote:

On 01/06/2012 22:08, Benito van der Zander wrote:



And running arbitrary commands is not special, there are other 
things that upset gdb, just as well.


function TEST: integer;
begin
while true do ;
end;

Evaluate TEST() and the debugging is broken, until you call "reset 
debugger". 

Omg, it's much worse.

That loop continues to run within gdb, and doesn't stop, if you call 
"reset debugger".


In fact, it doesn't even stop, if you close Lazarus.

Now my laptop has been running at 100°C for 3 hours, I hope it hasn't 
been damaged...



A few mails ago you were advertising to add even more pitfalls, that 
could have all side effects. And about the fact that things can happen 
you said: "You said that, but I have never seen it happen. "

Well now you have seen it happen.


btw trailing quotes, with no further reply to it, are a form of 
over-quoting. I hope it hasn't damaged my network cable

SCNR

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Marco van de Voort
On Fri, Jun 01, 2012 at 07:41:33PM +0200, Reinier Olislagers wrote:
> > I don't know what is different here. Maybe I must start cleaning the path.
> That's what I'd suspect, too...
> 
> 
> Perhaps you'll become another convert to fpcup... (Remembered your forum
> post a while ago where you mentioned you didn't use it yet :)
> 
> Fpcup fiddles with the path so you don't have to (it works e.g. if
> Delphi make is in your path) and if it doesn't work you can release your
> frustrations by complaining to me ;)
> 
> 
> Though, to be honest, fiddling with something like (IIRC) setlocal and
> endlocal and messing with the PATH (SET PATH=...) in a batch file is
> certainly doable...

If fpcup calls "make.exe" on windows, it will suffer from the same fate.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Marco van de Voort
On Fri, Jun 01, 2012 at 05:50:49PM +0300, Juha Manninen wrote:
> I tried to "make all" for at my work Windows machine. I have git and
> MINGW32 unix shell environment installed.
> The build fails as shown below. The problematic line is clearly this:
>   sh: C:\Program: No such file or directory
> For some reason "sh" is started and it does not understand spaces in paths.
> The interesting thing is that I use normal Windows cmd, not the MINGW32
> shell.
> If I test in MINGW32 shell, it gives the same error.

> "$ which make" in MINGW32 shell says (correctly) :
>   /c/FPC/2.6.0/bin/i386-Win32/make

FPC make is mingw shell, which tries to execute "sh" is found.

See http://www.stack.nl/~marcov/buildfaq/#toc-Subsection-1.2.4

(though that is about mingw make calling cygwin sh.exe but same thing. 

> I remember seeing questions of this problem also before. How to solve it?

Don't put sh.exe in your path or in the dir with "make.exe" in it.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Remove unused lines depend on SYN_LAZARUS and FPC defines

2012-06-01 Thread Martin

On 01/06/2012 23:11, Zaher Dirkey wrote:
On Sat, Jun 2, 2012 at 12:59 AM, Martin > wrote:


I don't even know,  why the current Load code is disabled.
probably some minol issue (if the save code compiles)...


It is only load from Delphi registry, and i think it is deprecated 
now, and not compatiple, if we remove Delphi load, LoadFromRegistry 
become empty, i can keep it but empty to override it somewhere.
>Best to keep the "functional changes" to separate discussion. that 
makes it easier to clean the ifdef.


Hmm, yes, but i can't see that ancients functions without remove it, 
it is kind of cleanup,

We can decide that in a 2nd step

and further more, when they can be tested.



>I don't have the time to test them now.

I can postpone this modification if u like.

Would be good. one patch ifdef.

then we can see.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Remove unused lines depend on SYN_LAZARUS and FPC defines

2012-06-01 Thread Zaher Dirkey
On Sat, Jun 2, 2012 at 12:59 AM, Martin  wrote:

> I don't even know,  why the current Load code is disabled. probably some
> minol issue (if the save code compiles)...
>

It is only load from Delphi registry, and i think it is deprecated now, and
not compatiple, if we remove Delphi load, LoadFromRegistry become empty, i
can keep it but empty to override it somewhere.

>Best to keep the "functional changes" to separate discussion. that makes
it easier to clean the ifdef.

Hmm, yes, but i can't see that ancients functions without remove it, it is
kind of cleanup,

>I don't have the time to test them now.

I can postpone this modification if u like.

All above this changes, finished and compiled now, so no more discusses.

Best Regards
Zaher Dirkey
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Remove unused lines depend on SYN_LAZARUS and FPC defines

2012-06-01 Thread Martin

On 01/06/2012 22:41, Zaher Dirkey wrote:
On Sat, Jun 2, 2012 at 12:23 AM, Martin > wrote:


On 01/06/2012 22:13, Zaher Dirkey wrote:

Hi, Matrin

I am working again to remove unused lines that depend on
SYN_LAZARUS and FPC defines (now SynEditHighlighter.pas)
and noticed LoadFromBorlandRegistry and LoadFromRegistry
 become unsufule if i removed, can i remove this functions too?


I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3


OK


I was to quick only checked LoadFromBorlandRegistry



Thanks

I removed, UseUserSettings and EnumUserSettings in SynHighlighterPas.pas
also LoadFromRegistry SaveToRegistry become not useful because it load 
and save Delphi options

SynHighlighterAny has this function also?

if it ok, i will send the patch in bug tracker.

I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3



Actually why are load/ save not useful ? (assuming windows)
They are incomplete, but they save some of the actual config

I don't even know,  why the current Load code is disabled. probably some 
minol issue (if the save code compiles)...

I don't have the time to test them now.

Best to keep the "functional changes" to separate discussion. that makes 
it easier to clean the ifdef.



LoadFromBorlandRegistry can still go 
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Remove unused lines depend on SYN_LAZARUS and FPC defines

2012-06-01 Thread Zaher Dirkey
On Sat, Jun 2, 2012 at 12:23 AM, Martin  wrote:

> On 01/06/2012 22:13, Zaher Dirkey wrote:
>
>> Hi, Matrin
>>
>> I am working again to remove unused lines that depend on SYN_LAZARUS and
>> FPC defines (now SynEditHighlighter.pas)
>> and noticed LoadFromBorlandRegistry and LoadFromRegistry  become unsufule
>> if i removed, can i remove this functions too?
>>
>>
>> I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3
>>
>
> OK
>
>
Thanks

I removed, UseUserSettings and EnumUserSettings in SynHighlighterPas.pas
also LoadFromRegistry SaveToRegistry become not useful because it load and
save Delphi options
SynHighlighterAny has this function also?

if it ok, i will send the patch in bug tracker.

I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3

Best Regards
Zaher Dirkey
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Remove unused lines depend on SYN_LAZARUS and FPC defines

2012-06-01 Thread Martin

On 01/06/2012 22:13, Zaher Dirkey wrote:

Hi, Matrin

I am working again to remove unused lines that depend on SYN_LAZARUS 
and FPC defines (now SynEditHighlighter.pas)
and noticed LoadFromBorlandRegistry and LoadFromRegistry  become 
unsufule if i removed, can i remove this functions too?



I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3


OK



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 22:08, Benito van der Zander wrote:



And running arbitrary commands is not special, there are other things 
that upset gdb, just as well.


function TEST: integer;
begin
while true do ;
end;

Evaluate TEST() and the debugging is broken, until you call "reset 
debugger". 

Omg, it's much worse.

That loop continues to run within gdb, and doesn't stop, if you call 
"reset debugger".


In fact, it doesn't even stop, if you close Lazarus.

Now my laptop has been running at 100°C for 3 hours, I hope it hasn't 
been damaged...



A few mails ago you were advertising to add even more pitfalls, that 
could have all side effects. And about the fact that things can happen 
you said: "You said that, but I have never seen it happen. "

Well now you have seen it happen.


btw trailing quotes, with no further reply to it, are a form of 
over-quoting. I hope it hasn't damaged my network cable

SCNR

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] RE : RE : RE : RE : Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 21:30, Ludo Brands wrote:

is this worth the effort?


Well that depends how many people benefit.
Though having said that, there is nothing wrong with a feature, even if 
there was just one person. SO long as in is no issue to others.


I might be persuade to put (part of (see below)) it i an appropriate 
IFDEF. No not an option.


1) this a 2 individual things.
keeping a scrolling history in the evaluate window can be done for all 
evaluates. May even be useful. Could have a checkbok in that window.


So that part is to be skipped. But a better version is welcome.

2)
Any reason to limit to wdDefault ?

Since you always set ddsValid you could have it in the main method body 
(where the "!" is handled ( a relict, that will go ))






--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Remove unused lines depend on SYN_LAZARUS and FPC defines

2012-06-01 Thread Zaher Dirkey
Hi, Matrin

I am working again to remove unused lines that depend on SYN_LAZARUS and
FPC defines (now SynEditHighlighter.pas)
and noticed LoadFromBorlandRegistry and LoadFromRegistry  become unsufule
if i removed, can i remove this functions too?


I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3

Best Regards
Zaher Dirkey
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Benito van der Zander



And running arbitrary commands is not special, there are other things 
that upset gdb, just as well.


function TEST: integer;
begin
while true do ;
end;

Evaluate TEST() and the debugging is broken, until you call "reset 
debugger". 

Omg, it's much worse.

That loop continues to run within gdb, and doesn't stop, if you call 
"reset debugger".


In fact, it doesn't even stop, if you close Lazarus.

Now my laptop has been running at 100°C for 3 hours, I hope it hasn't 
been damaged...




On 06/01/12 20:37, Benito van der Zander wrote:



I already pointed out, how easy you can upset the IDE-to-gdb 
interface, if you issue the wrong command.

You said that, but I have never seen it happen.

Althought gdb crashes sometime randomly, even without running own 
commands.


And running arbitrary commands is not special, there are other things 
that upset gdb, just as well.


function TEST: integer;
begin
while true do ;
end;

Evaluate TEST() and the debugging is broken, until you call "reset 
debugger".


And that might happen with all evaluations, just as likely as if you 
run direct commands.



I recompile very frequently, and it never wet.
I always recompile from the Tools menu 

I use "svn update; make clean all"

* Lazarus will never have direct support for all possible gdb 
commands. If you have added them all, there will be new ones in gdb
And that is the problem. 


And allowing direct commands is the solution.

Just to dump the text output of gdb, it doesn't need to know the command


yep hit "c" instead of "x" (on most keyboards they are next to each 
other) 

continue, step, next, stepi, nexti, stop, kill, quit

Those might not be all commands that are dangerous, but I doubt a 
novice will know the names of another ones.
And Lazarus can check for them and their abbreviations and call the 
corresponding interface function.


And Apple supplies are broken gdb. Some of those commands can do harm. 

That's Apple's problem



Feel free to provide it as an installable package. 
Can a plugin even send commands to the debugger, if that define is not 
set?


And then you have the package, a new Lazarus version appears, and it 
doesn't work anymore...

Though one question:
I can see how you can (technically) change this while the debugger is 
running.
But isn't that to late. If your app crashes without that, and you 
already started the debugger. Then would it not crash?



If the first breakpoint is hit, all threads are stopped anyways.
Only single stepping causes a problem
Anyway if we have a list of such options, then they can be added as 
feature request.

They could.

But why maintain another list of options, if gdb already knows its 
options


On 06/01/12 19:40, Martin wrote:

On 01/06/2012 18:30, Benito van der Zander wrote:

Hi,


Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
 defined?

It does exactly the above. It has been there a very long time.

It has also been decided, that this feature will only be available 
via this define.


I think it would be much better, if it were a regular feature like 
in Ludo's patch:


* the define is difficult to find

That is because it is not supposed to be used.

Yes for the experienced users there are sometimes cases that would 
make it desire-able. For the novice it would be in the best case 
something they do not use. But it could easily cause them problems.


I already pointed out, how easy you can upset the IDE-to-gdb 
interface, if you issue the wrong command.





* if you recompile Lazarus frequently, it often disappears.

I recompile very frequently, and it never wet.
I always recompile from the Tools menu



* if you have a Lazarus without define, you can't enable it without 
recompiling and stopping the debugged application


* Lazarus will never have direct support for all possible gdb 
commands. If you have added them all, there will be new ones in gdb

And that is the problem.

This also means that if gdb access is possible, then it is impossible 
(even if attempted) for the IDE to monitor all the commands.

Given that some commands have hidden features...
If added people will accidentally type the wrong command.



* The output in the debug window is difficult to read

Yes.

That window shouldn't even exist. Or move to IDE internals
It is only useful, so people can sent the centent, if something went 
wrong




* Most commands people use won't break the debugging session, like 
info, x, ...
yep hit "c" instead of "x" (on most keyboards they are next to each 
other)


And Apple supplies are broken gdb. Some of those commands can do harm.



  (and I just debugged an application that crashes if debugged and 
"set scheduler-locking on" is not set, with such a patch this

   option could be set, without restarting gdb)

* If debug commands were that dangerous, Lazarus could show a 
warning, when the feature is used the first time.


* You can write your own gdb python plugins and call them

* People using a programming language are n

[Lazarus] RE : RE : RE : RE : Issuing debug commands from the ide.

2012-06-01 Thread Ludo Brands
> I do not know if I will have the time. But from whatever time I have, 
> I'll set some apart to help you make a package interface. 
> Then you can 
> provide it as yours, and maintain it yourself.
> 

The patch is 18 lines of new code. I have attached it. The difficulty was
not writing the code but figure out where to put it. This mail exchange has
taken more time and lines written than writing the patch (note that I don't
mind). I'm perfectly happy sharing it this way. The users that would benefit
from it would know how to apply a patch. Don't make a package interface for
18 lines of code, please.  

> >> I guess the address breakpoint could be extended to take 
> symbol names 
> >> too.
> >>
> > Still need to know the exact spelling of the symbol. The 
> same symbol 
> > can be uppercase or "original" case, sometimes depending on 
> wheter you 
> > have debug info or not (exported symbol). Plus the name 
> mangling for 
> > class methods.
> > Example: procedure _FPC_WinMainCRTStartup;stdcall;public name
> > '_WinMainCRTStartup'; is known to the debugger as 
> _FPC_WINMAINCRTSTARTUP
> > (stabs info available). I find myself using 'info function' 
> frequently to
> > find or disambiguate functions.
> >
> 
> But thats beside the point? using a watch or the commandline => the 
> question of needing the address or name is the same.

This was about extending the address breakpoint to take symbol names. My
point is that taking a symbol name assumes you know the symbol name, spelled
correctly, or you provide a way to look it up: a front end to 'info
function'. With all the exported symbols from windows dll's I wonder if the
average user would be able to do whatsoever with such an interface. So the
comment was in the same line as the previous ones: is this worth the effort?


Thanks, Ludo


gdb.diff
Description: Binary data
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] RE : RE : RE : Issuing debug commands from the ide.

2012-06-01 Thread Benito van der Zander


it would be accomodated in a GUI and feel a little bit sorry that this 
exchange turned into a list of things the IDE can't do or needs 
improvement in. It just started as wanting to share a personal, small 
effort to combine the advantages of the GUI and the flexibility of the 
CLI. 
All the things the GUI can't do or need improvements are just reasons to 
merge your patch (or a similar one) into Lazarus!


I will advocate again and again for it...
Things like the disassembly window, 
Yes, the disassembly window is great and I don't know any gdb based 
debugger that has it that nice.
(except Insight years ago, but that is not maintained anymore, doesn't 
work with a new gdb and has become useless)


But it is a new features, and we had to wait years for it.
With a direct interface, you could just have used "disassemble /rm ..." 
and use that as a workaround,

until the GUI is finished

(and it uses at&t syntax, is there any way to switch it to intel? for 
the cli there is...).
- workaround for missing IDE feature (e.g. mem viewer, threads) 

But you don't know which IDE features are missing, until you need them.
And then it is too late to implement them.

If it is put in the IDE it will need maintenance. Like any feature of 
course. The fact that it needs maintenance an its own does not stop 
any feature.
But again, this can be expected to need lots of maintenance in 
comparison to the benefits (averaged over all users) 


But it is a single feature that can be used for various things.

if it is implemented, it can replaces several other features only the 1% 
need,
and you save a lot of time, when you don't have to implement and 
maintain those!




On 06/01/12 21:35, Martin wrote:

On 01/06/2012 19:57, Ludo Brands wrote:
I understand that making a gui for a debugger is not easy at all and 
it is difficult to please everybody. Things like the disassembly 
window, the source code window, watches are invaluable compared to 
what the command line gdb offers. However, trying to fit everything 
the command line can do in the straight jacket of the GUI is 
artificially clipping the power of the debugger. Weeding through 
arbitrary memory or some of the other usage examples I gave are not 
the standard usage for most users. So I wouldn't expect that any of 
it would be accomodated in a GUI and feel a little bit sorry that 
this exchange turned into a list of things the IDE can't do or needs 
improvement in. It just started as wanting to share a personal, small 
effort to combine the advantages of the GUI and the flexibility of 
the CLI. 


And I appreciate that you take the time to do that.

But this is not only about what gdb can or can not.  There is a wide 
range of users. And a feature like this is suited for a very small 
group of them.
By comparison the dangers versus the benefits simply do not hold up. 
(It does measured by the standard' of the top 1%, but not for the rest)


Also (and that is why I mentioned the IDE parts) splitting this into :
- workaround for missing IDE feature (e.g. mem viewer, threads)
- features that are unlikely to have a frontend

How many are in the 2nd category. I know for you there are some. But 
for most users, this is not the case. If it was, then it would be a 
feature that needed a front end (due to demand)


If it is put in the IDE it will need maintenance. Like any feature of 
course. The fact that it needs maintenance an its own does not stop 
any feature.
But again, this can be expected to need lots of maintenance in 
comparison to the benefits (averaged over all users)


I do not know if I will have the time. But from whatever time I have, 
I'll set some apart to help you make a package interface. Then you can 
provide it as yours, and maintain it yourself.



The watch window (note also the little endianness making addresses
even more difficult to read):
0396FE08: 00 00 00 00 50 47 63 00 10 7d e8 03 10 7d e8 03

f0 6f 42 00
Yes a proper viewer must be written for this.

A proper viewer would mean: all possible formats gdb supports + unit 
size +

arbitrary data lengths + showing symbols gdb returns. Is that worth it?


For most people
- byte, word, dword , qword
- High/Low endian
- maybe bytes per line (8, 16, 32)
- maybe ascii or even utf8 representation




x/8xw 0x03E781A4

0x3e781a4:   0x00067108   0x00629ae0   0x03e78178   0x00426ff0
0x3e781b4:   0x000cee18   0x   0x   0x

despite the fact that currently mem dumps are really ugly,
you can also
enter the address into a watch ("0x3e781a4^"), and get the
mem dump there.

So again, it boils down to having a proper mem viewer
(well and removing the need for the ^ )

Ugly is not a problem. Not being able to do a simple cut and paste of 
the

address is what hurts.
Not following: why can you not cut and paste? The new multiline view 
is a memo, it allows to select and copy


(there is a bug in trunk, that prevents keyboard from almost all 
toolwindows. But that is not part of this topic)



  

Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 21:04, Benito van der Zander wrote:


Anyway, we both have our points. And it doesn't seem to change. 

Well, that is a point, I can agree with

BTW what about "thread apply" in gdb? 

Single stepping seems to be always applied to all threads.

(which causes the problems in my case )

Because it is more user friendly, than having to goggle gdb and type 
some commandline style stuff... 
User friendly as in "I have never seen a debugger before, but if I 
click that button, I can see what my program is doing"


But if you have some experience, it is not user friendly, if you can't 
do something, because the feature is simply not there,
and have to stop the debugging session, and restart the program with 
the cli gdb.
Or if you always have  to click that button, and can't automate it 
with a python script or by copying some gdb commands from clipboard.


Well that is why we need a plugable interface. Then expert packages can 
be added.




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Benito van der Zander


But then, it is fair to say you are experienced with gdb.
There are also lots of people starting on lazarus, who have not even 
heard of gdb.

For those it can show a warning if they enter a command

And if having a debug windows, in which you can see the commands the IDE 
passes

to gdb, and then try your own, modified version of the commands,
is an amazing way to learn to use gdb.
I already have code, that parses expressions, and might in future 
prevent function calling.

Really?

Then it becomes impossible to read complex properties, and you need a 
way to run direct commands

even more!


Anyway, we both have our points. And it doesn't seem to change. 

Well, that is a point, I can agree with

BTW what about "thread apply" in gdb? 

Single stepping seems to be always applied to all threads.

(which causes the problems in my case )

Because it is more user friendly, than having to goggle gdb and type 
some commandline style stuff... 
User friendly as in "I have never seen a debugger before, but if I click 
that button, I can see what my program is doing"


But if you have some experience, it is not user friendly, if you can't 
do something, because the feature is simply not there,
and have to stop the debugging session, and restart the program with the 
cli gdb.
Or if you always have  to click that button, and can't automate it with 
a python script or by copying some gdb commands from clipboard.


gdb also has a great documentation with help, apropos or tab completion.

And if you don't find something, you can google for it.
There are a lot more references about gdb commands than Lazarus buttons.

E.g. if you google for "gdb view memory" , every result describes the 
"x" command.
If you google for "Lazarus view memory", you find a memory game, the 
haunting memory of a derby, and star trek.
If you hadn't told me that you can view memory dumps in the watch 
window, I would have never guesses that.
(and someone who doesn't know pascal, c++ and gdb, would never guess 
that you need a trailing ^ at the address).



On 06/01/12 20:52, Martin wrote:

On 01/06/2012 19:37, Benito van der Zander wrote:



I already pointed out, how easy you can upset the IDE-to-gdb 
interface, if you issue the wrong command.

You said that, but I have never seen it happen.

But then, it is fair to say you are experienced with gdb.
There are also lots of people starting on lazarus, who have not even 
heard of gdb.




Althought gdb crashes sometime randomly, even without running own 
commands.


And running arbitrary commands is not special, there are other things 
that upset gdb, just as well.


function TEST: integer;
begin
while true do ;
end;

Evaluate TEST() and the debugging is broken, until you call "reset 
debugger".
I know. currently you can trigger function evaluation, even though 
nothing is ready to deal with.
I already have code, that parses expressions, and might in future 
prevent function calling.




And that might happen with all evaluations, just as likely as if you 
run direct commands.


Yes, or trying to modify an ansistring => boom

I didn't say that the debugger was perfect.
That is no reason to add more pitfalls.

Anyway, we both have our points. And it doesn't seem to change.





Feel free to provide it as an installable package. 
Can a plugin even send commands to the debugger, if that define is 
not set?


That part of the interface can be added permanently.
The idea s to spilt the debugger and have packages.

Then an interface would be created.
But the relevant parts of the interface can be added and published as 
soon as someone provides them




And then you have the package, a new Lazarus version appears, and it 
doesn't work anymore...

Though one question:
I can see how you can (technically) change this while the debugger 
is running.
But isn't that to late. If your app crashes without that, and you 
already started the debugger. Then would it not crash?



If the first breakpoint is hit, all threads are stopped anyways.
Only single stepping causes a problem

Yes. I read up.

BTW what about "thread apply" in gdb?

Anyway if we have a list of such options, then they can be added as 
feature request.

They could.

But why maintain another list of options, if gdb already knows its 
options


Because it is more user friendly, than having to goggle gdb and type 
some commandline style stuff...


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] RE : RE : RE : Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 19:57, Ludo Brands wrote:
I understand that making a gui for a debugger is not easy at all and 
it is difficult to please everybody. Things like the disassembly 
window, the source code window, watches are invaluable compared to 
what the command line gdb offers. However, trying to fit everything 
the command line can do in the straight jacket of the GUI is 
artificially clipping the power of the debugger. Weeding through 
arbitrary memory or some of the other usage examples I gave are not 
the standard usage for most users. So I wouldn't expect that any of it 
would be accomodated in a GUI and feel a little bit sorry that this 
exchange turned into a list of things the IDE can't do or needs 
improvement in. 
It just started as wanting to share a personal, small effort to 
combine the advantages of the GUI and the flexibility of the CLI. 


And I appreciate that you take the time to do that.

But this is not only about what gdb can or can not.  There is a wide 
range of users. And a feature like this is suited for a very small group 
of them.
By comparison the dangers versus the benefits simply do not hold up. (It 
does measured by the standard' of the top 1%, but not for the rest)


Also (and that is why I mentioned the IDE parts) splitting this into :
- workaround for missing IDE feature (e.g. mem viewer, threads)
- features that are unlikely to have a frontend

How many are in the 2nd category. I know for you there are some. But for 
most users, this is not the case. If it was, then it would be a feature 
that needed a front end (due to demand)


If it is put in the IDE it will need maintenance. Like any feature of 
course. The fact that it needs maintenance an its own does not stop any 
feature.
But again, this can be expected to need lots of maintenance in 
comparison to the benefits (averaged over all users)


I do not know if I will have the time. But from whatever time I have, 
I'll set some apart to help you make a package interface. Then you can 
provide it as yours, and maintain it yourself.



The watch window (note also the little endianness making addresses
even more difficult to read):
0396FE08: 00 00 00 00 50 47 63 00 10 7d e8 03 10 7d e8 03

f0 6f 42 00
Yes a proper viewer must be written for this.


A proper viewer would mean: all possible formats gdb supports + unit size +
arbitrary data lengths + showing symbols gdb returns. Is that worth it?


For most people
- byte, word, dword , qword
- High/Low endian
- maybe bytes per line (8, 16, 32)
- maybe ascii or even utf8 representation




x/8xw 0x03E781A4

0x3e781a4:   0x00067108   0x00629ae0   0x03e78178   0x00426ff0
0x3e781b4:   0x000cee18   0x   0x   0x

despite the fact that currently mem dumps are really ugly,
you can also
enter the address into a watch ("0x3e781a4^"), and get the
mem dump there.

So again, it boils down to having a proper mem viewer
(well and removing the need for the ^ )


Ugly is not a problem. Not being able to do a simple cut and paste of the
address is what hurts.
Not following: why can you not cut and paste? The new multiline view is 
a memo, it allows to select and copy


(there is a bug in trunk, that prevents keyboard from almost all 
toolwindows. But that is not part of this topic)



  When looking at a chain of pointers like in the
example, the downside of watches is also that or you create a watch for
every pointer and you delete them all after use or you re-use the same watch
but then you don't have any history in case you picked the wrong address in
a table. In both cases a lot of clicking to simulate something that can be
done easily when using cli commands.

Well watches do have history and snapshots in the IDE.

The cli is not that comfortable (maybe gdb does provide that, but more work)

And for one off evaluation, there is the "evaluate" window




But how to find the address of for example a dll exported symbol?

I guess the address breakpoint could be extended to take
symbol names too.


Still need to know the exact spelling of the symbol. The same symbol can be
uppercase or "original" case, sometimes depending on wheter you have debug
info or not (exported symbol). Plus the name mangling for class methods.
Example: procedure _FPC_WinMainCRTStartup;stdcall;public name
'_WinMainCRTStartup'; is known to the debugger as _FPC_WINMAINCRTSTARTUP
(stabs info available). I find myself using 'info function' frequently to
find or disambiguate functions.



But thats beside the point? using a watch or the commandline => the 
question of needing the address or name is the same.




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] RE : RE : RE : Issuing debug commands from the ide.

2012-06-01 Thread Ludo Brands
> I am not arguing against you using your patch.  And if you want to 
> distribute it, then fine.
> 
> Adding it to the IDE is out of question though.
> To many dangers, and people will complain when they loose their debug 
> session, because they did the wrong thing.
> 
That is why I preferred to bring it up on the mailing list instead of
posting the patch immediately on mantis.

> Also I am pointing out what can be done by the IDE already. Though 
> admittedly some of it needs to be improved.
> And if added proper, then everyone can use it.
> 

I understand that making a gui for a debugger is not easy at all and it is
difficult to please everybody. Things like the disassembly window, the
source code window, watches are invaluable compared to what the command line
gdb offers. However, trying to fit everything the command line can do in the
straight jacket of the GUI is artificially clipping the power of the
debugger. Weeding through arbitrary memory or some of the other usage
examples I gave are not the standard usage for most users. So I wouldn't
expect that any of it would be accomodated in a GUI and feel a little bit
sorry that this exchange turned into a list of things the IDE can't do or
needs improvement in. It just started as wanting to share a personal, small
effort to combine the advantages of the GUI and the flexibility of the CLI.

> > The watch window (note also the little endianness making addresses 
> > even more difficult to read):
> > 0396FE08: 00 00 00 00 50 47 63 00 10 7d e8 03 10 7d e8 03 
> f0 6f 42 00 
> Yes a proper viewer must be written for this.
>

A proper viewer would mean: all possible formats gdb supports + unit size +
arbitrary data lengths + showing symbols gdb returns. Is that worth it?
 
> > there is some that gets lost in the evaluate or watch window. For 
> > example here is a short session for an interface to an object 
> > implemented in TAbstractEventSink:
> 
> So where do you get the address?

In this case it was an object I instantiated myself and the interface
pointers were returned from a call to queryinterface on the object and on
its IUnknown. 

> >> x/8xw 0x03E781A4
> > 0x3e781a4:   0x00067108   0x00629ae0   0x03e78178   0x00426ff0
> > 0x3e781b4:   0x000cee18   0x   0x   0x
> despite the fact that currently mem dumps are really ugly, 
> you can also 
> enter the address into a watch ("0x3e781a4^"), and get the 
> mem dump there.
> 
> So again, it boils down to having a proper mem viewer
> (well and removing the need for the ^ )
> 
Ugly is not a problem. Not being able to do a simple cut and paste of the
address is what hurts. When looking at a chain of pointers like in the
example, the downside of watches is also that or you create a watch for
every pointer and you delete them all after use or you re-use the same watch
but then you don't have any history in case you picked the wrong address in
a table. In both cases a lot of clicking to simulate something that can be
done easily when using cli commands.

>
> > But how to find the address of for example a dll exported symbol?
> 
> I guess the address breakpoint could be extended to take 
> symbol names too.
> 

Still need to know the exact spelling of the symbol. The same symbol can be
uppercase or "original" case, sometimes depending on wheter you have debug
info or not (exported symbol). Plus the name mangling for class methods.
Example: procedure _FPC_WinMainCRTStartup;stdcall;public name
'_WinMainCRTStartup'; is known to the debugger as _FPC_WINMAINCRTSTARTUP
(stabs info available). I find myself using 'info function' frequently to
find or disambiguate functions. 

  


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread waldo kitty

On 6/1/2012 13:41, Reinier Olislagers wrote:


Though, to be honest, fiddling with something like (IIRC) setlocal and
endlocal and messing with the PATH (SET PATH=...) in a batch file is
certainly doable...


it sure is ;)

== snip ==

:setvars
if "%myFPCver%"  == "" set myFPCver=2.6.0
if "%myFPCpath%" == "" set myFPCpath=c:\freepascal\fpc\%myFPCver%
if "%myLAZpath%" == "" set myLAZpath=c:\freepascal\laz
if "%myFPCbinutils%" == "" set myFPCbinutils=c:\freepascal\binutils
if "%myFPCpathset%"  == "TRUE" goto pathok
  set PATH=%myFPCbinutils%\i386-win32;%myFPCpath%\bin\i386-win32;%PATH%
  set myFPCpathset=TRUE
:pathok

== snip ==

the above prepends to the existing path and does it only once in the current 
session so the script can be executed more than once without prepending and 
prepending and prepending over and over to the path :)



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 19:37, Benito van der Zander wrote:



I already pointed out, how easy you can upset the IDE-to-gdb 
interface, if you issue the wrong command.

You said that, but I have never seen it happen.

But then, it is fair to say you are experienced with gdb.
There are also lots of people starting on lazarus, who have not even 
heard of gdb.




Althought gdb crashes sometime randomly, even without running own 
commands.


And running arbitrary commands is not special, there are other things 
that upset gdb, just as well.


function TEST: integer;
begin
while true do ;
end;

Evaluate TEST() and the debugging is broken, until you call "reset 
debugger".
I know. currently you can trigger function evaluation, even though 
nothing is ready to deal with.
I already have code, that parses expressions, and might in future 
prevent function calling.




And that might happen with all evaluations, just as likely as if you 
run direct commands.


Yes, or trying to modify an ansistring => boom

I didn't say that the debugger was perfect.
That is no reason to add more pitfalls.

Anyway, we both have our points. And it doesn't seem to change.





Feel free to provide it as an installable package. 
Can a plugin even send commands to the debugger, if that define is not 
set?


That part of the interface can be added permanently.
The idea s to spilt the debugger and have packages.

Then an interface would be created.
But the relevant parts of the interface can be added and published as 
soon as someone provides them




And then you have the package, a new Lazarus version appears, and it 
doesn't work anymore...

Though one question:
I can see how you can (technically) change this while the debugger is 
running.
But isn't that to late. If your app crashes without that, and you 
already started the debugger. Then would it not crash?



If the first breakpoint is hit, all threads are stopped anyways.
Only single stepping causes a problem

Yes. I read up.

BTW what about "thread apply" in gdb?

Anyway if we have a list of such options, then they can be added as 
feature request.

They could.

But why maintain another list of options, if gdb already knows its 
options


Because it is more user friendly, than having to goggle gdb and type 
some commandline style stuff...


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Benito van der Zander



I already pointed out, how easy you can upset the IDE-to-gdb 
interface, if you issue the wrong command.

You said that, but I have never seen it happen.

Althought gdb crashes sometime randomly, even without running own commands.

And running arbitrary commands is not special, there are other things 
that upset gdb, just as well.


function TEST: integer;
begin
while true do ;
end;

Evaluate TEST() and the debugging is broken, until you call "reset 
debugger".


And that might happen with all evaluations, just as likely as if you run 
direct commands.



I recompile very frequently, and it never wet.
I always recompile from the Tools menu 

I use "svn update; make clean all"

* Lazarus will never have direct support for all possible gdb 
commands. If you have added them all, there will be new ones in gdb
And that is the problem. 


And allowing direct commands is the solution.

Just to dump the text output of gdb, it doesn't need to know the command


yep hit "c" instead of "x" (on most keyboards they are next to each 
other) 

continue, step, next, stepi, nexti, stop, kill, quit

Those might not be all commands that are dangerous, but I doubt a novice 
will know the names of another ones.
And Lazarus can check for them and their abbreviations and call the 
corresponding interface function.


And Apple supplies are broken gdb. Some of those commands can do harm. 

That's Apple's problem



Feel free to provide it as an installable package. 

Can a plugin even send commands to the debugger, if that define is not set?

And then you have the package, a new Lazarus version appears, and it 
doesn't work anymore...

Though one question:
I can see how you can (technically) change this while the debugger is 
running.
But isn't that to late. If your app crashes without that, and you 
already started the debugger. Then would it not crash?



If the first breakpoint is hit, all threads are stopped anyways.
Only single stepping causes a problem
Anyway if we have a list of such options, then they can be added as 
feature request.

They could.

But why maintain another list of options, if gdb already knows its options

On 06/01/12 19:40, Martin wrote:

On 01/06/2012 18:30, Benito van der Zander wrote:

Hi,


Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
 defined?

It does exactly the above. It has been there a very long time.

It has also been decided, that this feature will only be available 
via this define.


I think it would be much better, if it were a regular feature like in 
Ludo's patch:


* the define is difficult to find

That is because it is not supposed to be used.

Yes for the experienced users there are sometimes cases that would 
make it desire-able. For the novice it would be in the best case 
something they do not use. But it could easily cause them problems.


I already pointed out, how easy you can upset the IDE-to-gdb 
interface, if you issue the wrong command.





* if you recompile Lazarus frequently, it often disappears.

I recompile very frequently, and it never wet.
I always recompile from the Tools menu



* if you have a Lazarus without define, you can't enable it without 
recompiling and stopping the debugged application


* Lazarus will never have direct support for all possible gdb 
commands. If you have added them all, there will be new ones in gdb

And that is the problem.

This also means that if gdb access is possible, then it is impossible 
(even if attempted) for the IDE to monitor all the commands.

Given that some commands have hidden features...
If added people will accidentally type the wrong command.



* The output in the debug window is difficult to read

Yes.

That window shouldn't even exist. Or move to IDE internals
It is only useful, so people can sent the centent, if something went 
wrong




* Most commands people use won't break the debugging session, like 
info, x, ...
yep hit "c" instead of "x" (on most keyboards they are next to each 
other)


And Apple supplies are broken gdb. Some of those commands can do harm.



  (and I just debugged an application that crashes if debugged and 
"set scheduler-locking on" is not set, with such a patch this

   option could be set, without restarting gdb)

* If debug commands were that dangerous, Lazarus could show a 
warning, when the feature is used the first time.


* You can write your own gdb python plugins and call them

* People using a programming language are not stupid and can figure 
out how to use gdb


Feel free to provide it as an installable package.

Then it can be downloaded and installed

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 18:49, Martin wrote:

On 01/06/2012 18:30, Benito van der Zander wrote:
  (and I just debugged an application that crashes if debugged and 
"set scheduler-locking on" is not set, with such a patch this

   option could be set, without restarting gdb)


Maybe we need an option.

Though one question:
I can see how you can (technically) change this while the debugger is 
running.
But isn't that to late. If your app crashes without that, and you 
already started the debugger. Then would it not crash?


Anyway if we have a list of such options, then they can be added as 
feature request.


Ok I read up a bit on it (I haven't yet debugged any threaded stuff in 
gdb). Seems that could be added to the thread window (as tool button or 
popup menu)


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Juha Manninen
On Fri, Jun 1, 2012 at 8:41 PM, Reinier Olislagers <
reinierolislag...@gmail.com> wrote:

> 
> Perhaps you'll become another convert to fpcup... (Remembered your forum
> post a while ago where you mentioned you didn't use it yet :)
>
> Fpcup fiddles with the path so you don't have to (it works e.g. if
> Delphi make is in your path) and if it doesn't work you can release your
> frustrations by complaining to me ;)
> 
>

True. I didn't have problems compiling Lazarus trunk for a long time but
now I have.
I will try it on Monday when I go to work.
Thanks.

Juha
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 18:30, Benito van der Zander wrote:
  (and I just debugged an application that crashes if debugged and 
"set scheduler-locking on" is not set, with such a patch this

   option could be set, without restarting gdb)


Maybe we need an option.

Though one question:
I can see how you can (technically) change this while the debugger is 
running.
But isn't that to late. If your app crashes without that, and you 
already started the debugger. Then would it not crash?


Anyway if we have a list of such options, then they can be added as 
feature request.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Reinier Olislagers
On 1-6-2012 17:55, Juha Manninen wrote:
> 
> I try to build Lazarus trunk. FPC 2.6.0 is installed and it works ok.
> I was able to build Lazarus at my home Windows after installing "Git Bash".
> I don't know what is different here. Maybe I must start cleaning the path.
That's what I'd suspect, too...


Perhaps you'll become another convert to fpcup... (Remembered your forum
post a while ago where you mentioned you didn't use it yet :)

Fpcup fiddles with the path so you don't have to (it works e.g. if
Delphi make is in your path) and if it doesn't work you can release your
frustrations by complaining to me ;)


Though, to be honest, fiddling with something like (IIRC) setlocal and
endlocal and messing with the PATH (SET PATH=...) in a batch file is
certainly doable...

Good luck,
Reinier

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 18:30, Benito van der Zander wrote:

Hi,


Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
 defined?

It does exactly the above. It has been there a very long time.

It has also been decided, that this feature will only be available 
via this define.


I think it would be much better, if it were a regular feature like in 
Ludo's patch:


* the define is difficult to find

That is because it is not supposed to be used.

Yes for the experienced users there are sometimes cases that would make 
it desire-able. For the novice it would be in the best case something 
they do not use. But it could easily cause them problems.


I already pointed out, how easy you can upset the IDE-to-gdb interface, 
if you issue the wrong command.





* if you recompile Lazarus frequently, it often disappears.

I recompile very frequently, and it never wet.
I always recompile from the Tools menu



* if you have a Lazarus without define, you can't enable it without 
recompiling and stopping the debugged application


* Lazarus will never have direct support for all possible gdb 
commands. If you have added them all, there will be new ones in gdb

And that is the problem.

This also means that if gdb access is possible, then it is impossible 
(even if attempted) for the IDE to monitor all the commands.

Given that some commands have hidden features...
If added people will accidentally type the wrong command.



* The output in the debug window is difficult to read

Yes.

That window shouldn't even exist. Or move to IDE internals
It is only useful, so people can sent the centent, if something went wrong



* Most commands people use won't break the debugging session, like 
info, x, ...

yep hit "c" instead of "x" (on most keyboards they are next to each other)

And Apple supplies are broken gdb. Some of those commands can do harm.



  (and I just debugged an application that crashes if debugged and 
"set scheduler-locking on" is not set, with such a patch this

   option could be set, without restarting gdb)

* If debug commands were that dangerous, Lazarus could show a warning, 
when the feature is used the first time.


* You can write your own gdb python plugins and call them

* People using a programming language are not stupid and can figure 
out how to use gdb


Feel free to provide it as an installable package.

Then it can be downloaded and installed

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Juha Manninen
On Fri, Jun 1, 2012 at 7:06 PM, Henry Vermaak wrote:

> Hmm, hard to tell.  Safest way in windows to build things is from a
> batch file, where you explicitly set the path, so that it's not
> influenced by the system path.  At least in my experience.
>

There are many scripts around. Which one you recommend?
(I will be able to test it on next Monday when I go back to work).

Juha
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Benito van der Zander

Hi,


Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
 defined?

It does exactly the above. It has been there a very long time.

It has also been decided, that this feature will only be available via 
this define.


I think it would be much better, if it were a regular feature like in 
Ludo's patch:


* the define is difficult to find

* if you recompile Lazarus frequently, it often disappears.

* if you have a Lazarus without define, you can't enable it without 
recompiling and stopping the debugged application


* Lazarus will never have direct support for all possible gdb commands. 
If you have added them all, there will be new ones in gdb


* The output in the debug window is difficult to read

* Most commands people use won't break the debugging session, like info, 
x, ...


  (and I just debugged an application that crashes if debugged and "set 
scheduler-locking on" is not set, with such a patch this

   option could be set, without restarting gdb)

* If debug commands were that dangerous, Lazarus could show a warning, 
when the feature is used the first time.


* You can write your own gdb python plugins and call them

* People using a programming language are not stupid and can figure out 
how to use gdb



Benito

On 06/01/12 15:08, Martin wrote:
I was wondering, when I saw the log that you posted on mantis I 
saw breakpoints in the debugger code 


On 01/06/2012 13:45, Ludo Brands wrote:

Hi,

I made a small patch for lazarus that allows to issue debugger 
commands in
the Evaluate/Modify window. Commands are entered as an expression 
starting
with a '>' character. For example evaluating'>x/20x $sp' will show 
you the
20 first values on the stack. When entering debug commands the result 
area
is not cleared but the commands issued and their results are appended 
to the

existing result, just as in a console gdb session.

Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
 defined?

It does exactly the above. It has been there a very long time.

It has also been decided, that this feature will only be available via 
this define.
Reason: This is mainly for people who wish to debug/experiment with 
the debugger. And it also requires knowledge of both: gdb and how the 
IDE deals with gdb.


If in this command window you execute statements, that run the exe 
("-exec-continue" / "c") then the  IDE looses sync, and your debug 
session is gone. Even if you change the stackframe or thread, you can 
get wrong results
Fixing all this will only make the ide code more complex and harder to 
maintain.




The same syntax can also be used in a watch expression when using the
default style. The command will then be executed at every step or 
breakpoint

hit and the result shown in the watch window. The one line output in the
watch window limits of course what you can display.

If anybody is interested in this, I'll submit it to mantis.


Not sure of the use of that?
What data do you want to display?



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] RE : RE : Issuing debug commands from the ide.

2012-06-01 Thread Martin
I am not arguing against you using your patch.  And if you want to 
distribute it, then fine.


Adding it to the IDE is out of question though.
To many dangers, and people will complain when they loose their debug 
session, because they did the wrong thing.


Also I am pointing out what can be done by the IDE already. Though 
admittedly some of it needs to be improved.

And if added proper, then everyone can use it.


On 01/06/2012 17:32, Ludo Brands wrote:

Hence the x/20x $sp example.

http://imagebin.org/214731

memory dump of $pc^


I rarely use the watch window and hadn't explored the memory dump style.
Here is how x/40xw $sp is presented in my patched version:


x/40x $sp

0x396fe08:   0x   0x00634750   0x03e87d10   0x03e87d10
0x396fe18:   0x00426ff0   0x000cee18   0x00079b68   0x00634750

.

The watch window (note also the little endianness making addresses even more
difficult to read):
0396FE08: 00 00 00 00 50 47 63 00 10 7d e8 03 10 7d e8 03 f0 6f 42 00 18 ee
0c 00 68 9b 07 00 50 47 63 00 44 34 70 00 b4 de 62 00 60 fe 96 03 0c fe 96
03 e2 6e 42 00 24 fe 96 03 b0 fe 96 03 01 00 00 00 01 00 00 00 98 fe 96 03


Yes a proper viewer must be written for this.


- tried to get to the VMT of a COM interface yesterday

You need to dig into FPC, to find the offset .


But it is so much easier to look at the memory area the interface points to
directly. The debugger returns also symbol information when there is some
that gets lost in the evaluate or watch window. For example here is a short
session for an interface to an object implemented in TAbstractEventSink:


So where do you get the address?
Btw,  if you have the name, you can enter it as watch, and specify mem-dump


x/8xw 0x03E781A4

0x3e781a4:   0x00067108   0x00629ae0   0x03e78178   0x00426ff0
0x3e781b4:   0x000cee18   0x   0x   0x
despite the fact that currently mem dumps are really ugly, you can also 
enter the address into a watch ("0x3e781a4^"), and get the mem dump there.


So again, it boils down to having a proper mem viewer
(well and removing the need for the ^ )


x/8xw 0x007030b0

0x7030b0:   0x0028   0xffd8
0x0062d9c0   0x00703118
0x7030c0:   0x
0x   0x   0x00703390

The  is info that is lost when using
the watch window. I think you could also agree that the watch window is not
the most appropriate to do this exercise neither.


yes, that is missing. the ide doesnt look up addresses and tell you the 
name...



- info fun with partial function names


I meant the gdb 'info function' command with regex parameter to find the
address of a function.


ok.


- set a breakpoint at non fpc code (dll exported symbols

for example)
We have address breakpoints, you can set them in the disassembler.


But how to find the address of for example a dll exported symbol?


I guess the address breakpoint could be extended to take symbol names too.



  The debug output
window throws in a lot of what lazarus is doing with the debugger and the
useful information is easily scrolled away by new debug info (mouse hovering
over a variable, a single step, ...). It also slows down stepping a lot.



yes its a memo... memo is slow

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] RE : RE : Issuing debug commands from the ide.

2012-06-01 Thread Ludo Brands
> In the "Debug output" window. Where all the gdb stuff is.
>

Ok found it.

> > Hence the x/20x $sp example.
> http://imagebin.org/214731
> 
> memory dump of $pc^
> 

I rarely use the watch window and hadn't explored the memory dump style.
Here is how x/40xw $sp is presented in my patched version:

>x/40x $sp
0x396fe08:   0x   0x00634750   0x03e87d10   0x03e87d10
0x396fe18:   0x00426ff0   0x000cee18   0x00079b68   0x00634750
0x396fe28:   0x00703444   0x0062deb4   0x0396fe60   0x0396fe0c
0x396fe38:   0x00426ee2   0x0396fe24   0x0396feb0   0x0001
0x396fe48:   0x0001   0x0396fe98   0x0396feb0   0x0053047c
0x396fe58:   0x000cee18   0x000cee18   0x0396fec0   0x00419e1e
0x396fe68:   0x   0x0041c37c   0x0396fe58   0x0396fe98
0x396fe78:   0x0001   0x   0x00634750   0x00703444
0x396fe88:   0x0062deb4   0x0396fed8   0x0396fce8   0x0041c34e
0x396fe98:   0x00634750   0x00703444   0x0062deb4   0x0396fec0

The watch window (note also the little endianness making addresses even more
difficult to read):
0396FE08: 00 00 00 00 50 47 63 00 10 7d e8 03 10 7d e8 03 f0 6f 42 00 18 ee
0c 00 68 9b 07 00 50 47 63 00 44 34 70 00 b4 de 62 00 60 fe 96 03 0c fe 96
03 e2 6e 42 00 24 fe 96 03 b0 fe 96 03 01 00 00 00 01 00 00 00 98 fe 96 03
b0 fe 96 03 7c 04 53 00 18 ee 0c 00 18 ee 0c 00 c0 fe 96 03 1e 9e 41 00 00
00 00 00 7c c3 41 00 58 fe 96 03 98 fe 96 03 01 00 00 00 00 00 00 00 50 47
63 00 44 34 70 00 b4 de 62 00 d8 fe 96 03 e8 fc 96 03 4e c3 41 00 50 47 63
00 44 34 70 00 b4 de 62 00 c0 fe 96 03 6c fe 96 03 ee 9d 41 00 98 fe 96 03
28 ff 96 03 01 00 00 00 18 ee 0c 00 d8 fe 96 03 d8 82 41 00 00 00 00 00 18
ee 0c 00 00 00 00 00 18 ee 0c 00 40 ff 96 03 a3 e7 41 00 00 00 00 00 b4 de
62 00 00 90 fd 7f 44 34 70 00 b4 de 62 00 20 ff 96 03 e0 fd 96 03 38 28 54
00 e8 fe 96 03 00 00 00 00

The debug output window:


&"x/40x $sp\n"
~"0x396fe08:\t0x\t0x00634750\t0x03e87d10\t0x03e87d10\n"
~"0x396fe18:\t0x00426ff0\t0x000cee18\t0x00079b68\t0x00634750\n"
~"0x396fe28:\t0x00703444\t0x0062deb4\t0x0396fe60\t0x0396fe0c\n"
~"0x396fe38:\t0x00426ee2\t0x0396fe24\t0x0396feb0\t0x0001\n"
~"0x396fe48:\t0x0001\t0x0396fe98\t0x0396feb0\t0x0053047c\n"
~"0x396fe58:\t0x000cee18\t0x000cee18\t0x0396fec0\t0x00419e1e\n"
~"0x396fe68:\t0x\t0x0041c37c\t0x0396fe58\t0x0396fe98\n"
~"0x396fe78:\t0x0001\t0x\t0x00634750\t0x00703444\n"
~"0x396fe88:\t0x0062deb4\t0x0396fed8\t0x0396fce8\t0x0041c34e\n"
~"0x396fe98:\t0x00634750\t0x00703444\t0x0062deb4\t0x0396fec0\n"
^done

> > - tried to get to the VMT of a COM interface yesterday
> 
> You need to dig into FPC, to find the offset .
> 

But it is so much easier to look at the memory area the interface points to
directly. The debugger returns also symbol information when there is some
that gets lost in the evaluate or watch window. For example here is a short
session for an interface to an object implemented in TAbstractEventSink:

>x/8xw 0x03E781A4
0x3e781a4:   0x00067108   0x00629ae0   0x03e78178   0x00426ff0
0x3e781b4:   0x000cee18   0x   0x   0x

>x/8xw 0x00067108   
0x67108:   0x007030b0   0x03e87e40   0x34a715a0   0x11d06587
0x67118:   0x20004a92   0x4dacc7af   0x0001   0x03e78178

>x/8xw 0x007030b0   
0x7030b0 :   0x0028   0xffd8
0x0062d9c0   0x00703118
0x7030c0 :   0x
0x   0x   0x00703390

The  is info that is lost when using
the watch window. I think you could also agree that the watch window is not
the most appropriate to do this exercise neither.

> 
> > - info fun with partial function names
> Not sure what you mean:
> But you know the debug inspector (context menu on watches) shows the 
> objects method (if they are avail)
>

I meant the gdb 'info function' command with regex parameter to find the
address of a function.

 
> > - set a breakpoint at non fpc code (dll exported symbols 
> for example)
> We have address breakpoints, you can set them in the disassembler.
> 

But how to find the address of for example a dll exported symbol?

Example:
>info function OpenURL
All functions matching regular expression \"OpenURL\":

Non-debugging symbols:
0x444a82ee  IEFRAME!OpenURL
0x444a82ee  OpenURL


> > Non of this is to debug the debugger.
> >
> 
> Right, there are features in gdb, that the IDE does not yet support 
> (e.g. attach/ detach)
> 
> Better to implement the features 
> 
> But feel free to use that define
> 

Thanks. Now that I have made the patch I'll hang on to it. The debug output
window throws in a lot of what lazarus is doing with the debugger and the
useful information is easily scrolled away by new debug info (mouse hovering
over a variable, a single step, ...). It also slows down stepping a lot. 

Ludo








--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Henry Vermaak
On 01/06/12 16:55, Juha Manninen wrote:
> On Fri, Jun 1, 2012 at 6:17 PM, Henry Vermaak  > wrote:
> 
> MinGW doesn't have a shell.  Do you mean MSYS?
> 
> 
> Maybe. The icon on Windows says "Git Bash", but the window title says
> MINGW32.
> Git is from here:  https://github.com/msysgit/msysgit

Ah, right.  I know that git for windows comes with its own msys
installation.  I don't know how it differs from the stock msys.

> I try to build Lazarus trunk. FPC 2.6.0 is installed and it works ok.
> I was able to build Lazarus at my home Windows after installing "Git Bash".
> I don't know what is different here. Maybe I must start cleaning the path.

Hmm, hard to tell.  Safest way in windows to build things is from a
batch file, where you explicitly set the path, so that it's not
influenced by the system path.  At least in my experience.

Henry

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Embarcadero vs Lazarus/FPC (Oracle vs Google)

2012-06-01 Thread Reinier Olislagers
On 8-5-2012 9:55, Reinier Olislagers wrote:
> On 8-5-2012 9:16, Graeme Geldenhuys wrote:
>> Hi,
>>
>> I'm following the trial between Oracle vs Google and wondered about
>> the following... Judge Alsup told the jury to assume API's are
>> copyrightable - something Alsup still has to determine later during
>> trial. Now if he does rule that API's are copyrightable, how will this
>> affect the Lazarus and Free Pascal projects? Both the latter projects
>> copy Embarcadero's API's verbatim.
>>
>> http://www.osnews.com/story/25918/Google_infringed_Java_copyrights_but_we_don_t_know_if_that_s_illegal
>> http://arstechnica.com/tech-policy/news/2012/05/jury-rules-google-violated-copyright-law-google-moves-for-mistrial.ars
> 
> On the other hand, apparently EU judges ruled that programming languages
> are NOT copyrightable... the extract of the ruling seems to indicate (to
> me) that that specifically includes APIs:
> http://www.zdnet.com/blog/btl/eu-court-rules-programming-languages-not-copyrightable/76076
> 
> I think a lot more projects will have problems if APIs are deemed
> copyrightable and doubt any sane person would rule that... but we are
> talking about the legal system... ;)
> 
> Suppose it's wait and see...

And yes:
http://www.theregister.co.uk/2012/05/31/no_copyright_java_api/
apparently, the judge ruled the APIs in question can't be copyrighted.
From the ruling: "So long as the specific code used to implement a
method is different, anyone is free under the Copyright Act to write his
or her own code to carry out exactly the same function or specification
of any methods used in the Java API"
"It does not matter that the declaration or method header lines are
identical. Under the rules of Java, they must be identical to declare a
method specifying the same functionality — even when the implementation
is different. When there is only one way to express an idea or function,
then everyone is free to do so and no one can monopolize that expression."

More quotes from the judgement as well as the entire verdict, I think:
http://www.techdirt.com/articles/20120531/15383819155/judge-delivers-thorough-complete-smackdown-oracles-copyright-claims.shtml
... where the judge also says the structure/hierarchy
(java.package.Class.method) of the API is a bit creative but also a
command structure, a symbol or method of operation and therefore not
copyrightable.

Glad the judgement came down on the side of sanity and together with the
earlier European case, at least some sense prevails...

Reinier

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Juha Manninen
On Fri, Jun 1, 2012 at 6:17 PM, Henry Vermaak wrote:

> MinGW doesn't have a shell.  Do you mean MSYS?
>

Maybe. The icon on Windows says "Git Bash", but the window title says
MINGW32.
Git is from here:  https://github.com/msysgit/msysgit


I had to patch the Makefiles to get my fpc and lazarus to build inside
> msys.  Is this what you are trying to do?
>

No, I get the error also when building from the standard Windows cmd prompt.


> The interesting thing is that I use normal Windows cmd, not the MINGW32
> > shell.
> > If I test in MINGW32 shell, it gives the same error.
> >
> > "$ which make" in MINGW32 shell says (correctly) :
> >   /c/FPC/2.6.0/bin/i386-Win32/make
>
> You are using "make" supplied by fpc, so why mingw/msys?


mingw/msys came with the Windows port of Git. We are switching from CVS to
Git in my work place.


I'm a bit confused about what you are doing, but it looks like you can't
> build
> lazarus even with the fpc supplied tools, so perhaps you have PATH issues.
>

I try to build Lazarus trunk. FPC 2.6.0 is installed and it works ok.
I was able to build Lazarus at my home Windows after installing "Git Bash".
I don't know what is different here. Maybe I must start cleaning the path.


Juha
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] crash on bootstrap

2012-06-01 Thread ik
Hello,

After a very long time that I have not updated Lazarus, I finally have
(r37471). When using FPC 2.7 I get the following exception when it just
start to run:

[FORMS.PP] ExceptionOccurred
  Sender=EInvalidOp
  Exception=Invalid floating point operation
  Stack trace:
  $00A11EAE line 214 of imagelistcache.pas
  $0096F263 line 226 of include/buttonglyph.inc
  $00855D6B line 62 of include/graphic.inc
  $0085B836 line 401 of include/rasterimage.inc
  $0085D1DE line 39 of include/custombitmap.inc
  $0085A786 line 113 of include/rasterimage.inc
  $0085D40D line 68 of include/custombitmap.inc
  $0096E92D line 34 of include/buttonglyph.inc
  $0096D619 line 491 of buttons.pp
  $00971C14 line 981 of include/speedbutton.inc
  $00C0FF80 line 693 of componentpalette.pas
  $00C0E67D line 268 of componentpalette.pas
  $00C91D8C line 1698 of ../packager/pkgmanager.pas
  $00C8BE54 line 437 of ../packager/pkgmanager.pas
  $00B7A295 line 550 of componentreg.pas
  $00C0EECD line 419 of componentpalette.pas
  $00B7A80F line 652 of componentreg.pas

Does anyone else experience such problem ?

Thanks,
Ido
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Henry Vermaak
On 01/06/12 15:50, Juha Manninen wrote:
> Hi
> 
> I tried to "make all" for at my work Windows machine. I have git and
> MINGW32 unix shell environment installed.

MinGW doesn't have a shell.  Do you mean MSYS?

> The build fails as shown below. The problematic line is clearly this:
>   sh: C:\Program: No such file or directory
> For some reason "sh" is started and it does not understand spaces in paths.

I had to patch the Makefiles to get my fpc and lazarus to build inside
msys.  Is this what you are trying to do?

> The interesting thing is that I use normal Windows cmd, not the MINGW32
> shell.
> If I test in MINGW32 shell, it gives the same error.
> 
> "$ which make" in MINGW32 shell says (correctly) :
>   /c/FPC/2.6.0/bin/i386-Win32/make

You are using "make" supplied by fpc, so why mingw/msys?  I'm a bit
confused about what you are doing, but it looks like you can't build
lazarus even with the fpc supplied tools, so perhaps you have PATH issues.

Henry

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Build Lazarus + MINGW32

2012-06-01 Thread Juha Manninen
Hi

I tried to "make all" for at my work Windows machine. I have git and
MINGW32 unix shell environment installed.
The build fails as shown below. The problematic line is clearly this:
  sh: C:\Program: No such file or directory
For some reason "sh" is started and it does not understand spaces in paths.
The interesting thing is that I use normal Windows cmd, not the MINGW32
shell.
If I test in MINGW32 shell, it gives the same error.

"$ which make" in MINGW32 shell says (correctly) :
  /c/FPC/2.6.0/bin/i386-Win32/make

I remember seeing questions of this problem also before. How to solve it?

Regards,
Juha

...
Compiling noguiint.pp
Compiling noguiwsfactory.pas
735 lines compiled, 0.6 sec
C:/FPC/2.6.0/bin/i386-Win32/cp.exe -f Makefile.compiled
../../units/i386-win32/nogui/LCL.compiled
make[3]: Leaving directory `C:/SW/lazarus/lcl/interfaces/nogui'
make[2]: Leaving directory `C:/SW/lazarus/lcl/interfaces'
make[1]: Leaving directory `C:/SW/lazarus/lcl'
make -C tools
makefile:2332: warning: overriding commands for target `.'
makefile:2330: warning: ignoring old commands for target `.'
make[1]: Entering directory `C:/SW/lazarus/tools'
echo
sh: C:\Program: No such file or directory
make[1]: *** [all] Error 127
make[1]: Leaving directory `C:/SW/lazarus/tools'
make: *** [lazbuild] Error 2
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] RE : Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 14:47, Ludo Brands wrote:

Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
   defined?

It does exactly the above. It has been there a very long time.


No didn't know about that define. I didn't encounter anything like that and
I actualy did search for somehting like that before starting to do any
coding. Searching for the define in the files I opened in the IDE only
brings up the conditional declaration of  function GetDebugger: TDebugger;.

did you include the debugger directory?


So it seems I have been working in a completely different area of the code.
Where would I enter teh debugger commands when using
DBG_WITH_DEBUGGER_DEBUG?

In the "Debug output" window. Where all the gdb stuff is.


If anybody is interested in this, I'll submit it to mantis.


Not sure of the use of that?
What data do you want to display?


I have had too many cases where I had to use the gdb command line to debug
code. Reason why I wanted to do something about it.
Examples:
- wrote a while ago a fpc program that had to do some stack walking. Hence
the x/20x $sp example.

http://imagebin.org/214731

memory dump of $pc^


- searching in and displaying a particular memory area that is in pascal
just a pointer. When tracing in assembler there are many cases where I would
like to now the contents of the memory area pointed to by a register.

see above


- tried to get to the VMT of a COM interface yesterday


You need to dig into FPC, to find the offset .

Not sure how to bes do in, as you need to get tthe interface from the 
objecht first, I guess?


Here is how the instance class name is gotten

-data-evaluate-expression (^^^char(self)^+3)^

the 2 inner ^^ are just pointer. There could be any type. Wouldn't need 
to be char.
The first address of the object points to the VMT, in the VMT the 
pointer to the name (shortstring) is the 3 entry



To try stuff like that, the "Evaluate/Modify" window is quite good too.



- info fun with partial function names

Not sure what you mean:
But you know the debug inspector (context menu on watches) shows the 
objects method (if they are avail)



- set a breakpoint at non fpc code (dll exported symbols for example)

We have address breakpoints, you can set them in the disassembler.

or "Add" > "Address BrkPoint" and enter address. Either context menu in 
breakpoint list, or main menu "Run"

http://wiki.lazarus.freepascal.org/IDE_Window:Breakpoints

There are watch point too, if your hardware supports it



- etc.

Non of this is to debug the debugger.



Right, there are features in gdb, that the IDE does not yet support 
(e.g. attach/ detach)


Better to implement the features 

But feel free to use that define


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] RE : Issuing debug commands from the ide.

2012-06-01 Thread Ludo Brands
> You have seen the new feature in Laz 1.1 ?
> 
> Thanks to Darius Blaszijk there is a multi line view (2nd 
> last tool buuton)
> 
Hadn't noticed it. 
Perfect! It allows to watch bigger unnamed memory areas such as the stack or
a data packet returned by a function with something like x/100x $eax

Ludo


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] RE : Issuing debug commands from the ide.

2012-06-01 Thread Ludo Brands
> I was wondering, when I saw the log that you posted on 
> mantis I saw 
> breakpoints in the debugger code 
> 
I told you in the mantis update;)

> Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
>   defined?
> 
> It does exactly the above. It has been there a very long time.
> 

No didn't know about that define. I didn't encounter anything like that and
I actualy did search for somehting like that before starting to do any
coding. Searching for the define in the files I opened in the IDE only
brings up the conditional declaration of  function GetDebugger: TDebugger;.
So it seems I have been working in a completely different area of the code.
Where would I enter teh debugger commands when using
DBG_WITH_DEBUGGER_DEBUG?

> It has also been decided, that this feature will only be 
> available via 
> this define.
> Reason: This is mainly for people who wish to 
> debug/experiment with the 
> debugger. And it also requires knowledge of both: gdb and how the IDE 
> deals with gdb.
> 
> If in this command window you execute statements, that run the exe 
> ("-exec-continue" / "c") then the  IDE looses sync, and your debug 
> session is gone. Even if you change the stackframe or thread, you can 
> get wrong results
> Fixing all this will only make the ide code more complex and 
> harder to 
> maintain.
> 

I understand. It is very easy to shoot in your foot using the debugger
directly.

> > If anybody is interested in this, I'll submit it to mantis.
> >
> Not sure of the use of that?
> What data do you want to display?
> 

I have had too many cases where I had to use the gdb command line to debug
code. Reason why I wanted to do something about it. 
Examples:
- wrote a while ago a fpc program that had to do some stack walking. Hence
the x/20x $sp example.
- searching in and displaying a particular memory area that is in pascal
just a pointer. When tracing in assembler there are many cases where I would
like to now the contents of the memory area pointed to by a register. 
- tried to get to the VMT of a COM interface yesterday
- info fun with partial function names
- set a breakpoint at non fpc code (dll exported symbols for example)
- etc.

Non of this is to debug the debugger.  

Ludo


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Massimo Soricetti

Il 01/06/2012 12:05, Marco Ciampa ha scritto:

1) it "uses windows, graph;" where can I find reference info, examples
and other doc about these libs?


Hello Marco,

your questions hit the really, really painful issue about Lazarus and 
every other medium-large sized open source project: DOCUMENTATION IS 
CRAP :-(


You can find some old (but very good) Delphi .HLP files, since the VCL 
is not changed... but for everything newer than that, like jedi 
libraries or the new components, you are doomed to work your way among 
insufficient docs, source code and tiny sample projects. :-(((



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin

On 01/06/2012 13:45, Ludo Brands wrote:

  The one line output in the
watch window limits of course what you can display.



You have seen the new feature in Laz 1.1 ?

Thanks to Darius Blaszijk there is a multi line view (2nd last tool buuton)

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Martin
I was wondering, when I saw the log that you posted on mantis I saw 
breakpoints in the debugger code 


On 01/06/2012 13:45, Ludo Brands wrote:

Hi,

I made a small patch for lazarus that allows to issue debugger commands in
the Evaluate/Modify window. Commands are entered as an expression starting
with a '>' character. For example evaluating'>x/20x $sp' will show you the
20 first values on the stack. When entering debug commands the result area
is not cleared but the commands issued and their results are appended to the
existing result, just as in a console gdb session.

Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
 defined?

It does exactly the above. It has been there a very long time.

It has also been decided, that this feature will only be available via 
this define.
Reason: This is mainly for people who wish to debug/experiment with the 
debugger. And it also requires knowledge of both: gdb and how the IDE 
deals with gdb.


If in this command window you execute statements, that run the exe 
("-exec-continue" / "c") then the  IDE looses sync, and your debug 
session is gone. Even if you change the stackframe or thread, you can 
get wrong results
Fixing all this will only make the ide code more complex and harder to 
maintain.




The same syntax can also be used in a watch expression when using the
default style. The command will then be executed at every step or breakpoint
hit and the result shown in the watch window. The one line output in the
watch window limits of course what you can display.

If anybody is interested in this, I'll submit it to mantis.


Not sure of the use of that?
What data do you want to display?



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Mark Morgan Lloyd

Sven Barth wrote:


  - FreePascal is a Dos app. , really ugly as was TP 20 years ago with
similar concern regarding the multiuser use with Win...



You need to differentiate here:
1. Free Pascal is a compiler and thus the tool you use for compiling 
your Pascal code
2. The IDE is called fp (or also "text mode IDE") and this is not a DOS 
application (ok... a DOS version also exists, but only if you download 
it ;) ). It's a normal Windows command line application and uses the 
Windows Console API. fp also works on other platforms like Linux and OS/2.


In fairness, a lot of people refer to "DOS prompt" even when they really 
mean a Linux shell session (Konsole etc.). Even more people call that 
sort of thing a terminal, which is particularly irritating to those of 
us who do use terminal emulators on a regular basis.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Issuing debug commands from the ide.

2012-06-01 Thread Ludo Brands
Hi,

I made a small patch for lazarus that allows to issue debugger commands in
the Evaluate/Modify window. Commands are entered as an expression starting
with a '>' character. For example evaluating '>x/20x $sp' will show you the
20 first values on the stack. When entering debug commands the result area
is not cleared but the commands issued and their results are appended to the
existing result, just as in a console gdb session. 
The same syntax can also be used in a watch expression when using the
default style. The command will then be executed at every step or breakpoint
hit and the result shown in the watch window. The one line output in the
watch window limits of course what you can display. 

If anybody is interested in this, I'll submit it to mantis.

Ludo


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Dave Coventry
Marco,

You misunderstand me. :+(

You don't need Delphi to use Lazarus. I also use
http://delphibasics.co.uk/ as a resource, but that's just because
Lazarus is close enough to Delphi to be able to use resources intended
for Delphi, and indeed, a lot of the libraries for Delphi have been
adapted for Lazarus, too.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Hans-Peter Diettrich

Marco Ciampa schrieb:

On Fri, Jun 01, 2012 at 12:28:40PM +0200, Dave Coventry wrote:

Hi Marco,

Lazarus is still pretty close to Delhi and I still use the help files
that came with my Delphi 3 installation for reference.


Too bad. So for Lazarus use I have to study (and buy!) Delphi first...
very strange situation for a free software. I understand why it is so
but ... maybe a free documentation project could rightly fit here...


Hit F1?

FPC comes with its own documentation tool FPDoc, and pretty informative 
online help. You also can (should?) install FPC help for offline 
reading, e.g. in CHM format.


The Lazarus IDE now shows the help entries for every identifier under 
the mouse. This is achieved by presenting the help sources in raw 
format. When you open the FPDocEditor window in the IDE, you can see and 
also edit the LCL help entries.


While help on FPC (language, RTL, FCL...) is very nice, help on Lazarus 
and LCL is very rudimentary. That's why Delphi Help is usually 
recommended for Lazarus, it covers the common topics better. LCL 
specific extensions and modifications traditionally are undocumented, 
the few exceptions are frequently outdated, and leave more questions 
than answers.


DoDi


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TColorDialog descendant

2012-06-01 Thread Krzysztof
Hi,

I am looking at Dialogs unit, there is TColorDialog. I would like to
inherit from this form and add extra control (TEdit). Is this
possible? Because it seems that TColorDialog is as widgetset (that
mean native for OS?) and I don't know how it works.
I wonder, If I can't create descendant, maybe then I could create own
TForm and inside create TColorDialog and then dock it to some panel
(by ManualDock methood). Extra control will be in my main form.

Regards

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Sven Barth

Am 01.06.2012 13:08, schrieb Marco Ciampa:

On Fri, Jun 01, 2012 at 12:05:23PM +0200, Marco Ciampa wrote:

  - FreePascal is a Dos app. , really ugly as was TP 20 years ago with
similar concern regarding the multiuser use with Win...


I meant the FreePascal IDE that comes if you download the FreePascal
package. Put yourself in the shoes of a student: this is FreePascal, it
is written everywhere... may be a good idea to change the package name
into FreePascal_IDE... but of course I know that fpc is the common
underlying compiler of all. I was comparing IDEs...



It's not an extra package it is PART of the Free Pascal distribution 
(and it's Free Pascal, not FreePascal). Also it's called "fp" already...
Also there are people that liked and still like the look and feel of the 
Turbo Pascal IDE (tough I'll always prefer a good GUI like Lazarus to fp).


Regards,
Sven

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Torsten Bonde Christiansen

On 2012-06-01 13:19, Marco Ciampa wrote:

On Fri, Jun 01, 2012 at 12:28:40PM +0200, Dave Coventry wrote:

Hi Marco,

Lazarus is still pretty close to Delhi and I still use the help files
that came with my Delphi 3 installation for reference.


Too bad. So for Lazarus use I have to study (and buy!) Delphi first...
very strange situation for a free software. I understand why it is so
but ... maybe a free documentation project could rightly fit here...
This is not entirely true! Embacardo (who owns the Delphi brand now) 
have placed

the entire API documentation on their website here:

http://docwiki.embarcadero.com/Libraries/en/Main_Page

And as I have understood the Lazarus project, a major aim is to be Dephi 
compatible as
much as possible (I this goes for FreePascal as well). So most of this 
documentation

should fit the general need.

I personally use the online API documentation for RTL, FCL and LCL which 
can be

found here:

http://lazarus-ccr.sourceforge.net/docs/

Kind regards,
Torsten Bonde Christiansen.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Mattias Gaertner

Marco Ciampa  hat am 1. Juni 2012 um 13:19 geschrieben:

> On Fri, Jun 01, 2012 at 12:28:40PM +0200, Dave Coventry wrote:
> > Hi Marco,
> >
> > Lazarus is still pretty close to Delhi and I still use the help files
> > that came with my Delphi 3 installation for reference.
>
> Too bad. So for Lazarus use I have to study (and buy!) Delphi first...
> very strange situation for a free software. I understand why it is so
> but ... maybe a free documentation project could rightly fit here...
>
> Thanks for the info, I'll do some experiments...


There are already thousands of pages of documentation for FPC and Lazarus. And
there are books and forums and much more.
The Delphi 3 help files are a very good quality, most things are still correct
and some topics are better explained there (better depends on your background
and taste). There is nothing wrong to read them as an introduction, but you
should read the FPC/Lazarus docs too.

Mattias
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Marco Ciampa
On Fri, Jun 01, 2012 at 12:28:40PM +0200, Dave Coventry wrote:
> Hi Marco,
> 
> Lazarus is still pretty close to Delhi and I still use the help files
> that came with my Delphi 3 installation for reference.

Too bad. So for Lazarus use I have to study (and buy!) Delphi first...
very strange situation for a free software. I understand why it is so
but ... maybe a free documentation project could rightly fit here...

Thanks for the info, I'll do some experiments...

-- 


Marco Ciampa

++
| Linux User  #78271 |
| FSFE fellow   #364 |
++

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Marco Ciampa
On Fri, Jun 01, 2012 at 12:05:23PM +0200, Marco Ciampa wrote:
>  - FreePascal is a Dos app. , really ugly as was TP 20 years ago with 
>similar concern regarding the multiuser use with Win...

I meant the FreePascal IDE that comes if you download the FreePascal
package. Put yourself in the shoes of a student: this is FreePascal, it
is written everywhere... may be a good idea to change the package name
into FreePascal_IDE... but of course I know that fpc is the common
underlying compiler of all. I was comparing IDEs...

-- 


Marco Ciampa

++
| Linux User  #78271 |
| FSFE fellow   #364 |
++

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Mattias Gaertner



Marco Ciampa  hat am 1. Juni 2012 um 12:05 geschrieben:

> 1) is this a developers only ml? Am I in the wrong list to ask general usage
>questions? I case vould you (please) point me to the right ml? TIA


You are welcome.
This list is about Lazarus. There are many other lists about fpc in general and
about using fpc with other libraries/projects.



>
> 2) the real question(s).
>
> I work in a high school. I do not usually use fpc/lazarus but the whole
> project is interesting for me since it is able to do so many things that
> I've never seen in any other RAD tool, free or not.


:)



>
> We use fpc for education (algorithms/logic/etc.) mainly in the small
> time space in the math lessons but:
>
>  - DevPascal is old, buggy, undeveloped, untranslated and somehow works
>very bad under Windows if you are not an administrator
>(like a student in a school PC)
>
>  - FreePascal is a Dos app. , really ugly as was TP 20 years ago with
>similar concern regarding the multiuser use with Win...


No, Free Pascal is the compiler, some tools and a lot of libraries. It also has
a console IDE called "fp".
Most compilers are command line utilities and fpc is no exception.
Lazarus simply calls fpc to compile your code.
Console applications are far older than DOS, still the best tool for many tasks
and there are still new console tools are invented.



>
>  - Lazarus works perfectly in Windows, is easy to install in school as
>at home and it works under Linux and Mac which is a real plus.
>
> I've found some Delphi examples around in Internet, like this site:
>
> http://www.pierotofy.it/pages/sorgenti/Pascal/
>
> in particular this small game:
>
> http://www.pierotofy.it/pages/sorgenti/dettagli/18955-Connect_Four/
>
> If I import in Lazarus it works like a charm.
>
> Ok now the real questions:
>
> 1) it "uses windows, graph;" where can I find reference info, examples
>and other doc about these libs?


These are not Lazarus units.
The windows unit is simply the binding to the MS Windows libraries, so you can
find the information at msdn.

I never used the graph unit, so I can't help here.



>
> 2) if I vould like to port this program under Linux I imagine that the
>"windows" lib could be unusable. The shortest way to do it is ... ?
>Hints on how to do it are where?



The graph unit exists under Linux too. FPC provides platform independent
functions for most system tasks.



Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Sven Barth

Am 01.06.2012 12:05, schrieb Marco Ciampa:

1) is this a developers only ml? Am I in the wrong list to ask general usage
questions? I case vould you (please) point me to the right ml? TIA



Yes, this is the correct list.


  - FreePascal is a Dos app. , really ugly as was TP 20 years ago with
similar concern regarding the multiuser use with Win...



You need to differentiate here:
1. Free Pascal is a compiler and thus the tool you use for compiling 
your Pascal code
2. The IDE is called fp (or also "text mode IDE") and this is not a DOS 
application (ok... a DOS version also exists, but only if you download 
it ;) ). It's a normal Windows command line application and uses the 
Windows Console API. fp also works on other platforms like Linux and OS/2.



Ok now the real questions:

1) it "uses windows, graph;" where can I find reference info, examples
and other doc about these libs?



If you use unit "graph" you will at the end have a application that is 
also a "DOS application" (though it's not DOS per se) that you critized 
the text mode IDE above for. If you really want to use Lazarus to its 
fullest (thus writing GUI applications), I suggest you to read a 
tutorial like those available here: 
http://wiki.lazarus.freepascal.org/Lazarus_Documentation#Lazarus_and_Pascal_Tutorials



2) if I vould like to port this program under Linux I imagine that the
"windows" lib could be unusable. The shortest way to do it is ... ?
Hints on how to do it are where?



Basically one can use unit Windows, but then you must use "ifdef" and 
other units and functions/procedures for other platforms. In Lazarus and 
it's component library LCL this is mostly abstracted and if you don't 
need specific Windows API functions most needs can be satisifed by 
looking into the units LCLProc, LCLType and LCLIntf though quite often 
you won't need all.


Regards,
Sven

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] newbie questions

2012-06-01 Thread Dave Coventry
Hi Marco,

I'm probably not the best person to welcome you, but as a fellow
potterer who has been using Lazarus for a number of small projects,
over the last ten years or so, welcome!

This is the ml I use whenever I want to ask questions and nobody has
(yet!) disabused me, so I think you've come to the right place

Lazarus is still pretty close to Delhi and I still use the help files
that came with my Delphi 3 installation for reference.

There are differences, though, but there is a lot of help on the Internet.

Such as this page:
http://wiki.lazarus.freepascal.org/Multiplatform_Programming_Guide
On 1 June 2012 12:05, Marco Ciampa  wrote:
> 1) is this a developers only ml? Am I in the wrong list to ask general usage
>   questions? I case vould you (please) point me to the right ml? TIA
>
> 2) the real question(s).
>
> I work in a high school. I do not usually use fpc/lazarus but the whole
> project is interesting for me since it is able to do so many things that
> I've never seen in any other RAD tool, free or not.
>
> We use fpc for education (algorithms/logic/etc.) mainly in the small
> time space in the math lessons but:
>
>  - DevPascal is old, buggy, undeveloped, untranslated and somehow works
>   very bad under Windows if you are not an administrator
>   (like a student in a school PC)
>
>  - FreePascal is a Dos app. , really ugly as was TP 20 years ago with
>   similar concern regarding the multiuser use with Win...
>
>  - Lazarus works perfectly in Windows, is easy to install in school as
>   at home and it works under Linux and Mac which is a real plus.
>
> I've found some Delphi examples around in Internet, like this site:
>
> http://www.pierotofy.it/pages/sorgenti/Pascal/
>
> in particular this small game:
>
> http://www.pierotofy.it/pages/sorgenti/dettagli/18955-Connect_Four/
>
> If I import in Lazarus it works like a charm.
>
> Ok now the real questions:
>
> 1) it "uses windows, graph;" where can I find reference info, examples
>   and other doc about these libs?
>
> 2) if I vould like to port this program under Linux I imagine that the
>   "windows" lib could be unusable. The shortest way to do it is ... ?
>   Hints on how to do it are where?
>
> TIA
>
> --
>
>
> Marco Ciampa
>
> ++
> | Linux User  #78271 |
> | FSFE fellow   #364 |
> ++
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] newbie questions

2012-06-01 Thread Marco Ciampa
1) is this a developers only ml? Am I in the wrong list to ask general usage
   questions? I case vould you (please) point me to the right ml? TIA

2) the real question(s). 

I work in a high school. I do not usually use fpc/lazarus but the whole
project is interesting for me since it is able to do so many things that
I've never seen in any other RAD tool, free or not.

We use fpc for education (algorithms/logic/etc.) mainly in the small
time space in the math lessons but:

 - DevPascal is old, buggy, undeveloped, untranslated and somehow works 
   very bad under Windows if you are not an administrator 
   (like a student in a school PC)

 - FreePascal is a Dos app. , really ugly as was TP 20 years ago with 
   similar concern regarding the multiuser use with Win...

 - Lazarus works perfectly in Windows, is easy to install in school as
   at home and it works under Linux and Mac which is a real plus.

I've found some Delphi examples around in Internet, like this site:

http://www.pierotofy.it/pages/sorgenti/Pascal/

in particular this small game:

http://www.pierotofy.it/pages/sorgenti/dettagli/18955-Connect_Four/

If I import in Lazarus it works like a charm.

Ok now the real questions:

1) it "uses windows, graph;" where can I find reference info, examples
   and other doc about these libs?

2) if I vould like to port this program under Linux I imagine that the
   "windows" lib could be unusable. The shortest way to do it is ... ?
   Hints on how to do it are where?

TIA

-- 


Marco Ciampa

++
| Linux User  #78271 |
| FSFE fellow   #364 |
++

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus