Jump to content


Popular Content

Showing content with the highest reputation since 04/07/21 in all areas

  1. Anders Melander

    Documentation creation tool

    A guess :
  2. Anders Melander

    MAP2PDB - Profiling with VTune

    New version (2.5) uploaded. Changes since last upload: Include/exclude modules/units from pdb. This helps keep the size of the pdb down and thus reduces the symbol resolve time in VTune. You no longer need to link your projects with debug info. map2pdb will reuse the existing debug section in the exe/dll/bpl if there is one. Otherwise it will create a new one. https://bitbucket.org/anders_melander/map2pdb/downloads/ What's next: Refactoring of the logging code. The current logging is basically just some functions that calls WriteLn. This should be replaced with a pluggable log framework so the whole logging mechanism can be replaced. The end goal is to enable integration of the map2pdb core into other projects. A jdbg reader. Embarcadero does not supply map files for the RTL/VCL rune time packages. Instead they ship jdbg files that can be read with the JEDI debug functions. The jdbg are built from map files so supposedly they contains much, if not all, of the information we need. The task here is to write a reader for the jdbg file format so we can produce pdb files from them. Figure out why VTune is so slow. A never ending task it seems.
  3. Anders Melander

    MAP2PDB - Profiling with VTune

    It turned out that the culprit was the version of msdia140.dll that came bundled with the version of VTune I'm using. There's a bug in it that causes exponential slowdown on large pdb's. Replacing the dll with a new version fixed the problem. The symbol resolve time of my test project fell from hours/days to ~10 minutes. The old msdia140.dll was version 14.10.25017.0, the new is 14.28.29913.0. Any version from VS2019 or later should do AFAIK. A side effect of trying to solve this performance problem was that I added segment/section filters. You can now specify what segments to include/exclude from the pdb. For example since almost all code is in segment 0001 you can exclude all modules and symbols that reside in other segments. This can cause a significant reduction in the size of the pdb. Try this: map2pdb -v -include:0001 foobar.map or try with the -debug switch to get all the details. I'm considering just adding this 0001 filter as a default. I've uploaded a new version (2.6) with all the latest changes (there aren't that many): https://bitbucket.org/anders_melander/map2pdb/downloads/ Also the repository finally has a readme.md
  4. The complete VCL package includes more than 750 VCL components including popular packages like LMD DockingPack, GridPack or LMD DialogPack (available for Delphi/C++Builder XE2 and better). Major changes in this release are full rework of core and common packages (made possible by supporting XE2 or better only); better support of newer VCL features (TVirtualImageList DPI scaling support, 32bit glyph support); new controls like TLMDFontImageList with auto dpi support; further improved high dpi and multimonitor support (e.g. DockingPack); many fixes and enhancements based on customer feedback; unified installers for NG and LMD products; new democenter and extensive updates for demo projects (e.g. overworked DB demos); extensive update for NG ConnectionPack (supporting many more Google services). Read the news announcement or find summary of all changes in LMD 2021 release on What's New Page. Check the new trials and compiled Exe-Demos at https://www.lmd.de/downloads All exe-demos were recompiled and digitally signed, for example the LMD DockingPack /AnyLogger or new DemoCenter demos. Feature Matrix of all LMD VCL products: https://www.lmd.de/feature-matrix If you are interested in purchasing check out the order Page: https://www.lmd.de/shopping If any questions are left, please contact us at mail@lmdsupport.com!
  5. UPDATE: I can confirm that Delphi 10.4.2 installs, builds and runs on a Mac M1 with a Parallels Desktop VM of WIndows 10 ARM (insider build). I successfully installed all my components (TMS, JVE, custom), build and ran both VCL (win32) and FMX (win32, MacOS64, Android32/64 and iOS64) perfectly. I'm going to keep using it for a while but if all goes well, this is a great solution and so much faster than my older Intel Macbook
  6. Anders Melander

    MAP2PDB - Profiling with VTune

    It took me a bit longer than expected to get here but I believe I've finally reached the goal. The following shows VTune profiling a Delphi application, with symbol, line number and source code resolution: Download Get the source here: https://bitbucket.org/anders_melander/map2pdb/ And a precompiled exe here: https://bitbucket.org/anders_melander/map2pdb/downloads/ The source has only been tested with Delphi 10.3 - uses inline vars so it will not compile with older versions. Usage map2pdb - Copyright (c) 2021 Anders Melander Version 2.0 Parses the map file produced by Delphi and writes a PDB file. Usage: map2pdb [options] <map-filename> Options: -v Verbose output -pdb[:<output-filename>] Writes a PDB (default) -yaml[:<output-filename>] Writes an YAML file that can be used with llvm-pdbutil -bind[:<exe-filename>] Patches a Delphi compiled exe file to include a reference to the pdb file -test Works on test data. Ignores the input file Example: Configure your project linker options to output a Detailed map file. Compile the project. Execute map2pdb <map-filename> -bind Profile the application with VTune (or whatever) Known issues The -bind switch must occur after the filename contrary to the usage instructions. PDB files larger than 16Mb are not valid. This is currently by design. 64-bit PE files are not yet supported by the -bind option. As should be evident I decided not to go the DWARF route after all. After using a few days to read the DWARF specification and examine the FPC source I decided that it would be easier to leverage the PDB knowledge I had already acquired. Not that this has been easy. Even though I've been able to use the LLVM PDB implementation and Microsoft's PDB source as a reference LLVM's implementation is incomplete and buggy and the LLVM source is "modern C++" which means that it's close to unreadable in places. Microsoft's source, while written in clean C and guaranteed to be correct, doesn't compile and is poorly commented. Luckily it was nothing a few all-nighters with a disassembler and a hex editor couldn't solve. Enjoy!
  7. Dalija Prasnikar

    Delphi 10.4.2 Professional

    As long as we have power, all is good
  8. Anders Melander

    Delphi 10.4.2 Professional

    How does a transparent case and fans with LED lighting help with that?
  9. Anders Melander

    MAP2PDB - Profiling with VTune

    New version with @Stefan Glienke's improvements uploaded. https://bitbucket.org/anders_melander/map2pdb/downloads/ Notable changes: VTune now attributes samples to the correct source lines within a block. Removing RTTI from the exe has reduced the size by 15%. The pdb is now being built in a temporary memory stream which is significantly faster due to reduced I/O.
  10. Hello I have created some graphic components to display data like gauges thermometer and so... You will have all the explanations HERE the explanations are in French but you can easily translate in English with google translation. Some preview
  11. David Heffernan

    Bug in Android32 compiler

    Not a bug. All comparison operators return false when one of the arguments is NaN. https://stackoverflow.com/questions/1565164/what-is-the-rationale-for-all-comparisons-returning-false-for-ieee754-nan-values Also, bug reports are best at Quality Portal. Although not this one, because it's not a bug.
  12. try var LURI := TURI.Create(AURI); Result := True; except Result := False; end;
  13. Carlo Barazzetta

    A BIG and very strange BUG with High-DPI, VCL Style and Form Constraints

    I've created the BUG report: https://quality.embarcadero.com/browse/RSP-33760 Please vote for it. bye Carlo
  14. TigerLilly

    compiling DCU without creating EXE

    If the DPR had a syntax error in the last line, wouldn´t do this the trick?
  15. Bill Meyer

    Delphi 10.4.2 Professional

    https://www.clickykeyboards.com Has new and restored IBM keyboards from 25-30 years ago.
  16. Not quite. WebAssembly (WASM in short) is a binary executable format supported by all major browsers. See WebAssembly. Various compilers of different programming languages produce WASM code. Fpc is already moving ahead with support for Webassembly target. See WebAssembly/Roadmap - Lazarus wiki (freepascal.org). Overall WebAssembly is an alternative to compilation to JS. .Net has already a WASM target they call Blazor.
  17. Fr0sT.Brutal

    StockSharp, anybody worked with this?

    Of course absolutely no. Evil Russian hackers will drain all of your bitcoins in seconds just between faking US votes and drinking vodka with their bears
  18. Stefan Glienke

    Display Componant like Gauges Led and Graphic for Delphi FMX

    This: This means it will be basically useless for commercial projects.
  19. Tom Chamberlain

    Transforming Data (Pivot ?)

    Create/load a TClientDataSet (or TFDMemTable) on the fly every time the user picks a different DataSet by reading the distinct Settings values within the DataSet and creating columns for each Setting (replace spaces with underscores or something) and if you know the data type of the Setting even better. Then load the data by reading the DataSet and dropping the data into the correct column by the Setting name, when the Instance changes start a new record in the TClientDataSet, repeat. Then you can display the data any way you would like. You could do the same thing with a couple of dynamic arrays, one to hold the columns and another to hold the data if you don't need to know the data type in each column.
  20. David Heffernan

    Issues with Sleep(1) called in a loop

    Answer can be found in the documentation of Sleep. Sleep can only wait for multiples of system ticks. And your system appears to tick at a frequency of 15ms. Which is typical, that being the default tick frequency. There are many many discussions of this online. Here's one: https://stackoverflow.com/questions/3744032/why-are-net-timers-limited-to-15-ms-resolution
  21. Unfortunately inline vars are not always equivalent to "with". I'm currently working on a project that has, um.. let's be polite and say, "liberal" use of record arrays. So for example: type TFoo = record // Lots of stuff here end; TBar = record Foo: array of TFoo; // Even more stuff end; TFooBar = array of TBar; var FooBar: TFooBar; begin with FooBar[i].Foo[j] do WhatEver := 42; var Foo := FooBar[i].Foo[j]; Foo.WhatEver := 42; // Nope. end; Using an inline var to access an inner record will create a copy of the record while using "with" will use a reference to the record. Only way around that is to use record pointers but the code is horrible enough as it is.
  22. Stefan Glienke

    SetLength TBytes Memory Leak

    @Remy Lebeau The LStrFromPWCharLen entry indeed looks wrong - but the lines before and after that exactly match with the 10.3.3 code - I just checked. Maybe it's just a glitch in the stack walking code done by FastMM_FullDebugMode.dll Edit: Yep - I can repro the wrong entry in the call stack with this code: uses FastMM5, System.SysUtils; var x: TBytes; s: string; r: RawByteString; begin s := 'test'; r := RawByteString(s); SetLength(x, 10); Pointer(x) := nil; ReportMemoryLeaksOnShutdown := True; end. and get this report: This block was allocated by thread 0x432C, and the stack trace (return addresses) at the time was: 004128BA [FastMM5.pas][FastMM5][FastMM_DebugGetMem$qqri][7717] 0040476D [System.pas][System][@ReallocMem$qqrrpvi][5022] 00408181 [System.pas][System][DynArraySetLength$qqrrpvpvipi][36046] 00406E08 [System.pas][System][@LStrFromPWCharLen$qqrr27System.%AnsiStringT$us$i0$%pbius][26213] <-- ?!?! 004082C2 [System.pas][System][@DynArraySetLength$qqrv][36150] 004265D9 7732FA29 [BaseThreadInitThunk] 77E87C7E [RtlGetAppContainerNamedObjectPath] 77E87C4E [RtlGetAppContainerNamedObjectPath] My guess would be that the: PUSH ESP ADD dword ptr [ESP],4 in _DynArraySetLength is not properly handled by the stack walking code. Obviously, a defect in JclDebug LogStackTrace in FastMM_FullDebugMode.dpr - compiling FastMM_FullDebugMode.dll with madExcept gives this call stack as it just passes to madStackTrace.FastMM_LogStackTrace which seems to do a better job: 004128b5 +015 Project53.exe FastMM5 7717 +4 FastMM_DebugGetMem 00404767 +03f Project53.exe System 5022 +91 @ReallocMem 0040817c +16c Project53.exe System 36046 +70 DynArraySetLength 004082bd +005 Project53.exe System 36150 +3 @DynArraySetLength 7732fa27 +017 KERNEL32.DLL BaseThreadInitThunk Probably the bug is in GetRawStackTrace and madExcept is just able to fix it - I am not entirely sure - as far as I can see there is no method in JclDebug that can build a call stack from the data that FastMM_FullDebugMode GetRawStackTrace collects - that is why LogStackTrace simply iterates the entries and calls GetLocationInfo on each of them and just concats them. @Pierre le Riche fyi
  23. Uwe Raabe

    "Add Method" (Ctrl+Alt+M) wrongly assigned to TForm

    Adding a layer of action to achieve a goal is probably not well accepted by long time MMX users as it would break their work flow. Even if such functionality would exist, which class should the method be added when DoIt is not declared in TMyObject, but in TMyBaseObject, which TMyObject is derived from? Instead of asking for the target object each time, it is much simpler to Ctrl-Click on the TMyObject reference or even the DoIt reference in the code, which immediately selects the requested object on which the Add Method action then can be executed on.
  24. Lajos Juhász


    Well they're in the process to make a unique web experience. It will take maybe another 10-15 years. When finished it will be the greatest. I just hope that it will be more static. I wonder who thinks that those sliding topics at https://blogs.embarcadero.com/ is useful! It slides out before you could click. What's wrong with the traditional sites where you can see the links and click on them? (I know most probably they bought this technology and must showcase it everywhere, I will just visit the site only when it is necessary.)
  25. Anders Melander

    MAP2PDB - Profiling with VTune

    Fixed the problem where some symbols (in particular generics) either resolved to the calling unit or to a wrong line number in the implementing unit. Thanks to @Stefan Glienke for pestering me about this until it got solved. Source committed and binary uploaded. And now... Pizza! 🍕