Sign in Join

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

Mailing lists / lazarus / 2014-12

Default debug mode and internal debugger

24 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Reimar Grabowski

Hi,

if you let the IDE create debug and release build modes for you the resulting debug mode sets the -Xg flag (GDB external debug symbols file). The internal debugger does not work with this set and complains about not finding debug symbols. Perhaps the default debug mode should not set this flag so that both debuggers get at least the chance to work.

R.

Reply by email

Mattias Gaertner
to Reimar Grabowski
Show quoted text 5 lines
Hi, if you let the IDE create debug and release build modes for you the resulting debug mode sets the -Xg flag (GDB external debug symbols file). The internal debugger does not work with this set and complains about not finding debug symbols. Perhaps the default debug mode should not set this flag so that both debuggers get at least the chance to work.

Or add a capability flag to the debugger class for external debug symbols. If the current debugger does not support it, the IDE does not pass the flag.

Mattias

Reply by email

Tony Whyman
to Mattias Gaertner

It would be useful if someone could post a fix as I am getting this problem all the time with 1.2.6.

Mattias Gaertner wrote 19 lines
On Thu, 4 Dec 2014 16:11:54 +0100 Reimar Grabowski wrote: > Hi, > > if you let the IDE create debug and release build modes for you the resulting debug mode sets the -Xg flag (GDB external debug symbols file). > The internal debugger does not work with this set and complains about not finding debug symbols. > Perhaps the default debug mode should not set this flag so that both debuggers get at least the chance to work. Or add a capability flag to the debugger class for external debug symbols. If the current debugger does not support it, the IDE does not pass the flag. Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Tony Whyman
to Mattias Gaertner

GDB on Ubuntu 14.04

A typical problem is when evaluating a symbol that belongs to the current class (e.g. FMyVariable), then inspecting FMyVariable gives "symbol unknown" while "self.FMyVariable" works. When I saw the post, I assumed it was the same problem.

Mattias Gaertner wrote 15 lines
On Thu, 04 Dec 2014 17:11:37 +0000 Tony Whyman wrote: > It would be useful if someone could post a fix as I am getting this > problem all the time with 1.2.6. 1.2.6 does not have components/lazdebugger. What debugger do you mean? Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to Tony Whyman
Show quoted text 6 lines
GDB on Ubuntu 14.04 A typical problem is when evaluating a symbol that belongs to the current class (e.g. FMyVariable), then inspecting FMyVariable gives "symbol unknown" while "self.FMyVariable" works. When I saw the post, I assumed it was the same problem.

Sounds unrelated.

Can you check if this bug still exists in trunk (1.3)?

Mattias

Reply by email

Mattias Gaertner
to Reimar Grabowski
Show quoted text 7 lines
On Thu, 4 Dec 2014 16:29:59 +0100 Mattias Gaertner wrote: > Or add a capability flag to the debugger class for external debug > symbols. If the current debugger does not support it, the IDE does not > pass the flag. Sounds better, do this. :)

Done.

Mattias

Reply by email

Tony Whyman
to Mattias Gaertner: On Thu, 04 Dec 2014 17:55:11 +0000 Sounds unrelated. Can you check if this bug still…

Mattias,

I did the following on an up-to-date Ubuntu 14.04/Linux Mint MATE edition with fpc 2.6.4, gdb 7.7.1

1. download trunk from svn (svn co
http://svn.freepascal.org/svn/lazarus/trunk)

2. Ran "'make"

3. After successful compile ran "./startlazarus --pcp=~/lazarus-devel"

4. Opened the "Image Viewer" example (examples/imgviewer)

5. Complied and ran successfully.

6. Changed build options to generate debugging info and rebuilt.

7. Set breakpoint on line 142 of the main form.

8. Right mouse click and select Debug->Evaluate/Modify on the public property ODImage and the result is shown as "<Error>". See attached screenshot.

9. Same on local variable "I" and the value is correctly shown. Similarly "self.ODImage" works.

So in answer to your question

Can you check if this bug still exists in trunk (1.3)

The answer "yes" and easily demonstrated.

Tony Whyman
MWA

Mattias Gaertner wrote 20 lines
On Thu, 04 Dec 2014 17:55:11 +0000 Tony Whyman wrote: > GDB on Ubuntu 14.04 > > A typical problem is when evaluating a symbol that belongs to the > current class (e.g. FMyVariable), then inspecting FMyVariable gives > "symbol unknown" while "self.FMyVariable" works. When I saw the post, I > assumed it was the same problem. Sounds unrelated. Can you check if this bug still exists in trunk (1.3)? Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lazide-dgberror.png
Type: image/png
Size: 161499 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141205/41d9c843/attachment-0001.png>

Reply by email

Martin Frb
to Tony Whyman: I did the following on an up-to-date Ubuntu 14.04/Linux Mint MATE edition with fpc 2.6.4,…

Just to be sure, you refer to 3 different things throughout this mail threat.

Tony Whyman wrote
8. Right mouse click and select Debug->Evaluate/Modify on the public property ODImage and the result is shown as "<Error>". See attached screenshot.

1) property
....

Show quoted text 6 lines
> On Thu, 04 Dec 2014 17:55:11 +0000 > Tony Whyman wrote: >> A typical problem is when evaluating a symbol that belongs to the >> current class (e.g. FMyVariable), then inspecting FMyVariable gives >> "symbol unknown" while "self.FMyVariable" works. When I saw the post, I >> assumed it was the same problem.

2) Variable

http://bugs.freepascal.org/view.php?id=27136

Cannot inspect class properties in Debugger

3) class property

Which one is it?

Reply by email

Joost van der Sluis
to Mattias Gaertner: On Thu, 4 Dec 2014 16:11:54 +0100 Or add a capability flag to the debugger class for…
Mattias Gaertner wrote 10 lines
On Thu, 4 Dec 2014 16:11:54 +0100 Reimar Grabowski wrote: > if you let the IDE create debug and release build modes for you the resulting debug mode sets the -Xg flag (GDB external debug symbols file). > The internal debugger does not work with this set and complains about not finding debug symbols. > Perhaps the default debug mode should not set this flag so that both debuggers get at least the chance to work. Or add a capability flag to the debugger class for external debug symbols. If the current debugger does not support it, the IDE does not pass the flag.

Same holds for stabs-debug info. And yes, a capability flag would be nice.

Regards,
Joost.

Reply by email

Martin Frb
to Joost van der Sluis
Joost van der Sluis wrote 8 lines
On 12/04/2014 04:29 PM, Mattias Gaertner wrote: > > Or add a capability flag to the debugger class for external debug > symbols. If the current debugger does not support it, the IDE does not > pass the flag. Same holds for stabs-debug info. And yes, a capability flag would be nice.

It would also be good if packages could be set, to follow the dwarf/stabs selection of the project. (though that means more re-compiling).
(I suspect some gdb deal badly with mixed info.)

Reply by email

Mattias Gaertner
to Martin Frb
Show quoted text 5 lines
[...] It would also be good if packages could be set, to follow the dwarf/stabs selection of the project. (though that means more re-compiling). (I suspect some gdb deal badly with mixed info.)

What happens if the RTL is compiled with debug info and the project is compiled with another type?

Mattias

Reply by email

Martin Frb
to Mattias Gaertner
Mattias Gaertner wrote 12 lines
On Sat, 06 Dec 2014 21:16:47 +0000 Martin Frb wrote: > [...] > It would also be good if packages could be set, to follow the > dwarf/stabs selection of the project. (though that means more > re-compiling). > (I suspect some gdb deal badly with mixed info.) We can add a checkbox to package debugger options 'Use Project settings'. What options should then be disabled?

Well at first I thought that simply the choice of stabs/dwarf should follow.
Though of course it has nothing to follow, if the project has debug disabled, but the package has it on (that is possible)

We could make the main toggle "Generate debug info" to follow too. But that is not needed. It can always be on, generating ppu with info, and the project can use -Xs (strip).

Looking at it:
"-Xg" (external dbg info), that is a linker flag. That probably makes no sense in package options?
"-gh" afaik is also project only (the mem manager applies to the entire exe)

"-gl" makes some sense, as it adds some basic debug info (line info), not sure about the inclusion of the units (lineinfo, ...) that cerate the dump, are they project wide?
That is using -gl on a package, ifin is ont used in the project, will that work?

Reply by email

Mattias Gaertner
to Martin Frb
Show quoted text 17 lines
On 07/12/2014 16:38, Mattias Gaertner wrote: > On Sat, 06 Dec 2014 21:16:47 +0000 > Martin Frb wrote: [...] Well at first I thought that simply the choice of stabs/dwarf should follow. Though of course it has nothing to follow, if the project has debug disabled, but the package has it on (that is possible) We could make the main toggle "Generate debug info" to follow too. But that is not needed. It can always be on, generating ppu with info, and the project can use -Xs (strip). Looking at it: "-Xg" (external dbg info), that is a linker flag. That probably makes no sense in package options?

Actually a package can build a program. Although it is unusual and not needed anymore when we have project groups.
So, yes, I agree it should be disabled when following Project Settings.

Show quoted text 7 lines
"-gh" afaik is also project only (the mem manager applies to the entire exe) "-gl" makes some sense, as it adds some basic debug info (line info), not sure about the inclusion of the units (lineinfo, ...) that cerate the dump, are they project wide? That is using -gl on a package, ifin is ont used in the project, will that work?

No.
So -Xg, -gh, -gl.
What about -pg and -vg?

BTW, why is -gt under "Debugging info" instead of "Checks and assertion"? It increases the nitpicking.

Mattias

Reply by email

Martin Frb
to Mattias Gaertner
Mattias Gaertner wrote 11 lines
On Sun, 07 Dec 2014 20:25:50 +0000 Martin Frb wrote: > "-gh" afaik is also project only (the mem manager applies to the entire exe) > > "-gl" makes some sense, as it adds some basic debug info (line info), > not sure about the inclusion of the units (lineinfo, ...) that cerate > the dump, are they project wide? > That is using -gl on a package, ifin is ont used in the project, will > that work? No. So -Xg, -gh, -gl.

-gl still adds lineinfo (a subset debug info). SO useful, but different name.

If stabs/dwarf do follow, and the package has no debug info, but it has -gl, then there is some trick to set the line info to the wanted format. But I do not remember ...

What about -pg and -vg?

Not sure if should follow.

maybe -vg (IIRC -vg is an extension to either stabs or dwarf, it changes the debug info generated (it drops some stuff, that older valgrind did not understand)

but -pg, I do not think. You do not necessaries want to profile packages.

BTW, why is -gt under "Debugging info" instead of "Checks and assertion"? It increases the nitpicking.

good question

Reply by email

Mattias Gaertner
to Martin Frb
Martin Frb hat am 7. Dezember 2014 um 22:57 geschrieben: [...] but -pg, I do not think. You do not necessaries want to profile packages.

IMHO the gprof output is far less readable if only the project units are compiled with -vg. But if you see an use for compiling only parts with -pg, ok with me.

Mattias

Reply by email

Martin Frb
to Mattias Gaertner
Mattias Gaertner wrote 8 lines
> Martin Frb hat am 7. Dezember 2014 um 22:57 geschrieben: > [...] > but -pg, I do not think. You do not necessaries want to profile packages. IMHO the gprof output is far less readable if only the project units are compiled with -vg. But if you see an use for compiling only parts with -pg, ok with me.

I never used it, so if you have experience with it, then decide.

I was just thinking, that if I profile my code, I might not need to see all the LCL stuff. But of course it depends, on the time actually being spent in my code, or in doing many calls to the LCL.

Reply by email