dummzeuch 1515 Posted September 19, 2020 Apparently the new experimental Filter Exception expert does not work when debugging IOS or Android apps (and probably also not for Linux programs). There is a bug report on the Embarcadero Quality Portal on crashes when debugging IOS apps. Uninstalling GExperts or disabling the Filter Exception expert solves that issue. Does anybody have similar experiences with other platforms? I had a look at the code again and figured that the problem might be that it hooks/calls TNativeDebugger methods in win32debugide*.bpl. Maybe it should instead call one of the other *debugide* packages: gdbdebugide (Linux)? ios32debugide ios64debugide But on the other hand I don't really care because I don't do any development for anything but Win32 (and possibly Win64 in the future). So I am thinking about disabling the expert when a project for non windows platforms is active instead. It should definitely not crash the IDE. Share this post Link to post
Mahdi Safsafi 225 Posted September 20, 2020 Please Thomas, check your Gexperts tickets. Share this post Link to post
dummzeuch 1515 Posted September 20, 2020 46 minutes ago, Mahdi Safsafi said: Please Thomas, check your Gexperts tickets. Thanks, this could solve the problem, but as I said: I cannot test it. I need some volunteers to test this. Any takers? It's just a matter of creating a simple Android, Linux, OSX or IOS application respectively that raises an exception and see what happens. If Mahdi's fix works this will simply display the filter exception dialog, if not, it will crash the IDE. That's simple to distinguish. 😉 I just tried to create a simple Android app to run in the emulator, only to discover that apparently the emulator is no longer supported for debugging. So, that leaves me with trying to install all the stuff necessary to debug on a real device or not give a damn. Share this post Link to post
Roland Skinner 6 Posted October 26, 2020 Hi. I can test it if you like. I've experienced the AV debugging both Android and Linux applications. I can test MacOS and iOS too. What do you need me to do? Share this post Link to post
dummzeuch 1515 Posted October 27, 2020 8 hours ago, Roland Skinner said: Hi. I can test it if you like. I've experienced the AV debugging both Android and Linux applications. I can test MacOS and iOS too. What do you need me to do? Thanks a lot for volunteering. Ijust made a release, the code to be tested is included in that. So in order to test it, simply install the release, enable the "Filter Exceptions" expert and debug code that raises exceptions. If the fix worked, you will get the new filter dialog for non-Windows projects. If it didn't, strange things (most likely AVs in the IDE) will happen. In the latter case, disable the "Filter Exceptions" expert and try again. The normal IDE dialog should appear and no AVs or other strange things should happen. Share this post Link to post
Mahdi Safsafi 225 Posted October 27, 2020 5 minutes ago, dummzeuch said: Thanks a lot for volunteering. Ijust made a release, the code to be tested is included in that. So in order to test it, simply install the release, enable the "Filter Exceptions" expert and debug code that raises exceptions. If the fix worked, you will get the new filter dialog for non-Windows projects. If it didn't, strange things (most likely AVs in the IDE) will happen. In the latter case, disable the "Filter Exceptions" expert and try again. The normal IDE dialog should appear and no AVs or other strange things should happen. My expectation is a failure because in the last commit I saw, GetVmtOffset didn't implement offset(vmtParent, vmtClassName) for iOS/Android. function GetVmtOffset(Process: IOTAProcess; Offset: TVmtOffset): Int64; begin {$IFDEF IS_WIN32_ONLY} Result := GetVmtOffsetWin32(Offset); {$ELSE} { Each platform should have corresponding constant value. } case Process.GetProcessType of optWin32: Result := GetVmtOffsetWin32(Offset); optWin64: Result := GetVmtOffsetWin64(Offset); // implement others... else raise Exception.Create('Please implement me.'); end; {$ENDIF} end; Share this post Link to post
Roland Skinner 6 Posted October 28, 2020 On 10/27/2020 at 10:44 AM, dummzeuch said: Thanks a lot for volunteering. Ijust made a release, the code to be tested is included in that. So in order to test it, simply install the release, enable the "Filter Exceptions" expert and debug code that raises exceptions. If the fix worked, you will get the new filter dialog for non-Windows projects. If it didn't, strange things (most likely AVs in the IDE) will happen. In the latter case, disable the "Filter Exceptions" expert and try again. The normal IDE dialog should appear and no AVs or other strange things should happen. Hi. Ok, fixed in Linux (tested with Ubuntu 20.04.2). Get this exception message for Linux in Delphi, which should have had message "Error Message" (this could be a Delphi error; I noticed it also after disabling the exception expert the other day): MacOS (10.15.7) all good: iOS (13.7) working, but same issue as Linux: Android (10 - 64-bit) still fails: I trust this helps... 2 Share this post Link to post
Roland Skinner 6 Posted October 29, 2020 Hi again. Just realized I could test Android 32-bit for you too. Same device (Android 10 64-bit). It works: And working on a 32-bit device (Android 7 - 32-bit): Looks like it is just 64-bit Android now. 1 Share this post Link to post
dummzeuch 1515 Posted October 29, 2020 Thanks a lot for testing this. It's good to see that it works for most platforms. 7 hours ago, Roland Skinner said: Get this exception message for Linux in Delphi, which should have had message "Error Message" (this could be a Delphi error; I noticed it also after disabling the exception expert the other day): Could you please double check this again? Also for IOS? If it is a Delphi issue, you should probably file a bug report with Embarcadero (in this case, make sure to disable GExperts completely (not just the Filter Exception expert) to ensure that it doesn't interfere with the debugging in any other way.) If it turns out to only happen in the Filter Exceptions expert, I'd like to know that. There are other tests which I would like you to try, if you like: Raise a different exception (so I can see whether the name is determined correctly. Raise an OS exception, e.g. division by zero or access violation. Share this post Link to post
dummzeuch 1515 Posted October 29, 2020 On 10/27/2020 at 9:58 AM, Mahdi Safsafi said: My expectation is a failure because in the last commit I saw, GetVmtOffset didn't implement offset(vmtParent, vmtClassName) for iOS/Android. function GetVmtOffset(Process: IOTAProcess; Offset: TVmtOffset): Int64; begin {$IFDEF IS_WIN32_ONLY} Result := GetVmtOffsetWin32(Offset); {$ELSE} { Each platform should have corresponding constant value. } case Process.GetProcessType of optWin32: Result := GetVmtOffsetWin32(Offset); optWin64: Result := GetVmtOffsetWin64(Offset); // implement others... else raise Exception.Create('Please implement me.'); end; {$ENDIF} end; Hm, yes, there is that. Very odd that it works at all. This function is only used in the testing code but that code is always enabled, so it should raise that exception.... Unless GetExceptionObject returns 0. Share this post Link to post
dummzeuch 1515 Posted October 29, 2020 7 hours ago, dummzeuch said: Hm, yes, there is that. Very odd that it works at all. This function is only used in the testing code but that code is always enabled, so it should raise that exception.... Unless GetExceptionObject returns 0. I now read those vmt offset values from the debugger using IOTAThread.Evaluate. Works fine for Win32 and Win64. Can't test other targets. Share this post Link to post
Mahdi Safsafi 225 Posted October 29, 2020 19 minutes ago, dummzeuch said: I now read those vmt offset values from the debugger using IOTAThread.Evaluate. Works fine for Win32 and Win64. Can't test other targets. Fluent Thomas how you used IOTAThread.Evaluate. I've one question (off-topic) : is Evaluate aware about others constants too ? For example can I use it to evaluate other System constants ? Share this post Link to post
dummzeuch 1515 Posted October 29, 2020 1 minute ago, Mahdi Safsafi said: Fluent Thomas how you used IOTAThread.Evaluate. I've one question (off-topic) : is Evaluate aware about others constants too ? For example can I use it to evaluate other System constants ? Yes, if they are in the current context. That should be no problem with constants declared in the system unit, but for other constants that might not be the case. Hm, thinking about it: I wonder whether this is still true for parts of the IDE that are not written in Delphi... 1 Share this post Link to post
Roland Skinner 6 Posted October 29, 2020 11 hours ago, dummzeuch said: Thanks a lot for testing this. It's good to see that it works for most platforms. Could you please double check this again? Also for IOS? If it is a Delphi issue, you should probably file a bug report with Embarcadero (in this case, make sure to disable GExperts completely (not just the Filter Exception expert) to ensure that it doesn't interfere with the debugging in any other way.) If it turns out to only happen in the Filter Exceptions expert, I'd like to know that. There are other tests which I would like you to try, if you like: Raise a different exception (so I can see whether the name is determined correctly. Raise an OS exception, e.g. division by zero or access violation. Hi. No problem assisting. I've been using GExperts for probably 20 years; glad I can help out. This is Linux, with GExperts uninstalled: "Error Message": Division by Zero: Accessing Nil-pointer (calling ClassName on TObject variable): Now with GExperts installed and exception-expert enabled: Division by Zero: Accessing Nil-pointer: Then, in iOS (GExperts installed and expert enabled): Division by Zero: Accessing Nil-pointer: I'll report the errors with the message to Embarcadero. I actually came here looking about issues I have with the Linux debugger, to see if anyone else had experienced the problems I've noticed. I'll report these too. (For example, objects are displayed as pointer-addresses only, yet you can see their member-values in a popup-inspector.) 2 Share this post Link to post
Mahdi Safsafi 225 Posted October 29, 2020 @Roland Skinner Thanks a lot man ! That's a great news knowing that it works mostly on all architectures. Just wondering what was wrong with Android 64-bit. Quote Get this exception message for Linux in Delphi, which should have had message "Error Message" (this could be a Delphi error; I noticed it also after disabling the exception expert the other day): Possibly from Delphi ... @Kas Ob have reported similar thing. Share this post Link to post