Jump to content

Search the Community

Showing results for tags 'debug'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 13 results

  1. I've had a couple of requests for information on what settings etc I use to edit, compile Delphi from VSCode and I'm hoping others can add insights on what they use. I don't have extensive experience with VSCode and moved to it last year for the following reasons, in priority order To work around a lot of problems we encounter with the Embarcadero IDE with our projects To have a consistent IDE between Linux C work and Windows Delphi To trial effectiveness of CoPilot after co-workers said how great it was. Unfortunately I haven't done a clean VSCode setup and notes record from scratch so these aren't definitive notes. I do some C coding on a Linux VM for a real time control app as well as Windows Delphi, hence C/C++ extensions Extensions I have following extensions installed C/C++, C/C++ Extension Pack, C/C++ GNU Global, C/C++ Themes, CMake, CMakeTools, CodeLLDB Delphi LSP, Insert GUID, #region folding, #region tree view GitHub Copilot GitHub Copilot Chat Numbered Bookmarks Pascal, Pascal Formatter SVN Todo Tree WSL XML The following extensions are installed but disabled #region tree view Auto-align Better Align My notes say I installed the following but they aren't there now Delphi Extension Pack which installs Pascal (still installed), Numbered Bookmarks (still installed), Delphi Keymap, Delphi Themes, CodeRunner, MakeFile, Note on CoPilot, I'm a greybeard (although haven't had a beard for many years) and have been amazed at what it suggests, can do and some of the inferences it makes. Sometimes it's mind boggling, eg coming up with a correct suggestion for something you're typing that's not related to anything else in the code nor anything else that you would think was commonplace. You do need to check it carefully though, hallucinations, subtle and not subtle mistakes but well worth the time it can save. Editor Tab colors I use dark themes. It can be difficult to see which tab item in the tab bar belongs to the currently visible file in the editor, especially when jumping to function definitions etc. To add colorization open settings and search for colorcustomization Under workbench: Color Customization click on Edit in settings.json Example settings 1) black inactive tab header with active tab having medium blue background and light blue activeBorder and activeBorderTop "workbench.colorCustomizations": { "tab.activeBackground": "#0091ff56", "tab.activeBorder": "#00aaff", "tab.unfocusedActiveBorder": "#000000", "tab.activeBorderTop": "#00aaff" // Active Tab Top Highlighting }} 2) black tab headers with red activeBorder and activeBorderTop "workbench.colorCustomizations": { "tab.activeBackground": "#11ff001a", "tab.activeBorder": "#ff0000", "tab.unfocusedActiveBorder": "#000000", "tab.activeBorderTop": "#ff0000" // Active Tab Top Highlighting } VSCode for Delphi Programming Here’s Embarcadero’s page on setting up DelphiLSP with Visual Studio Code https://docwiki.embarcadero.com/RADStudio/Athens/en/Using_DelphiLSP_Code_Insight_with_Other_Editors Generation of a .delphilsp.json file from Delphi is controlled through Delphi Options, Editor->Language->Code Insight->Generate LSP Config Type LSP into VSCode settings to to Delphi LSP settings and set the location of the project delphilsp json file Preferences / Settings I don't like the LSP suggestion autocomplete happening when I press enter, for example by default when I type begin and hit enter it replaces it with BeginGlobalLoading To prevent this I leave suggestions on but turn off ENTER as a completion shortcut ( TAB can still be used). Go to settings File > Preferences > Settings > Text Editor > Suggestions > Accept Suggestions On Enter > Select on, off or smart. ("Controls whether suggestions should be accepted on Enter, in addition to Tab [...]" Building via VSCode tasks I suspect creating an extension to build by normal VSCode method would be not difficult to do but haven't had time to investigate. Currently I build using tasks and it's a bit messy but is functional. If you were only building a single DEBUG config using this method it would be simpler as you wouldn’t need to choose the config each time you build or run, we build different configs for different emulations. I was hoping we could somehow easily preselect the emulator config we want to use at the start of a session and then just build/run each time (eg via <shift><ctrl>B) without having to select the config but haven't had time to look into that further. We already had batch files setup for release building done outside of the IDE, ie Crbuild.bat, and use these for building via VSCode. tasks.json needs to go in the .vscode folder, eg if I'm working on the TC7\TC7.dproj project then in TC7\.vscode folder, assuming TC7 is the workspace folder you have open. <shit><ctrl>B will build or you can choose to run your desired task from Tasks: Run Task Sample tasks.json from our wiki /* Tasks definitions for compiling and running TC7 in VS Code. You can use this file for .vscode/tasks.json file in a workspace, or as "User level tasks" (indepedent of workspace). This tasks file allows to compile /run / compile+run the TC7 project using Wrist Bevel Emulator associated with the currently open file. Need to look at how to handle building using different emulators. One option could be to open a file in the emulator folder and then use ${fileDirname}, can set cwd using the following "cwd": "${fileDirname}" See https://go.microsoft.com/fwlink/?LinkId=733558 for the documentation about the tasks.json format. */ { "version": "2.0.0", "inputs": [ { "id": "emulatorFolder", "type": "pickString", "description": "Select the emulator folder", "options": [ "RELEASE", "DEBUG", "abs encoded 12 magnet twin sled PUG", "700 Towers", "725 K4100 wrist bevel", "wrist bevel x86", "K5100 wrist bevel and unloader" ], "default": "K5100 wrist bevel and unloader" } ], "tasks": [ // Compile and then Run the TC7 project of the currently open editor file. // This is like F9 in Delphi. { "label": "(TC7) Compile And Run", /* We use VS code "dependsOn" feature to run 2 tasks in a sequence. This is better than using shell command with && which is not universally supported by PowerShell. */ "dependsOn": [ "(TC7) Compile", "(TC7) Run" ], "dependsOrder": "sequence", "group": { "kind": "build", } }, // (Re)build the TC7 project { "label": "(TC7) (Re)Build", "type": "shell", /* Compile in debug mode using TC7 build tool (calls msbuild under the hood). */ "command": "${workspaceFolder}\\crbuild.bat", "args": [ "-ProductVersion", "23.0", // "-config", "DEBUG", "-config", "${input:emulatorFolder}", "-nolog", "-target", "rebuild" // "-OutDir", "${workspaceFolder}\\Output\\EMUs\\${input:emulatorFolder}" ], "options": { "cwd": "${workspaceFolder}" // "cwd": "${workspaceFolder}/Output/EMUs/${input:emulatorFolder}" }, "group": { "kind": "build", "isDefault": false }, "problemMatcher": { "fileLocation": "autoDetect", //["autoDetect", "${workspaceFolder}"], "pattern": [ { /* Match lines like xxx.pas(123,456) Fatal: some message Deliberately avoid matching summary line like xxx.pas(2201) Fatal: There were 26 errors compiling module, stopping Deliberately avoid xxx.pas(648,15) Error: Found declaration: ... because they only make sense when connected to previous error message, and VS Code reorders them. Test: https://regex101.com/ (ECMAScript flavor) */ "regexp": "^([^\\(]+)\\(([\\d+,]+)\\)\\s+(Fatal|Warning|Error|Note|Hint):\\s+((?!\\(10026\\) There were)(?!There were)(?!Found declaration: )(?!\\(5088\\)Found declaration: ).*)$", "file": 1, // location may be line or line+column. "location": 2, "severity": 3, "message": 4 } /* , { // Match lines like // Compiling xxx.pas "regexp": "^(Compiling) ([^\\s]+)$", "file": 2, "message": 1, "kind": "file" } */ ], /* We need non-empty owner to hide older problems on recompilation. See https://github.com/Microsoft/vscode/issues/50448, https://github.com/microsoft/vscode/issues/66982 */ "owner": "Kinetic Engineering" } }, // Compile the TC7 project { "label": "(TC7) Compile", "type": "shell", /* Compile in debug mode using TC7 build tool (calls msbuild under the hood). */ "command": "${workspaceFolder}\\crbuild.bat", "args": [ "-ProductVersion", "23.0", // "-config", "DEBUG", "-config", "${input:emulatorFolder}", "-nolog", "-target", "build" // "-OutDir", "${workspaceFolder}\\Output\\EMUs\\${input:emulatorFolder}" ], "options": { "cwd": "${workspaceFolder}" // "cwd": "${workspaceFolder}/Output/EMUs/${input:emulatorFolder}" }, "group": { "kind": "build", "isDefault": true }, "problemMatcher": { "fileLocation": "autoDetect", //["autoDetect", "${workspaceFolder}"], "pattern": [ { /* Match lines like xxx.pas(123,456) Fatal: some message Deliberately avoid matching summary line like xxx.pas(2201) Fatal: There were 26 errors compiling module, stopping Deliberately avoid xxx.pas(648,15) Error: Found declaration: ... because they only make sense when connected to previous error message, and VS Code reorders them. Test: https://regex101.com/ (ECMAScript flavor) */ "regexp": "^([^\\(]+)\\(([\\d+,]+)\\)\\s+(Fatal|Warning|Error|Note|Hint):\\s+((?!\\(10026\\) There were)(?!There were)(?!Found declaration: )(?!\\(5088\\)Found declaration: ).*)$", "file": 1, // location may be line or line+column. "location": 2, "severity": 3, "message": 4 } /* , { // Match lines like // Compiling xxx.pas "regexp": "^(Compiling) ([^\\s]+)$", "file": 2, "message": 1, "kind": "file" } */ ], /* We need non-empty owner to hide older problems on recompilation. See https://github.com/Microsoft/vscode/issues/50448, https://github.com/microsoft/vscode/issues/66982 */ "owner": "Kinetic Engineering" } }, // Run the previously compiled TC7 project. // This is like <ctrl><shift><F9> in Delphi IDE. { "label": "(TC7) Run", "type": "shell", "command": "./TC7.exe", "args": [ "/no_scale", "/t:0", "/l:105", "/portrait", "/no_polling_err", "/moveable_display", "/web_debug:..\\Web\\Resources\\" ], "options": { "cwd": "${workspaceFolder}/Output/EMUs/${input:emulatorFolder}" }, "group": { "kind": "build" } } ] } A sample crbuild.bat is as follows @echo off set BUILD_TARGET_TYPE="rebuild" set BUILD_CONFIG=Release set OUTPUT_TO_LOG=Y set OUTPUT_FOLDER_PARAM= rem Set the default Delphi version to compile with, 22.0 => Delphi 11.x, 23.0 => Delphi 12.1 set ProductVersion=22.0 :argsloop IF NOT [%1]==[] ( IF /i [%1]==[-config] ( SET BUILD_CONFIG=%2 shift ) IF /i [%1]==[-ProductVersion] ( SET ProductVersion=%2 shift ) IF /i [%1]==[-Target] ( SET BUILD_TARGET_TYPE=%2 shift ) IF /i [%1]==[-nolog] ( SET OUTPUT_TO_LOG=N ) SHIFT GOTO :argsloop ) set BUILD_TYPE=DEBUG set BUILD_CONFIG_UNQUOTED=%BUILD_CONFIG:"=% if /i ["%BUILD_CONFIG_UNQUOTED:~0,7%"]==["RELEASE"] ( set BUILD_TYPE=RELEASE ) set DELPHI_VARS_PATH="C:\Program Files (x86)\Embarcadero\Studio\%ProductVersion%\bin\rsvars.bat" call %DELPHI_VARS_PATH% rem build using msbuild set MSBUILD_CMD=msbuild TC7.dproj /t:%BUILD_TARGET_TYPE% /p:config=%BUILD_CONFIG% echo Running %MSBUILD_CMD% if /i "%OUTPUT_TO_LOG%"=="Y" ( %MSBUILD_CMD% 2>&1>>".\Output\crbuild.log" ) else ( %MSBUILD_CMD% ) Debugging Not working yet, would like to get it working for simple debugging and have only spent a little bit of time on it. Whether it's overly usable for inspecting values/classes etc though will be interesting - but then we have a lot of problems with Delphi debugging inspection etc of things not working. Have tried using lldb setup via the following VSCode launch.json setting file but lldb won't run the exe (eg running lldb from command line). WinDBG will run the exe but have only briefly tried it { "version": "0.2.0", "configurations": [ { "name": "Launch Delphi TC7 L102 Maxphotonics", "type": "lldb", "request": "launch", "program": "${workspaceFolder}/Output/emus/L102 Maxphotonics/TC7.exe", "args": ["/no_scale /t:0 /l:105 /portrait /no_polling_err /moveable_display /web_debug:..\\Web\\Resources\\"], "cwd": "${workspaceFolder}/Output/emus/L102 Maxphotonics", "stopOnEntry": false, "preLaunchTask": "Echo vars" } ] }
  2. Specs: Delphi XE7, VCL, Win7, Python4Delphi v3.8.10 (the last official build for windows 7) In one of my projects that includes P4D, I discovered that I can not debug the code. Note, I am not debugging the Python aspects, just the Delphi code only, such as when you put a breakpoint at the line aString="ABCDEFG", as seen below. Note also, that I am giving a simplified example, (where you see the breakpoint) just to show the issue. Note: this is for any projects that include Python4Delphi. And the final result after pressing F9 (compile with debug). . . And, when I switch to 32-bit target and compile via F9, I get the following different issue: [dcc32 Fatal Error] Demo01.dpr(7): F2048 Bad unit format: 'Unit1.dcu' - Expected version: 28.0, Windows Unicode(x86) Found version: 28.0, Windows Unicode(x64) I do not know how to resolve this. I would like to do some debugging in my P4D projects but can't. Any advice would be greatly appreciated, thanks!
  3. I'm trying to debug shared library loaded by Linux application. I need to attach debugging session to existing process on remote machine. However, ""Run"->"Attach To Process" configuration form is empty for any debuggers except Windows debuggers. Delphi documentation refers that I should select Connection Profile for remote debugger; however, this field is not available I choose Linux 64-Bit debugger, or any other non-Windows debugger in "Attach To Process" configuration form. I use Delphi 11.4 and 12 IDEs both of them have the same behavior. "Attach To Process" configuration from looks like at attached screenshot. Does anyone have experience with experience with attaching to the Linux process debugging in Delphi/RAD Studio IDE?
  4. Hello, Under Windows 11, Delphi (Seattle, Rio, ...) Each "Step over" of a 32 bit app. (VCL and/or console) triggers a full redraw of the "Local variables" on the IDE. And of course, the more the list is important the more the repaint is "painful"... Any ideas how to avoid this ? thanks for you help
  5. VishalTanwar

    Delphi Debugging Help

    Hi All, I am new to learn Delphi technology. I am using Delphi 7 application. Can anyone help me regarding learning part. from where I need to start and what things i need to see. I got the basic details from the internet but still I am struggling for debugging part. If anyone can help, please let me know. Thank You
  6. Hi, An hour ago I've tried out CnPack's "Bug reporter" IDE enhancement. It did not go well, after I've clicked "send Email". (Lot's of AV errors, ca 100 / sec while tried to close Delphi 7.) Since than: If I click the green |> arrow or [F9] to start debugging >> it compiles the EXE fine, than starts the EXE normally! (without attaching the debugger process.) Tried to: - restart PC - disable some CnPack modules But nothing helps 😞 - Where is the Delphi "error LOG file"?
  7. Perpeto

    --solved--

    Nevermind.. solved the issue.. !
  8. Setup is delphi 10.4.2 - xcode 13 - sdk 15 I was finaly able to get instruments to work on my IOS app. (Had to build using developer cert and profile not adHoc) Where I run my app, with Leaks this is what I see for a short timestamp. My question is are all these leaks? How do I relate this to my code? In several cases, the program is just sitting on a screen waiting for user input, but the leak list keep growing. There are no timers in my program. Leaked Object Count Address Size Responsible Library Responsible Frame Malloc 96 Bytes 1 0x285eeaca0 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285f16460 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eeaee0 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eed5c0 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 3 < multiple > 288 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285f164c0 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285f67360 96 Bytes CodeRouteTest 0x100f1221c Malloc 80 Bytes 1 0x281d28500 80 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285f161c0 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 2 < multiple > 192 Bytes CodeRouteTest 0x100f1221c IFMXTextPosition 1 0x2839d6290 16 Bytes CodeRouteTest 0x10104de08 Malloc 96 Bytes 1 0x285f16b80 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285ee8ea0 96 Bytes CodeRouteTest 0x100f1221c IFMXTextPosition 1 0x2839d5c90 16 Bytes CodeRouteTest 0x10104de08 Malloc 96 Bytes 1 0x285f16580 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285ee94a0 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eeba20 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eeb000 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eef420 96 Bytes CodeRouteTest 0x100f1221c IFMXTextRange 1 0x2839d5170 16 Bytes CodeRouteTest 0x10104de08 Malloc 96 Bytes 1 0x285f66460 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eec420 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 2 < multiple > 192 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285ee9020 96 Bytes CodeRouteTest 0x100f1221c Malloc 80 Bytes 1 0x281d284b0 80 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285ee8a80 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eead00 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285ee2340 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eed680 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285eead60 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285f163a0 96 Bytes CodeRouteTest 0x100f1221c Malloc 96 Bytes 1 0x285f16ac0 96 Bytes CodeRouteTest 0x100f1221c UICTFontDescriptor 1 0x285f17ae0 96 Bytes UIFoundation -[UIFontDescriptor _swapWithFontAttributes:options:] UICTFontDescriptor 1 0x285ee5200 96 Bytes UIFoundation -[UIFontDescriptor _swapWithFontAttributes:options:] Malloc 80 Bytes 1 0x281d280f0 80 Bytes CodeRouteTest 0x100f1221c
  9. Hello to the community. I'm experiencing a problem with Delphi 10.3 Community. I'm studying a project and for some reason, the usual F4 function (run at cursor) is not working. This is not a project written by me, and I thin k that it is because it is in some "release" state, but I have also deleted the release status configuration from the project options, but it insists on this strange behavior. Also, the breakpoints seem not working. I'm quite new to Delphi. Is there anyone who can give me a clue on what to do the make F4 and the usual functions work ? Thanks for any help.
  10. Hallo to all, since 10.4 (and 10.4.1) debugging c++ DLL for x64 Windows S.O. is impossible (for me of course). ALL THE PROJECTS ARE COMPILED FOR X64. If I launch standard debug from Delphi project, the DLL source code (made in c++) is ignored and no breakpoints are used in the DLL. If I launch LLDB debug from c++ DLL (setting the correct host of course), an error like this is generated and the app doesn't start. If you launch the app with or without Delphi debugger all is working. Same situation with remote debugger (via "old style debugger" or paserver). Before LLVM all is working and i can debug DLL c++ code. I miss something or do something wrong ? Attached is a very simple project group to test. Thanks for your attention. Test.zip
  11. Hello all, when I deploy a FMX application to Ubuntu (in this case the "Screenshot" fmx demo) the Delphi 10.4 debugger hangs totally. My Windows and Linux machines are both VMWare VM's. I can see that the freshly compiled executable appears in the home/PAServer/scratch-dir/myname/Screenshot directory. The message log in the Delphi IDE gives a warning "Local file \Redist\libfmux.so not found. Skipping deployment." The executable is not started on the Linux system by PAServer. I am able to start the executable manually, so the executable itself must be OK. But Delphi hangs so thoroughly that I can't debug it. I can only terminate Delphi in the task manager. Am I doing something wrong?
  12. sjordi

    10.3/10.4 Debug iOS?

    Hi, Just tried to debug an iOS app from within the IDE but when launched on the iPhone, all breakpoints are marked as invalid and the app doesn't stop on any of them. Even an empty app with a breakpoint in FormCreate doesn't work.The Events window says Module Load: dyld. No Debug Info. Base Address: $0000000104D8C000. Process Project1 (1774) Module Load: Project1. Has Debug Info. Base Address: $0000000102D34000. Process Project1 (1774) No Debug Info for dyld... Am I missing something? Thanks for any clue. (I'm in Debug mode of course, not Release) Xcode 11.5 and iOS SDK 13.5
  13. Today was my first attempt to actually use these, but that ended once I placed a Breakpoint on one. Perhaps not news to others.. program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; {$INLINE OFF} function NewBytes:TBytes; begin SetLength(Result, 10); end; begin try /// <summary> /// F9 from the Breakpoint will repeat 3 times, once for each Inline Variable /// Uncomment the others to prove my point /// </summary> /// <remarks> /// You can also try F7 or F8 /// </remarks> var Eins := NewBytes; // << Breakpoint var Zwei := NewBytes; var Drei := NewBytes; // var NochEins := NewBytes; // var NochZwei := NewBytes; // var NochDrei := NewBytes; writeln('Something Happened!'); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end.
×