Re: debugger issues with structures lazarus / 9-Editor ---------------------------------------------------------------------- Martin_fr · 2025-05-10 10:10 Quote from: munair on May 10, 2025, 10:32:26 amOne of the few issues I currently have with Codetools is that it reports "TStringBuilder not found" while typing, Indeed... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program Project1;uses SysUtils;var a: TStringBuilder;beginend. You should report that. QuoteThe only thing buggy is the debugger when I try to get a variable's value, especially with record or class references. So I use writeln() frequently and hit ctrl+alt+o after execution end to check the output. That works very well. If you talk about properties with getter function: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i property Foo: T read GET_VALUE;This is a known issue. (Though in some cases you can call "GET_VALUE" from the watches window / of course with all side effects of the function call). Otherwise: OS ? Bitness? What is your "Debugger Backend" configuration? Menu: Tools > Options  (On Mac: Preferences > ...) Page: Debugger > Debugger Backend If your CPU is x86 or i386 (or M1..M3 on Mac) then it should be: "FpDebug internal Dwarf debugger" (or on Mac "LLDB + FpDebug") Your "project options", on the page debugging should have "Dwarf 3" selected. https://wiki.lazarus.freepascal.org/Debugger_Setup I have no problems inspecting classes or records. And also not with pointers (or pointer to pointer to...) of them. But if your debugger backend is "GDB" then you may indeed have issues with such pointers. If you must stay with GDB, make sure to use "Dwarf 2 with sets". It wont solve all issues, but it usually works better with GDB than Dwarf-3. There are issues with Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type TFoo=object   FVal: integer;  procedure Bar;end; While in a function of such an object (while such an object is "self") it can not be inspected. It can be, if it is another variable. To inspect it as self, you need FPC 3.3.1 If you have interfaces, then you can use    :i2o(myintf) https://wiki.freepascal.org/FpDebug-Watches-Intrinsic- Functions#I2O(interface)_{show_object_behind_an_interface} requires Lazarus 4.0 and FpDebug (not sure if it will work on Mac) If you have "Sender: TObject" then you can't (should be obvious) do: Sender.FTag TObject does not have FTag. However if you add it as watch, and you have "use instance class" enabled (can be set to be enabled by default, under Tools>Options), then it will show the whole object. Then you can expand it with the [ + ] button, and drag and drop the sub-watch FTag to the top level of the watches tree. (drag and drop needs the mouse to be over the TEXT of the watch-name. You can also directly enter, e.g.: TButton(Sender).FTag Or if you don't know the class, if the class may change (and if you use FpDebug) you can enter:  :cc(Sender).FTag See the link above for description of :cc If you have multiple classes of the same name but in different units, then the debugger may take anyone of them. In that case (with FpDebug) you can try to prefix them with the unitname: UnitFoo.TMyClass(Foo).FField ---------------------------------------------------------------------- Thaddy · 2025-05-10 10:39 Why would I report someting like that if classes is not included in the uses clause and neither {$mode delphi} nor {$mode objfpc} is specified..... That would be a bin report..... When specified, code simply works. Laziness or spring flue. ---------------------------------------------------------------------- Martin_fr · 2025-05-10 11:11 Quote from: Thaddy on May 10, 2025, 12:39:45 pmWhy would I report someting like that if classes is not included in the uses clause and neither {$mode delphi} nor {$mode objfpc} is specified..... That would be a bin report..... When specified, code simply works. Laziness or spring flue. Ignored. ---------------------------------------------------------------------- munair · 2025-05-10 14:17 It was already addressed two years ago: https://forum.lazarus.freepascal.org/index.php/topic,63823.msg484099.h tml#msg484099 ---------------------------------------------------------------------- Martin_fr · 2025-05-10 14:21 Well... Quote from: PascalDragon on June 28, 2023, 11:37:33 pmThe important part is the type alias in line 339 of sysstrh.inc. It's simply that Lazarus CodeTools had/has problems if there is a temporary define with the same name in the same unit which is why that was changed. So yes, with the current version of FPC there shouldn't be a problem anymore. Maybe newer versions of FPC will not have the code that makes codetools fail. But Codetools shouldn't fail in first. Codetools should find it even with the old fpc code.