Sign in Join

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

Mailing lists / fpc-devel / 2010-03

Lazarus keeps it's secrets

17 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Michael Schnell

To explore how PostMessage() in Linux works, I try to follow the source code.

If I do ctrl-click in PostMessage Lazarus takes me to the Windows implementation source code, that of course is not active with a Linux project.

If I set a breakpoint at the line containing PostMessage(), execution does stop there and stepping further with F7 some steps quite soon (often with the first step) not only crashes Lazarus and GDB, but my complete GDB process. Only init 3 / init 5 can get5 me running again.

Very strange....
-Michael

Reply by email

Mattias Gaertner
to Michael Schnell
Show quoted text 6 lines
To explore how PostMessage() in Linux works, I try to follow the source code. If I do ctrl-click in PostMessage Lazarus takes me to the Windows implementation source code, that of course is not active with a Linux project.

?
Have you set the target OS in the compiler options to linux?

If I set a breakpoint at the line containing PostMessage(), execution does stop there and stepping further with F7 some steps quite soon (often with the first step) not only crashes Lazarus and GDB, but my complete GDB process. Only init 3 / init 5 can get5 me running again.

Mighty gdb ;|

Mattias

Reply by email

Michael Schnell
to Mattias Gaertner
Mattias Gaertner wrote
Have you set the target OS in the compiler options to linux?

I just did a normal installation and the program I compile does work. So I can't imagine that the compiler options are wrong. Seemingly the IDE sees some of these options wrong. Can there be diverging settings of such options ?

Another question regarding debugging the lcl and rtl code. With ctrl-click I can (in most cases :) ) reach the body called by a function call.

With most of these functions (LCL code ?) I can also step into with F7 and/or set a breakpoint. With other code (FPC RTL ?) F7 steps over the call and setting a breakpoint in the function body does not work. How can I make GDB see these source code files ?

Thanks,
-Michael

Reply by email

Mattias Gaertner
to Michael Schnell
Show quoted text 5 lines
On 03/01/2010 07:29 PM, Mattias Gaertner wrote: > Have you set the target OS in the compiler options to linux? > I just did a normal installation and the program I compile does work.

Then you see the linux implementation of PostMessage, not the windows one.

Show quoted text 13 lines
So I can't imagine that the compiler options are wrong. Seemingly the IDE sees some of these options wrong. Can there be diverging settings of such options ? Another question regarding debugging the lcl and rtl code. With ctrl-click I can (in most cases :) ) reach the body called by a function call. With most of these functions (LCL code ?) I can also step into with F7 and/or set a breakpoint. With other code (FPC RTL ?) F7 steps over the call and setting a breakpoint in the function body does not work. How can I make GDB see these source code files ?

Install a RTL with debugging info.

Mattias

Reply by email

Michael Schnell
to Mattias Gaertner
Mattias Gaertner wrote
Then you see the linux implementation of PostMessage, not the windows one.

:)

Install a RTL with debugging info.

While its obvious that this in fact is the problem (and silly me did not see it :( ):

How come LCL is installed with, and RTL is installed without debugging information ?

How to install RTL with debugging info ? (I did not yet ever recompile the complete RTL, while I did try to include RTL files in the project and failed due to includes I was not able to decently resolve).

Thanks a lot,
-Michael

Reply by email

Mattias Gaertner
to Michael Schnell
Show quoted text 9 lines
[...] > Install a RTL with debugging info. > While its obvious that this in fact is the problem (and silly me did not see it :( ): How come LCL is installed with, and RTL is installed without debugging information ?

To fit most user expectations.

How to install RTL with debugging info ? (I did not yet ever recompile the complete RTL, while I did try to include RTL files in the project and failed due to includes I was not able to decently resolve).

Compiling fpc is very complicated. But there is hidden trick which only a few people know. I will reveal the secret for the first time ever to the public:

make clean all OPT=-gl
sudo make install INSTALL_PREFIX=/usr

Mattias

Reply by email

Jonas Maebe
to Mattias Gaertner
Mattias Gaertner wrote 8 lines
On Wed, 03 Mar 2010 11:44:42 +0100 Michael Schnell wrote: > How come LCL is installed with, and RTL is installed without > debugging > information ? To fit most user expectations.

For example: if the RTL is compiled with debugging information, "step into" will also step into every reference count increase and decrease, every copy operation of one ansi/short/widestring to another one, every iocheck operation, every threadvar relocation, ...

Jonas

Reply by email

Flávio Etrusco
to Jonas Maebe
Jonas Maebe wrote 18 lines
On 03 Mar 2010, at 12:18, Mattias Gaertner wrote: > On Wed, 03 Mar 2010 11:44:42 +0100 > Michael Schnell wrote: > >> How come LCL is installed with, and RTL is installed without debugging >> information ? > > To fit most user expectations. For example: if the RTL is compiled with debugging information, "step into" will also step into every reference count increase and decrease, every copy operation of one ansi/short/widestring to another one, every iocheck operation, every threadvar relocation, ... Jonas

And how to enable debug info only for FCL and packages?...

Best regards,
Flávio

Reply by email

Michael Schnell
to Mattias Gaertner: On Wed, 03 Mar 2010 11:44:42 +0100 To fit most user expectations. Compiling fpc is very…
Mattias Gaertner wrote 7 lines
Compiling fpc is very complicated. But there is hidden trick which only a few people know. I will reveal the secret for the first time ever to the public: make clean all OPT=-gl sudo make install INSTALL_PREFIX=/usr

Of course I do see that you mean I should read the Wike before asking silly questions ;) .

But in fact I though of just compiling the RTL and not the compiler (fpc) itself. I suppose using "rtl" (or similar) instead of "all" should allow for this (I'll try to find this info in the docs or the Makefile itself)

Moreover by

"make install INSTALL_PREFIX=~/debugrtl"

it should be possible to create a second dedicated copy of the library.

I'll try to find out how to do and use this....

Thanks again,
-Michael

Reply by email

Marco van de Voort
to Jonas Maebe: After building normally and before doing the make install: make `pwd`/compiler/ppc386…
Jonas Maebe wrote 9 lines
> And how to enable debug info only for FCL and packages?... After building normally and before doing the make install: make `pwd`/compiler/ppc386 packages_clean packages_all OPT="-O- -gl" (if you're not under unix: replace `pwd` with the *full, absolute* path to the current directory)

This will create several sets of "macro scale packages" (rtl,fcl,packages,lcl etc) that come from different compiles.

I actually had expected a answer involving stripping .o's here (e.g. have one set with full debug info in the installer package, and installing extracts these in two dirs, stripping one)

Lazarus could then switch from "debug" to non-debug on a per package basis by including different trees.

Reply by email

Jonas Maebe
to Marco van de Voort
Marco van de Voort wrote 12 lines
n Wed, Mar 03, 2010 at 01:30:41PM +0100, Jonas Maebe wrote: >> And how to enable debug info only for FCL and packages?... > > After building normally and before doing the make install: > > make `pwd`/compiler/ppc386 packages_clean packages_all OPT="-O- -gl" > > (if you're not under unix: replace `pwd` with the *full, absolute* > path to the current directory) This will create several sets of "macro scale packages" (rtl,fcl,packages,lcl etc) that come from different compiles.

And which does exactly what was asked.

I actually had expected a answer involving stripping .o's here (e.g. have one set with full debug info in the installer package, and installing extracts these in two dirs, stripping one)

Files compiled with and without debug information will also have different code on some platforms due to ABI requirements, so the result will not be identical.

Jonas

Reply by email

Michael Schnell
to Jonas Maebe
Jonas Maebe wrote
And which does exactly what was asked.

Yep.
But up to now I did not get this running.

Where do I need to do the make ?

i.e. I'm not sure that I have the correct source tree (While I do have the "svn-tree", for a start I would like to stay with 2.2.4 and the fitting Lazarus version.)

So I copied the fpc-sources (as installed from the RPM and referenced by the Lazarus IDE): /usr/share/fpcsrc to ~/fpcsrc

But trying here make only says "No rule to make Target...:"

Once I have this I would need to find out how to configure Lazarus to use these libs.

Thanks again !!!
-Michael

Reply by email

Marco van de Voort
to Jonas Maebe: And which does exactly what was asked. Files compiled with and without debug information…
Jonas Maebe wrote 7 lines
>> (if you're not under unix: replace `pwd` with the *full, absolute* >> path to the current directory) > > This will create several sets of "macro scale packages" > (rtl,fcl,packages,lcl etc) that come from different compiles. And which does exactly what was asked.

But in how far are these guaranteed .ppu compatible?

Reply by email

Jonas Maebe
to Marco van de Voort
Marco van de Voort wrote 10 lines
On Wed, Mar 03, 2010 at 09:42:30PM +0100, Jonas Maebe wrote: >>> (if you're not under unix: replace `pwd` with the *full, absolute* >>> path to the current directory) >> >> This will create several sets of "macro scale packages" >> (rtl,fcl,packages,lcl etc) that come from different compiles. > > And which does exactly what was asked. But in how far are these guaranteed .ppu compatible?

They are all compiled with exactly the same compiler, so they are as compatible as can be. Adding or removing debugging options also does not (un)define any symbols.

Jonas

Reply by email