Need to see vars in outer procedures. No stack frames? lazarus / 12-Debugger ---------------------------------------------------------------------- mm7 · 2020-04-17 01:39 Hi It is Linux, Ubuntu, 64 bit. Lazarus 2.0.6 and 2.0.8. FPC 3.0.4. I use default debugger or Dwarf2. if I call procs one inside another ProcLevel1   ProcLevel2     ProcLevel3 then I put breakpoint inside ProcLevel3. Debugger shows only variables values for this ProcLevel3. And of course globals. When I open Stack Trace and navigate to ProcLevel2 or ProcLevel1 debugger does not show values. Is it normal, or I'm missing something? GDB is capable for stack frames. Is it not in use? thanks ---------------------------------------------------------------------- Martin_fr · 2020-04-17 07:03 It should show them.... Are all procedures defined in the same unit? Did you compile with optimization off? If you specified "inline" on any of the procedure, then put {$INLINE off} on top of the unit. FPC does not generate info for inlined procedures. ---------------------------------------------------------------------- Martin_fr · 2020-04-17 07:23 There is some info on the correct setup: https://wiki.lazarus.freepascal.org/Debugger_Setup If it does still not work, please try to generate a logfile https://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_deb ug_session And specify the version of GDB you have. ---------------------------------------------------------------------- MarkMLl · 2020-04-17 12:18 Quote from: mm7 on April 17, 2020, 03:39:50 amDebugger shows only variables values for this ProcLevel3. And of course globals. When I open Stack Trace and navigate to ProcLevel2 or ProcLevel1 debugger does not show values. Is it normal, or I'm missing something? The little green arrow that sets the stackframe associated with a particular function to be current. MarkMLl ---------------------------------------------------------------------- mm7 · 2020-04-17 12:53 GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 This GDB was configured as "x86_64-linux-gnu". Compilation and Linking 0 - no optimization all other fields are blank or 0 Debugging all checks are On Generate info On Dwarf2 Line numbers On Generate code for Valgring  On The classes I am trying to debug declared in same module. Realization is in separate .inc files. I do not see a little green arrow. Where is it? ---------------------------------------------------------------------- MarkMLl · 2020-04-17 13:13 Top of the stackframe window. MarkMLl ---------------------------------------------------------------------- Martin_fr · 2020-04-17 14:15 I totally did not think of that.... But MarkMLI is right. If you don't know the green Button, then that is why. To activate a stackframe you must set it "current". The button is in the "Toolbar": Power button,  Blue button,  green button,  "Max 10", .... ---------------------------------------------------------------------- MarkMLl · 2020-04-17 15:22 Quote from: Martin_fr on April 17, 2020, 04:15:53 pmI totally did not think of that.... But MarkMLI is right. If you don't know the green Button, then that is why. To activate a stackframe you must set it "current". The button is in the "Toolbar": Power button,  Blue button,  green button,  "Max 10", .... Martin: why is that not the default? I'm pretty sure that OP and I aren't the only people to have been caught by that, and IMO having the current stackframe follow the selected function/procedure is what the user will almost always want and expect. MarkMLl ---------------------------------------------------------------------- Martin_fr · 2020-04-17 17:16 I don't have a good answer to that. It has been like this for ages.... (which is the worst answer...) There is a twist. It was easier when the toolbar had text+icon (or just text?). Debugger windows were inconsistent on that, some had icons, some had text. Some people complained text took to much space, and there was a patch ... now its icons. Would be nice to have an option (and text as default for newcomers), but that's on one of those very long lists... Automatically following the "selected/highlighted" item is an option too. But needs to be optional. I often check what code is in the caller (double click jumps there), without needing to update watches. (Sometimes requiring to see the watches of the top frame). A toggle button would be enough. And/Or middle button  to jump, without selecting.... ---------------------------------------------------------------------- mm7 · 2020-04-17 23:19 Aaaa! Now I see! what is "Green" button for you, for me is Text button "Current". In XFCE environment. Thank you all! Very helpful advise! But I agree, it would be better it switches to a current line automatically. Now after I dbl-click, it opens editor with code and stack window may become invisible, I have to switch back to it, set stack frame, and switch to editor.  Or I need single click on a stack line, click "green" button, then dbl-click the line again. ---------------------------------------------------------------------- MarkMLl · 2020-04-18 07:06 Don't worry, I think Martin's got the idea :-) MarkMLl ---------------------------------------------------------------------- Martin_fr · 2020-04-18 08:35 Quote from: MarkMLl on April 18, 2020, 09:06:57 amDon't worry, I think Martin's got the idea :-) The Idea: yes. the time: probably not that soon But, if anyone reading this, is interested:  It should be fairly simple. Probably only needs changes to one unit. debugger/callstackdlg.pp Add a toggle button to the toolbar, find the onclick/dblclick event.... As a bonus, add persistence via the config   EnvironmentOptions.DebuggerConfig.DlgCallStackConfig.AutoSelectFrame := .....; (add a published property) Patch or pull-request on https://github.com/User4martin/lazarus (Pull request for other issues: ask first / only if worked on by me: debugger, synedit) ---------------------------------------------------------------------- MarkMLl · 2020-04-18 11:20 I'll bear that in mind but I'm afraid that I'm not volunteering right now... I've got rather a lot on my plate. As a slight aside, where are things like the little green arrow glyph defined? MarkMLl ---------------------------------------------------------------------- Martin_fr · 2020-04-18 11:26 Quote from: MarkMLl on April 18, 2020, 01:20:06 pmAs a slight aside, where are things like the little green arrow glyph defined? Images are in the images folder in different sizes. (svg or other resizeable forms are in ccr). There is a bat / sh file to generate resources from the images. - Need to check, if the resulting res file needs to be copied into the ide (or other) folder, or if it is picked up automatically. Then search for IDEImages  (e.g. in the callstack unit) ---------------------------------------------------------------------- MarkMLl · 2020-04-18 11:53 Thanks Martin, got it. If I wanted to do something custom like putting a red slash over the green arrow, are there any notes etc.? (Surely I wouldn't have to start off by getting all possible variants into the Tango release.) MarkMLl ---------------------------------------------------------------------- Martin_fr · 2020-04-18 12:29 You mean, build your icon by merging others? No idea. I believe currently all icons (maybe except for greying inactive) are individual icons. afaik.... Note that (iirc): Images_16  are 16 pixel images, assuming dpi=96. If the system has a diff dpi, then images_16 may return other sizes. (either from the avail precomputed sizes, or via resizing) So if you process icons, you may need to be aware of that. (also that dpi can change at runtime) If you want the in-depth on dpi handling, you should ask on a separate thread. (not sure if the maintainer is on the forum though) ---------------------------------------------------------------------- mm7 · 2020-04-18 15:01 May be for time being it would make sense to add "How to switch stack frames" topic into Wiki Debugger page? ---------------------------------------------------------------------- Martin_fr · 2020-04-18 20:14 Quote from: mm7 on April 18, 2020, 05:01:50 pmMay be for time being it would make sense to add "How to switch stack frames" topic into Wiki Debugger page? Please go ahead. Also see: https://wiki.lazarus.freepascal.org/IDE_Window:_Call_Stack#S et_as_current Which by the way, is the page that should open if you press F1 on the callstack window.