Finding source code line from error address lazarus / 12-Debugger ---------------------------------------------------------------------- sporex · 2021-01-03 11:37 Sorry if this has been asked earlier. I am running a console app under a LINUX OS. (not under the control of Lazarus) An EConvertError with the corresponding error address occurs. 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 An unhandled exception occurred at $000390C0 :EConvertError : "2;" is an invalid integer Is there an IDE function to identify the line in the source code that generates this error? In Turbo Pascal (long time) this was a very simple affair. Perhaps you could also tell me whether I need to compile with special debugger settings. (I am compiling with the default build mode) LAZ version : 1.2.4+dfsg2-1 FPC version : 2.6.4 Thx in advance ---------------------------------------------------------------------- PascalDragon · 2021-01-03 11:52 You could wrap your main program code like this: 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 begin  try    // ...  except    on e: Exception do begin      Writeln('Unhandled exception of type ', e.ClassName, ': ', e.Message);      DumpExceptionBacktrace(Output);    end;  end;end. Now if you have compiled with -glw you should see an exception backtrace that should also show the right file and line. ---------------------------------------------------------------------- Martin_fr · 2021-01-03 12:01 In "Project Options" page debugging, set  "generate debug info" to true, and choose "dwarf with sets" Then run your code in the debugger (by default F9 does this). The debugger should show the location of the error. Also check the "stack window" (view > debug windows) https://wiki.lazarus.freepascal.org/Debugger_Setup ---------------------------------------------------------------------- sporex · 2021-01-03 12:06 Quote from: PascalDragon on January 03, 2021, 12:52:34 pmYou could wrap your main program code like this: 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 begin  try    // ...  except    on e: Exception do begin      Writeln('Unhandled exception of type ', e.ClassName, ': ', e.Message);      DumpExceptionBacktrace(Output);    end;  end;end. Now if you have compiled with -glw you should see an exception backtrace that should also show the right file and line. Thank you a lot. If I got you right I can run the modified code without LAZ and get an Exception Dump on the console output with the errored sourc code line? ---------------------------------------------------------------------- PascalDragon · 2021-01-03 13:36 Quote from: sporex on January 03, 2021, 01:06:41 pmThank you a lot. If I got you right I can run the modified code without LAZ and get an Exception Dump on the console output with the errored sourc code line? If it works correctly that should indeed be the case then, yes. ---------------------------------------------------------------------- Martin_fr · 2021-01-03 14:10 Quote from: sporex on January 03, 2021, 01:06:41 pmIf I got you right I can run the modified code without LAZ and get an Exception Dump on the console output with the errored sourc code line? You should, yes.... Though, IIRC it may not work on Mac cocoa... (not tested lately, just thinking I read it somewhere) If you want to ship a release, and generate a client-side error report that the client can send back to you, then there is another way. In case you do not want the client to see your unit names. https://forum. lazarus.freepascal.org/index.php/topic,52676.msg388766.html#msg388766 ---------------------------------------------------------------------- Soner · 2021-01-03 14:35 I am using Dump_exception_call_stack from wiki in my application. You get very usefull informations. ---------------------------------------------------------------------- sporex · 2021-01-04 12:58 Thank you for all the valuable answers. Cheers