How to Debug and Step into Assert() Function in Lazarus? lazarus / 12-Debugger ---------------------------------------------------------------------- Aruna · 2024-10-25 02:04 Hi everyone, I'm working on a simple Lazarus project, and I'm using Assert() statements to catch unexpected conditions in my code. However, when an assertion fails, the program terminates, and I'm unable to step into the Assert() function to examine the context around the failure directly. I want to understand better what’s causing the assertion to trigger by being able to step through it in the debugger. Does anyone know if it’s possible to configure Lazarus or use a specific debugging technique to step into Assert()? Or is there a way to see more context about the failed assertion beyond the termination message? What would be ideal is to be able to single-step through Assert() and any related code. A simple code example is below that demonstrates the problem. 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 unit Unit1; {$mode objfpc}{$H+}{$ASSERTIONS ON} // or equivalently {$C+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    procedure Button1Click(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 }  procedure TestDivision(a, b: Integer);var  result: Integer;begin  // Assert that the denominator is not zero before dividing  Assert(b <> 0, 'Error: Division by zero!');   result := a div b;  WriteLn(a, ' divided by ', b, ' equals ', result);end;  procedure TForm1.Button1Click(Sender: TObject);begintry   WriteLn('Testing division:');   TestDivision(10, 2);   // Works fine   TestDivision(10, 0);   // Will trigger assertion failure except   on E: Exception do     WriteLn('Exception: ', E.Message); end;end; end. ---------------------------------------------------------------------- Thaddy · 2024-10-25 04:20 I would first get rid of using a plain exception if what you want is a specific EAssertionFailed exception. 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 procedure TForm1.Button1Click(Sender: TObject);begintry   WriteLn('Testing division:');   TestDivision(10, 2);   // Works fine   TestDivision(10, 0);   // Will trigger assertion failure except   on E: EAssertionFailed do     WriteLn('Exception: ', E.Message)else  raise;// it is not an assertion. end;end; or something along that line; ---------------------------------------------------------------------- Joanna · 2024-10-25 04:38 Aruna and I were discussing assert () in chat. Neither of us could step into it. I don’t know if it’s the fault of the gdb or assert is intentionally off limits? Hovering over assert () doesn’t allow me to click on link to the source code like other things do. When I tried to use assert in my project it does indeed stop the program with a dialog giving the line number of error and a gump to choose break or continue. Break takes me to spot where error occurred which Is good. If I continue there is another gump for abort or risk data corruption. So for debugging I guess it works ok but why am I not allowed to trace into it to see what it’s doing? I want to see how it gets the line number of error and such. I have opted to use my own version of error checking that shows message and halts because assert requires too much gump clicking ---------------------------------------------------------------------- Martin_fr · 2024-10-25 07:19 What do you mean "step into assert"? If you indeed want to see what assert itself does, then you need to build an fpc (an rtl) with debug info. (e.g. using fpcupdeluxe). It is in system.inc 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 Procedure fpc_assert(Const Msg,FName:Shortstring;LineNo:Longint;   ErrorAddr:Pointer); [Public,Alias : 'FPC_ASSERT']; compilerproc;begin  if codepointer(AssertErrorProc)<>nil then    AssertErrorProc(Msg,FName,LineNo,ErrorAddr)  else    HandleErrorAddrFrameInd(227,get_pc_addr,get_frame);end;  Mind that this is an intrinsic. As you can see the boolean result of the condition is not in the parameters => that code is inlined into your calling procedure. So the above is only called, if the condition fails. Afaik it then depends. If any unit in your app (including recursively any unit you used) uses "SysUtils then it throws an exception. And if you want you can catch that exception. Most of the time the assert is simply used to alert of the error, and then meant to stop the exe. Otherwise use "if ... then raise exception.create();" ---------------------------------------------------------------------- MarkMLl · 2024-10-25 07:24 I checked earlier (since that was my first thought), and even if FPC is built with full debugging the IDE doesn't step into Assert(). Presumably this is because- as you say- Assert() is a compiler/RTL intrinsic. I didn't check whether setting a breakpoint inside the RTL would do it. MarkMLl ---------------------------------------------------------------------- Martin_fr · 2024-10-25 07:37 It does step in. But only if the condition is true. The condition itself is inlined into the caller.. ---------------------------------------------------------------------- MarkMLl · 2024-10-25 08:27 Ah :-) So presumably if somebody wants to explore what's actually happening they insert a dummy Assert() with the condition negated. Would this do anything at all if the condition was entirely evaluated at compilation time, e.g. 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 Assert( { not } SizeOf(Longword) = 2), ... )  I've actually got quite a lot of size-checking assertions, particularly when checking that a data structure defined in e.g. an I2C or SPI interface unit is what's known in the C original. MarkMLl ---------------------------------------------------------------------- Joanna · 2024-10-25 10:24 What I did was placed a breakpoint in Lazarus on same line as assert and then tried to step into it using the ide. ---------------------------------------------------------------------- Martin_fr · 2024-10-25 10:29 Quote from: Joanna from IRC on October 25, 2024, 12:24:31 pmWhat I did was placed a breakpoint in Lazarus on same line as assert and then tried to step into it using the ide. Same as I did. But I also did: - make sure the condition was false - my RTL had full debug info (that needs to be done outside the IDE) ---------------------------------------------------------------------- Joanna · 2024-10-25 10:51 I used assert (false = true,’false = true);  Which definitely ended the program after two different dialogs were clicked. What was behavior of yours? ---------------------------------------------------------------------- Aruna · 2024-10-25 10:54 Quote from: Martin_fr on October 25, 2024, 12:29:46 pm- my RTL had full debug info (that needs to be done outside the IDE) Hi @Martin_fr and 'how' does one do this please? EDIT: make all OPT="-g -gl ? ---------------------------------------------------------------------- Martin_fr · 2024-10-25 11:02 Quote from: Aruna on October 25, 2024, 12:54:37 pmQuote from: Martin_fr on October 25, 2024, 12:29:46 pm- my RTL had full debug info (that needs to be done outside the IDE) Hi @Martin_fr and 'how' does one do this please? FpcUpDeluxe. Well that or download the sources, and play with Makefiles. (I don't have a link to any instructions) Either way, you get a 2nd independent install of FPC => once you got that in the IDE you need to change the compiler (Tools > options // or if you prefer in the project settings, something like compile commands) ---------------------------------------------------------------------- TRon · 2024-10-25 11:07 Quote from: Aruna on October 25, 2024, 12:54:37 pmEDIT: make all OPT="-g -gl ? afaik it is make all DEBUG=1 ---------------------------------------------------------------------- Martin_fr · 2024-10-25 11:12 Quote from: TRon on October 25, 2024, 01:07:31 pmQuote from: Aruna on October 25, 2024, 12:54:37 pmEDIT: make all OPT="-g -gl ? afaik it is make all DEBUG=1 If you use FpDebug in your IDE I would suggest   OPT="-gl -gw3 -O-1" -gl is not strictly needed. The info is added with -gw3 And the unit will be added if you compile the project with -gl Of course if you want nice dumps when the compiler itself crashes => then yes: -gl ---------------------------------------------------------------------- MarkMLl · 2024-10-25 11:57 Quote from: Martin_fr on October 25, 2024, 01:12:07 pmIf you use FpDebug in your IDE I would suggest   OPT="-gl -gw3 -O-1" -gl is not strictly needed. The info is added with -gw3 And the unit will be added if you compile the project with -gl Of course if you want nice dumps when the compiler itself crashes => then yes: -gl I routinely build FPC with -O- -gl and- as I said earlier- I couldn't step into an arbitrary assertion. However I didn't try both states of the controlling predicate. MarkMLl ---------------------------------------------------------------------- Aruna · 2024-10-25 12:51 Quote from: Martin_fr on October 25, 2024, 01:02:42 pmFpcUpDeluxe. I have never used FpcUpDeluxe Quote from: Martin_fr on October 25, 2024, 01:02:42 pmWell that or download the sources, and play with Makefiles. (I don't have a link to any instructions) Yes I usually build from source I find that is easier for me. Quote from: Martin_fr on October 25, 2024, 01:02:42 pmEither way, you get a 2nd independent install of FPC => once you got that in the IDE yo u need to change the compiler (Tools > options // or if you prefer in the project settings, something like compile commands) Thanks Martin I will explore this further when I have time. ---------------------------------------------------------------------- Aruna · 2024-10-25 12:52 Quote from: TRon on October 25, 2024, 01:07:31 pmQuote from: Aruna on October 25, 2024, 12:54:37 pmEDIT: make all OPT="-g -gl ? afaik it is make all DEBUG=1 Thank you @TRon I will experiment with all the options and get back to you.. ---------------------------------------------------------------------- Aruna · 2024-10-25 12:54 Quote from: Martin_fr on October 25, 2024, 01:12:07 pmQuote from: TRon on October 25, 2024, 01:07:31 pmQuote from: Aruna on October 25, 2024, 12:54:37 pmEDIT: make all OPT="-g -gl ? afaik it is make all DEBUG=1 If you use FpDebug in your IDE I would suggest   OPT="-gl -gw3 -O-1" -gl is not strictly needed. The info is added with -gw3 And the unit will be added if you compile the project with -gl Of course if you want nice dumps when the compiler itself crashes => then yes: -gl I am running linux debian and I went with the default settings when I first installed so I think what I have in the IDE is gdb. How do I change this to FpDebug? ---------------------------------------------------------------------- MarkMLl · 2024-10-25 13:01 Quote from: Aruna on October 25, 2024, 02:54:29 pmI am running linux debian and I went with the default settings when I first installed so I think what I have in the IDE is gdb. How do I change this to FpDebug? IDE, Tools -> Options -> Debugger -> Debugger backend -> Change type I think. MarkMLl ---------------------------------------------------------------------- Aruna · 2024-10-25 13:03 Quote from: MarkMLl on October 25, 2024, 03:01:07 pmQuote from: Aruna on October 25, 2024, 02:54:29 pmI am running linux debian and I went with the default settings when I first installed so I think what I have in the IDE is gdb. How do I change this to FpDebug? IDE, Tools -> Options -> Debugger -> Debugger backend -> Change type I think. MarkMLl Thank you Mark. ---------------------------------------------------------------------- Martin_fr · 2024-10-25 13:11 Quote from: MarkMLl on October 25, 2024, 03:01:07 pmQuote from: Aruna on October 25, 2024, 02:54:29 pmI am running linux debian and I went with the default settings when I first installed so I think what I have in the IDE is gdb. How do I change this to FpDebug? IDE, Tools -> Options -> Debugger -> Debugger backend -> Change type Not "change type". Select from the drop button in the toolbar (toolbar on top of the frame). If not in there, then "add". That way you can easily change later. ---------------------------------------------------------------------- MarkMLl · 2024-10-25 15:14 Sorry, I think I've been caught by that one before. It's not exactly intuitive though... MarkMLl ---------------------------------------------------------------------- Martin_fr · 2024-10-25 15:46 Quote from: MarkMLl on October 25, 2024, 05:14:39 pmSorry, I think I've been caught by that one before. It's not exactly intuitive though... How to make it more intuitive? If you click the "change type" a red warning appears, telling you to use "add" instead. Changing the type can however be useful in some scenarios. When you have a gdb debugger and want to turn it into a gdb server, changing the type will preserve all options (from the grid) that they both share. Of course "copy" and the "change type" may be an even better idea. gdb and fpdebug hardly share any options. So change type between them is not of much use. It will work though. But you should then also change the name or it gets confusing. ---------------------------------------------------------------------- MarkMLl · 2024-10-25 17:30 Quote from: Martin_fr on October 25, 2024, 05:46:40 pmHow to make it more intuitive? I'm sorry, that sounded excessively critical. It's just that irrespective of whether that top line is a menu or the tabs on a multipage control (without the visual hint of tab outlines), it's unusual to get a dropdown in the same place. A bit of a mixed metaphor... QuoteChanging the type can however be useful in some scenarios. When you have a gdb debugger and want to turn it into a gdb server, changing the type will preserve all options (from the grid) that they both share. Of course "copy" and the "change type" may be an even better idea. gdb and fpdebug hardly share any options. So change type between them is not of much use. It will work though. But you should then also change the name or it gets confusing. Yes, and using a gdb server is about the only way of debugging something that runs as root (or with enhanced capabilities). MarkMLl ---------------------------------------------------------------------- Martin_fr · 2024-10-25 17:43 Sorry on getting off topic... Quote from: MarkMLl on October 25, 2024, 07:30:19 pmI'm sorry, that sounded excessively critical. It didn't, not at all. And you are not the only one who got that wrong. So I am genuinely looking for answers how to improve it. It seems there is a similar issue on the "user defined markup" with adding lists (aka groups). Yet, on the Display>Colors page, it does seem to work. Or maybe people rarely need to change stuff in the toolbar? Though on 2nd thought the color|priority buttons may not be well known, but then that is expert territorial. The drop-buttons could probably be replaced by real comboboxes. Not sure if they will stick out like a sore thumb, but maybe that is exactly what they need to do? And then they don't expand to the length of their content.... Maybe just give the thing a diff color, but changing colors always goes wrong when users meddle with the IDE colors (suck as dark theme) ---------------------------------------------------------------------- MarkMLl · 2024-10-25 17:59 I don't think that many people fiddle with the colours, or with keyword etc. markup (noting the recent thread, which seemed to be new ground for a lot of people). Looking at those various setup pages, I suspect that on the others (colours etc.) the user's expectations are guided by the combination of short legends on the leftmost, and (on gtk2) the depressed outline. Those visual hints aren't nearly as strong on the "busier" debugger backend page, where the leftmost legend is much longer... I'm not sure if that really is an issue, or if it's entirely down to everybody pretty much having to use the debugger page and hardly anybody fiddling with colours. Similar apologies to OP for waylaying the thread, but if the choice of debugger is significant in the problem I think it's justified. MarkMLl ---------------------------------------------------------------------- Aruna · 2024-10-26 02:23 Quote from: Martin_fr on October 25, 2024, 07:43:39 pmSorry on getting off topic... How is a debugger and debugger-related dialogue off- topic? 'I' do not think anything said was off-topic as 'I learn with each post when someone says or shares something. All good at my end ---------------------------------------------------------------------- Aruna · 2024-10-26 02:28 Quote from: MarkMLl on October 25, 2024, 07:59:19 pmSimilar apologies to OP for waylaying the thread, but if the choice of debugger is significant in the problem I think it's justified. If 'you' or anyone apologizes again for sharing what to 'me' is very useful information you leave me no choice but to say for $DIETY's sake Mark ---------------------------------------------------------------------- Aruna · 2024-10-26 12:42 Hello @MarkMLl and @Martin_fr, I tested what you both said and the first screenshot shows the warning in red and I have a question about the second screenshot what are all of those? I have never seen a LLDB Debugger (Alpha) before?? ---------------------------------------------------------------------- Martin_fr · 2024-10-26 13:08 https://wiki.freepascal.org/Debugger_Status LLDB like GDB is a command line debugger, that you can download. It supports Linux, Win and Mac. In the IDE it was added as "LLDB with FpDebug" for Mac, since the pure "FpDebug" does not work for Mac. "LLDB (Alpha)" without FpDebug was just a by product. It exists, but has no support. (hence Alpha). FpDebug only supports the Intel/Amd architecture, so for other targets other debuggers are needed. And also for cross debugging and embedded other debuggers are needed. (though there is an FpDebug based debugger for some avr embedded...) On Windows, gdb is still shipped with the IDE => so that can be used. However it delivers a significantly lesser experience. There are a very few edge cases where it still may be useful. (like in some scenarios, when debugging inside the windows kernel, it gives longer stack traces // or cross debugging from a 32bit IDE to a 64bit project -> really should use the 64bit IDE instead) ---------------------------------------------------------------------- PascalDragon · 2024-10-26 13:40 Quote from: Martin_fr on October 25, 2024, 09:19:28 amIt is in system.inc 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 Procedure fpc_assert(Const Msg,FName:Shortstring;LineNo:Longint;   ErrorAddr:Pointer); [Public,Alias : 'FPC_ASSERT']; compilerproc;begin  if codepointer(AssertErrorProc)<>nil then    AssertErrorProc(Msg,FName,LineNo,ErrorAddr)  else    HandleErrorAddrFrameInd(227,get_pc_addr,get_frame);end;  Mind that this is an intrinsic. As you can see the boolean result of the condition is not in the parameters => that code is inlined into your calling procedure. So the above is only called, if the condition fails. Afaik it then depends. If any unit in your app (including recursively any unit you used) uses "SysUtils then it throws an exception. And if you want you can catch that exception. And as one might also conclude from that code: one can replace AssertErrorProc if one wants. For example the mentioned throwing of an exception is accomplished by the SysUtils unit setting AssertErrorProc in its initialization section. ---------------------------------------------------------------------- Aruna · 2024-10-27 00:39 Quote from: Martin_fr on October 26, 2024, 03:08:23 pmhttps://wiki.freepascal.org/Debugger_Status Many thanks for the link.. Quote from: Martin_fr on October 26, 2024, 03:08:23 pmLLDB like GDB is a command line debugger, that you can download. It supports Linux, Win and Mac. Ok.. Quote from: Martin_fr on October 26, 2024, 03:08:23 pmIn the IDE it was added as "LLDB with FpDebug" for Mac, since the pure "FpDebug" does not work for Mac. Ah, I see now.. Quote from: Martin_fr on October 26, 2024, 03:08:23 pm"LLDB (Alpha)" without FpDebug was just a by product. It exists, but has no support. (hence Alpha). Hmm.. interesting. Quote from: Martin_fr on October 26, 2024, 03:08:23 pmFpDebug only supports the Intel/Amd architecture, so for other targets other debuggers are needed. And also for cross debugging and embedded other debuggers are needed. (though there is an FpDebug based debugger for some avr embedded...) Thank you for taking the time to explain all this, very much appreciated. Quote from: Martin_fr on October 26, 2024, 03:08:23 pmOn Windows, gdb is still shipped with the IDE => so that can be used. However it delivers a significantly lesser experience. There are a very few edge cases where it still may be useful. (like in some scenarios, when debugging inside the windows kernel, it gives longer stack traces // or cross debugging from a 32bit IDE to a 64bit project -> really should use the 64bit IDE instead) Your joking right? 'Who' debuuged from a 32bit IDE into a 64bit project that is not going to end well as MarkMLI would say. You have to be insane to do something like that or simply did not know better? ---------------------------------------------------------------------- Martin_fr · 2024-10-27 10:17 Quote from: Aruna on October 27, 2024, 02:39:20 am Your joking right? 'Who' debuuged from a 32bit IDE into a 64bit project that is not going to end well as MarkMLI would say. You have to be insane to do something like that or simply did not know better? Over the years I have learned that some of the things I take for granted (as in "how else could you possible do that") are anything but that. And that there are other ways to it. Even if those other ways don't work for me, they still make sense. Maybe someone has some IDE add on, that only comes for 32bit (e.g. requires a dll that only exists in 32bit)? That can happen if you write software to control external legacy hardware (and you need it to work in the designer too), and the drivers are 32bit. If that is industrial, then new hardware may cost 5 or 6 digits figures. ---------------------------------------------------------------------- Aruna · 2024-10-27 10:21 Quote from: PascalDragon on October 26, 2024, 03:40:05 pmQuote from: Martin_fr on October 25, 2024, 09:19:28 amIt is in system.inc 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 Procedure fpc_assert(Const Msg,FName:Shortstring;LineNo:Longint;   ErrorAddr:Pointer); [Public,Alias : 'FPC_ASSERT']; compilerproc;begin  if codepointer(AssertErrorProc)<>nil then    AssertErrorProc(Msg,FName,LineNo,ErrorAddr)  else    HandleErrorAddrFrameInd(227,get_pc_addr,get_frame);end;  Mind that this is an intrinsic. As you can see the boolean result of the condition is not in the parameters => that code is inlined into your calling procedure. So the above is only called, if the condition fails. Afaik it then depends. If any unit in your app (including recursively any unit you used) uses "SysUtils then it throws an exception. And if you want you can catch that exception. And as one might also conclude from that code: one can replace AssertErrorProc if one wants. For example the mentioned throwing of an exception is accomplished by the SysUtils unit setting AssertErrorProc in its initialization section. Hi @PascalDragon. I am yet very new to all this and trying to teach myself how things work under the hood. So, The fpc_assert procedure checks whether a custom error handler (AssertErrorProc) is set? If it is, it uses it to handle the assertion. Otherwise, it uses a default handler (HandleErrorAddrFrameInd) ? Is that the way things work? I also ran the code snippet above throughchatGPT as it has many times helped me to break down things and understand how the code works. This is what chatGPT said when I asked it to give me a heavily commented breakdown and explanation: --- 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 Procedure fpc_assert(Const Msg, FName: Shortstring; LineNo: Longint; ErrorAddr: Pointer);   // Declares the procedure 'fpc_assert', which is used to handle assertion errors.  // Parameters:  //   - Msg: A message string that provides details about the assertion error.  //   - FName: The name of the file in which the assertion failed.  //   - LineNo: The line number in the file where the assertion failure occurred.  //   - ErrorAddr: A pointer to the address where the error occurred, which can  //     help in debugging the issue by showing the memory location.   [Public, Alias : 'FPC_ASSERT'];  // The procedure is public and has an alias 'FPC_ASSERT'.                                 // This means it can be called using 'FPC_ASSERT' as an alternative name.  compilerproc;  // This attribute specifies that it is a compiler-provided procedure                 // and can only be used internally by the compiler. begin  if codepointer(AssertErrorProc) <> nil then    // Check if 'AssertErrorProc' (a custom assertion error handler) is set.    // 'codepointer' is used to obtain the code pointer of 'AssertErrorProc' and check if it's not nil.    // If it's nil, no custom error handler is defined, so we use a default handler instead.     AssertErrorProc(Msg, FName, LineNo, ErrorAddr)    // If 'AssertErrorProc' is not nil, call it with the provided assertion details (Msg, FName, LineNo, ErrorAddr).    // This allows the custom handler to process the assertion failure as needed.   else    HandleErrorAddrFrameInd(227, get_pc_addr, get_frame);    // If 'AssertErrorProc' is nil, use the default error handler 'HandleErrorAddrFrameInd'.    // Parameters for 'HandleErrorAddrFrameInd':    //   - 227: Likely a specific error code indicating an assertion failure.    //   - get_pc_addr: Function to get the program counter (PC) address where the error occurred.    // - get_frame: Function to get the current stack frame, which helps in tracing the error context.end; It also gave me this:Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Key Points Explained     Parameters:        Msg: A short string with the error message for the assertion. This message usually describes what the assertion expected to be true.        FName: The file name where the assertion failed, which aids in debugging by showing the source location.        LineNo: The line number in the file where the failure happened, which helps pinpoint the exact location in the source code.        ErrorAddr: The memory address where the error occurred, useful for lower-level debugging.     Error Handling Logic:        Custom Handler (AssertErrorProc):            AssertErrorProc is checked first. If it’s not nil, it means a custom error-handling procedure is set, and it will be used to handle the assertion.            This is useful if developers want to customize how assertions are reported or handled.        Default Handler (HandleErrorAddrFrameInd):            If AssertErrorProc is nil (no custom handler is provided), it falls back on a default handler, HandleErrorAddrFrameInd. This function uses             hardcoded values and system functions (get_pc_addr and get_frame) to identify the program counter and stack frame, aiding in debugging            by showing the context of the assertion failure. This setup allows the fpc_assert procedure to either use custom handling or revert to a default approach, ensuring assertions are managed consistently, even if a custom handler is absent. Is the above correct? The reason I ask is when I run anything through chatGPT I usually get myself in a lot of trouble with the community or end up being told not to use generated AI nonsense. But to me, chatGPT is simply another 'tool' that has helped me understand code which at first was way over my head. I decided to share this in the hope if the breakdown is correct and accurate it can help others who are newbies like myself. ---------------------------------------------------------------------- Joanna · 2024-10-27 11:14 Quote Is the above correct? You could ask chat gpt ---------------------------------------------------------------------- Aruna · 2024-10-27 12:07 Quote from: Joanna from IRC on October 27, 2024, 12:14:47 pmQuote Is the above correct? You could ask chat gpt  I did ask and chatGPT said please go ask the gods. So I did PascalDragon = One of the Pascal Gods! Soo.. HA! ---------------------------------------------------------------------- Aruna · 2024-10-27 12:13 Quote from: Martin_fr on October 27, 2024, 11:17:33 amOver the years I have learned that some of the things I take for granted (as in "how else could you possible do that") are anything but that. And that there are other ways to it. Even if those other ways don't work for me, they still make sense. True... been there, done that recently with a Arduino Nano and getting Laz-IDE to talk to it ( bi- directional) and MarkMLI freaked out and wanted to know "why are you using file operations on a serial comm port"  and he was right to ask but I could not for the life of me get Synapse to be my friend or suss out how Synapse wants things done so I went old school and the thing is my file operations worked! Quote from: Martin_fr on October 27, 2024, 11:17:33 amMaybe someone has some IDE add on, that only comes for 32bit (e.g. requires a dll that only exists in 32bit)? That can happen if you write software to control external legacy hardware (and you need it to work in the designer too), and the drivers are 32bit. If that is industrial, then new hardware may cost 5 or 6 digits figures. Oh yes that... I totally forgot the rather pricey industrial aspect!