Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-14 Thread Bo Berglund via lazarus
On Mon, 13 Dec 2021 22:44:16 +0100, Bart via lazarus
 wrote:

>On Mon, Dec 13, 2021 at 10:29 PM Bo Berglund via lazarus
> wrote:
>
>
>> This sounds like what I need.
>> I looked at the project options and found that there is one box to enter the
>> Execute after command. And checkboxes to set when it is used.
>>
>> But I would need *two* commands:
>> - copy to the svn location
>> - strip -s on that copy
>>
>
>In compiler options you can set various debugging related options as well.
>One is to strip symbols.
>- uncheck: "generate infor for the debugger"
>- check: Strip symbols from executable
>You apply those debugging options to your "Release" build mode.
>You keep all relevant debugging options checked for your "Debug" build-mode.
>
>Now you develop in "Debug" build-mode.
>Once you're ready to release: swicth build-mode to "Release" and compile.
>
>(You might want a "Release and copy to svn" build mode with the
>"Execute after command", sou you can also test your release mode build
>(if you use e.g. different optimizations, some yet unnoticed bug may
>crop up.)
>

Thanks, I went there and found where I could add the release mode.
I did not even need to enter a copy command because I could set the "Target
filename" for Release to include the subdirectory bin.
So now my Default mode saves the executable to the project dir and the Release
saves to subdir bin.
This is exactly what I needed, thanks for explaining it! :)


-- 
Bo Berglund
Developer in Sweden

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-14 Thread Dimitrios Chr. Ioannidis via lazarus

On 2021-12-14 10:29, Bo Berglund via lazarus wrote:

On Mon, 13 Dec 2021 22:44:16 +0100, Bart via lazarus


< snip >


(You might want a "Release and copy to svn" build mode with the
"Execute after command", sou you can also test your release mode build
(if you use e.g. different optimizations, some yet unnoticed bug may
crop up.)



Thanks, I went there and found where I could add the release mode.
I did not even need to enter a copy command because I could set the 
"Target

filename" for Release to include the subdirectory bin.
So now my Default mode saves the executable to the project dir and the 
Release

saves to subdir bin.
This is exactly what I needed, thanks for explaining it! :)


< snip >

Just FYI, I usually put in the "Target filname" this :

bin\$(TargetCPU)-$(TargetOS)\$(BuildMode)\projectname

and in the "Unit output directory" this :

lib\$(TargetCPU)-$(TargetOS)\$(BuildMode)


The result is that I have a dir structure dependent on OS, CPU and 
BuildMode values .


i.e.

CPU=i386
OS=win32
BuildMode=debug

bin\i386-win32\debug with lib\i386-win32\debug

CPU=i386
OS=win32
BuildMode=release

bin\i386-win32\release with lib\i386-win32\release

CPU=x86_64
OS=win64
BuildMode=test_for_scm

bin\x86_64-win64\test_for_scm with lib\x86_64-win64\test_for_scm

etc

regards,

--
Dimitrios Chr. Ioannidis
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-14 Thread wkitty42--- via lazarus

On 12/14/21 3:29 AM, Bo Berglund via lazarus wrote:

This is exactly what I needed, thanks for explaining it! :)


don't you love it when a plan comes together? :)

--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list where it belongs!*
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-14 Thread Bo Berglund via lazarus
On Tue, 14 Dec 2021 09:29:54 +0100, Bo Berglund via lazarus
 wrote:

>Thanks, I went there and found where I could add the release mode.

Forgot to say this about my modes creation:

When I only had a Default mode then when I clicked the [..] button there was a
button to the upper left that says "Create Debug and Release modes", which I
used rather than the + button to add a Release mode.
This resulted in two new modes and I could set the Release one as described
before to my liking.

But when I tested the new Debug and Release modes the Debug one worked in a
different way from the Default mode in that it creates two files on compile,
app.exe and app.dbg.
The exe file in this case is not very much different from the release exe in
size, only some 10:s of kb. But the app.dbg file (wich was not present before)
is quite big, larger than the exe file.

Since I did not know what to do about that I removed the Debug mode from the
list and use Default when writing code and test run, then switch to Release to
make the final output.

Question1:
--
What did Lazarus do to the Debug mode it created automatically?

Next:
I also tested on a RaspberryPi project on an RPi3B (using 2.0.12 + 3.2.0):
In this case I have a service application (non-GUI app), which I basically never
run in the Lazarus debugger. Its mode has never been dealt with so it was the
out-of-the-box default.
Now I added the Release mode by just clicking the + button and naming it
Release.
Then I did as before and disbled the "Generate info for the debugger" item.
I also checked the "Strip symbols from executable" box.

The result was a bit surprising:
Using Default
Binary size: 9,572,660 after strip: 4,547,712

Using Release:
Binary size: 6,311,022 after strip: 6,311,020

So in this case the original binary size was a lot larger than the stripped
result from the Default mode, why was this?

And every time I now switch mode for compliling my app it also recompiles the
Indy10 package, why?

Question 2:
---
Does my action to create the Release mode as a copy of Default using the +
button affect the way the Release mode is actually configured?
On my Windows project discussed earlier I used the "Create Debug and Release
modes" button and then deleted the Debug mode and modified the Release a little
concerning the debug and strip.
And on RPi I used the + button instead, but did the same config on debug
settings.

I will need to document this behaviour and note the "correct" way to do it...


-- 
Bo Berglund
Developer in Sweden

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-14 Thread Bo Berglund via lazarus
On Tue, 14 Dec 2021 11:55:45 +0100, Bo Berglund via lazarus
 wrote:

>I also tested on a RaspberryPi project on an RPi3B (using 2.0.12 + 3.2.0):
>In this case I have a service application (non-GUI app), which I basically 
>never
>run in the Lazarus debugger. Its mode has never been dealt with so it was the
>out-of-the-box default.
>Now I added the Release mode by just clicking the + button and naming it
>Release.
>Then I did as before and disbled the "Generate info for the debugger" item.
>I also checked the "Strip symbols from executable" box.
>
>The result was a bit surprising:
>Using Default
>Binary size: 9,572,660 after strip: 4,547,712
>
>Using Release:
>Binary size: 6,311,022 after strip: 6,311,020
>
>So in this case the original binary size was a lot larger than the stripped
>result from the Default mode, why was this?
>
>And every time I now switch mode for compliling my app it also recompiles the
>Indy10 package, why?

I went back to he RPi and removed the Release mode I created from the + button,
then used the "Create Debug and Release modes" button to create two new modes.
Deleted the Debug mode and configured Release as described above.

Now my compile results in a file of size 3,251,612 bytes and when going back to
the Default mode it is (after recompiling the Indy10 package) 9,572,660

Strange...

-- 
Bo Berglund
Developer in Sweden

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus