Sign in Join

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

Mailing lists / lazarus / 2023-04

Is there a setting to include debug symbols when starting from Lazarus only?

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

Las 2.2.6/Fpc 3.2.2

I use the config item:
Project/ProjectOptions/CompilerOptions/Debugging/GenerateInfoForTheDebugger in order to include symbols or not in the executable.

Now I wonder if there is some way to configure this such that it works like this:

- Use Run menu Build or Compile: no symbols should be included.
- Click the green run arrow button then the symbols will be included.

I know there is a button next to the green arrow that has a little red x and the hint: "Run without debugging"
But I think this is just for the execution of the program without the debugger, right?

Or is this working such that both green arrows will add the debug info but only the one without the x will actually *use* the debugger?

I would like to be able to build the release without symbols from the Run menu but still use the green arrow to debug without having to change the setting above.

Is this possible?

Bo Berglund Developer in Sweden

Reply by email

Martin Frb
to Bo Berglund
Bo Berglund wrote
- Use Run menu Build or Compile: no symbols should be included. - Click the green run arrow button then the symbols will be included.

I think the closest you may get to this is build modes.

But all and any button/key/menu always use the current mode. you have to change it via the drop down on the toolbutton.

projectgroups may offer a direct "build mode xxx"

Reply by email

Bo Berglund
to Martin Frb
Martin Frb wrote 14 lines
On 16/04/2023 11:15, Bo Berglund via lazarus wrote: > - Use Run menu Build or Compile: no symbols should be included. > - Click the green run arrow button then the symbols will be included. I think the closest you may get to this is build modes. But all and any button/key/menu always use the current mode. you have to change it via the drop down on the toolbutton. projectgroups may offer a direct "build mode xxx"

Fixed it by creating two build modes (Debug and Release) on suggestion from Lazarus itself in the Release dialog from Project Options.

Result:
When I use Release the symbols are not added and when using Debug, then the symbols are added *and* the executable name is changed to originalname.dbg. This is of course on Linux, what happens on Windows I don't know. originalname.exe.dbg would not work of course...

Bo Berglund Developer in Sweden

Reply by email

Giuliano Colla
to Bo Berglund

Il 19/04/2023 18:34, Bo Berglund via lazarus ha scritto:

Show quoted text 5 lines
Result: When I use Release the symbols are not added and when using Debug, then the symbols are added*and* the executable name is changed to originalname.dbg. This is of course on Linux, what happens on Windows I don't know. originalname.exe.dbg would not work of course...

No, you have misunderstood. The executable name is unchanged. Originalname.dbg is *added*. It contains only the debug symbols. If you check you'll see that both originalname and originalname.dbg have exactly the same timestamp.

You have an option in Project->Options->Debugging, named "Use external debug symbols file".
If checked you get two files: originalname and originalname.dbg. If you uncheck it you get only originalname, but much larger.

With the external debug symbols file you may, if you want, deploy the debug version by releasing just originalname. It will be larger and less optimized than a release version, but it will be identical to the one you have debugged. The choice is yours.

Giuliano

Do not do to others as you would have them do to you.They might have different tastes. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230420/316f85f1/attachment.htm>

Reply by email