Jump to content

Vincent Parrett

Members
  • Content Count

    329
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by Vincent Parrett

  1. Vincent Parrett

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

    So today I took a copy of the TFormStyleHook (a bit of work due to use of protected methods on TCustomForm) and registered for my form class and started adding some outputdebug strings. (BTW, it's staggering how much code there is (with many corner cases) in the stylehook! This is what happens when restoring after minimizing on monitor 0 (the non primary monitor) TVSoftFormStyleHook.WMWindowPosChanging x : 0 y 0 w : 0 h : 0 flags[ SWP_NOMOVE + SWP_NOSIZE ] Form Bounds: Left: 3803 Top: 499 Width: 1302 Height: 675 TVSoftFormStyleHook.WMWindowPosChanging x : 2549 y -11 w : 3862 h : 2182 flags[ SWP_NOCOPYBITS + SWP_FRAMECHANGED ] Form Bounds: Left: 3803 Top: 499 Width: 1302 Height: 675 TVSoftFormStyleHook.WMWindowPosChanging x : 0 y 0 w : 0 h : 0 flags[ SWP_FRAMECHANGED + SWP_NOACTIVATE + SWP_NOZORDER + SWP_NOMOVE + SWP_NOSIZE ] Form Bounds: Left: 3803 Top: 499 Width: 1302 Height: 675 TVSoftFormStyleHook.WMWindowPosChanging : Applying FRestoringContraints TVSoftFormStyleHook.WMWindowPosChanging x : 0 y 0 w : 1302 h : 675 flags[ SWP_NOACTIVATE + SWP_NOZORDER + SWP_NOMOVE ] Form Bounds: Left: 3803 Top: 499 Width: 1302 Height: 675 SetBounds: Left: -32000 Top: -32000 Width: 1302 Height: 675 TVSoftFormStyleHook.WMWindowPosChanging x : -29440 y -32000 w : 0 h : 0 flags[ SWP_NOACTIVATE + SWP_NOZORDER + SWP_NOSIZE ] Form Bounds: Left: -32000 Top: -32000 Width: 1302 Height: 675 FormAfterMonitorDpiChanged : OldDpi : 144 NewDPI : 96 TVSoftFormStyleHook.WMWindowPosChanging x : 0 y 0 w : 0 h : 0 flags[ SWP_FRAMECHANGED + SWP_NOACTIVATE + SWP_NOZORDER + SWP_NOMOVE + SWP_NOSIZE ] Form Bounds: Left: -29440 Top: -32000 Width: 1302 Height: 675 TVSoftFormStyleHook.WMWindowPosChanging x : 0 y 0 w : 0 h : 0 flags[ SWP_NOMOVE + SWP_NOSIZE ] Form Bounds: Left: 2552 Top: -8 Width: 3856 Height: 2116 As you can see it is called at least once with co-ordinates that are on the other monitor (monitor 1) - which is why the errant WM_DPICHANGED is fired!! I tried to decode the flags as well I commented out this line in TVSoftFormStyleHook.WMWindowPosChanging and that seems to solve it, however we then no longer have any constraints. Form.Constraints := FRestoringConstraints; So while I can see what is happening, I haven't quite figured out why - it seems like the constraints are somehow lost when minimizing, however resetting them in WMWindowPosChanging is causing windows to believe the window has changed monitors. What a mess.
  2. Vincent Parrett

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

    Last one before I give up on this for today. It seems to be caused by TFormStyleHook.WMWindowPosChanging calling Form.Constraints := FRestoringConstraints; - this causes a flurry of calls to SetBounds - proving difficult to debug, but at some point the incorrect bounds are set and windows then fires off the dpi changed message -while debugging I saw the window jump and then the dpi change message fired.
  3. Vincent Parrett

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

    I'm getting nowhere with this - something is causing windows to send WM_DPICHANGED when restoring the window - according to the documentation for WM_DPICHANGED the message is sent when The window is moved to a new monitor that has a different DPI. The DPI of the monitor hosting the window changes. We are definitely not changing the dpi of any monitors, so that suggests that windows thinks the window has changed monitors. I've been looking though the vcl source but cannot see where that is happening. Since this only happens with vcl themes enabled I think it's safe to say this is probably not a windows bug. @Carlo Barazzetta did you report this yet? If so post the number here so we can vote for it. Hopefully we can find a workaround for this because I guarantee I will have customers reporting this as an issue with my software otherwise.
  4. Vincent Parrett

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

    More info If I change my debug output to do this monitor := Screen.MonitorFromPoint(Self.BoundsRect.CenterPoint);// MonitorFromWindow(Self.Handle); Memo1.Lines.Add('Current Monitor : ' + IntToStr(monitor.MonitorNum)); It always give the correct monitor. Current Monitor : 1 Windows Bounds (Top,Left,Bottom,Right) : -8,-8,1408,2568 Current Monitor : 0 Windows Bounds (Top,Left,Bottom,Right) : -11,2549,2111,6411 Those top/left values on monitor 0 looked odd, so I turned off themes Current Monitor : 1 Windows Bounds (Top,Left,Bottom,Right) : -8,-8,1408,2568 Current Monitor : 0 Windows Bounds (Top,Left,Bottom,Right) : -11,2549,2111,6411 So that's not it, some googling found this is explained here - https://devblogs.microsoft.com/oldnewthing/20120326-00/?p=8003 So I'm no closer to figuring this out.
  5. Vincent Parrett

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

    So I added some debugging info to see what is going on, iterating the screen.monitors collection procedure TForm3.ListMonitors; var i : integer; monitor : TMonitor; begin Memo1.Lines.Clear; for i := 0 to Screen.MonitorCount -1 do begin monitor := Screen.Monitors[i]; Memo1.Lines.Add('Monitor idx : ' + IntTostr(i)); Memo1.Lines.Add('Monitor num : ' + IntTostr(monitor.MonitorNum)); Memo1.Lines.Add('Monitor primary : ' + BoolToStr(monitor.Primary,true)); Memo1.Lines.Add('Monitor ppi : ' + IntToStr(monitor.PixelsPerInch)); Memo1.Lines.Add('Monitor size (Top,Left,Width,Height) : ' + IntToStr(monitor.Top) + ',' + IntToStr(monitor.Left) + ',' + IntToStr(monitor.Width) + ',' + IntToStr(monitor.Height)); end; Memo1.Lines.Add(''); monitor := Screen.MonitorFromWindow(Self.Handle); Memo1.Lines.Add('Current Monitor : ' + IntToStr(monitor.MonitorNum)); end; My primary monitor is 1 (96dpi) which is to the left of 0 (144 dpi) - this is after moving the window to monitor 0 (the one on the right). Monitor idx : 0 Monitor num : 0 Monitor primary : False Monitor ppi : 144 Monitor size (Top,Left,Width,Height) : 0,2560,3840,2160 Monitor idx : 1 Monitor num : 1 Monitor primary : True Monitor ppi : 96 Monitor size (Top,Left,Width,Height) : 0,0,2560,1440 Current Monitor : 0 After minimizing and restoring (so still on monitor 0) Monitor idx : 0 Monitor num : 0 Monitor primary : False Monitor ppi : 144 Monitor size (Top,Left,Width,Height) : 0,2560,3840,2160 Monitor idx : 1 Monitor num : 1 Monitor primary : True Monitor ppi : 96 Monitor size (Top,Left,Width,Height) : 0,0,2560,1440 Current Monitor : 1 Clearly Screen.MonitorFromHandle is returning the incorrect monitor - I suspect this is the cause of the issues I'm seeing with menus too. Looking at the code behind MonitorFromHandle I can't see what the problem is, I suspect this may be a windows bug?
  6. Vincent Parrett

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

    Ok I can now reproduce this here after reading the above, when I tried it before I didn't move it to monitor 1 (2 is my primary). Even worse, when minimizing it the second or third time, it jumps over to the other monitors task bar, but restores to the correct monitor. Something is very broken with monitor detection. I'm seeing a similar issue with menus and vcl styles when moving between monitors - depending on which monitor a menu is first used on it will either be displayed too small or too large - it seems like it's finding the wrong monitor to get the dpi. I've been trying to debug this for days but it's very difficult to debug since that seems to impact on the behaviour.
  7. Vincent Parrett

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

    I couldn't reproduce this here, although my second monitor shows as 144 dpi (4k at 150%).
  8. Vincent Parrett

    MAP2PDB - Profiling with VTune

    Use the web installer, you can then choose which parts to install.
  9. Vincent Parrett

    MAP2PDB - Profiling with VTune

    With @Stefan Glienke changes merged it's blazingly fastπŸ‘. I added a postbuild event to every project in my project group (131 projects) and barely notice it running now! This is what I have for the postbuild event %MAP2PDB% $(OUTPUTDIR)\$(OUTPUTNAME).map -bind:$(OUTPUTDIR)\$(OUTPUTFILENAME) Note that I did needed the outputfilename part for the bind option as it only looks for exe (so for bpl, dll you need it). I created an environment variable for the path to map2pdb to avoid hard coding the path in my dproj files. Sadly if you use libsuffix anywhere you need to manually add that in to the map file arg as $(OUTPUTNAME) doesn't include it, and there isn't a macro for it.
  10. Vincent Parrett

    I will be less active for a few weeks

    That might be so, but you probably have a bunch of covid in the community too.. I'll stay down under where it's under control at the moment πŸ˜‰
  11. Vincent Parrett

    I will be less active for a few weeks

    Bugger, sorry to hear that, hope you are well on the mend! We've been extremely fortunate here and haven't had a community transmission case for quite some time (at least where I live). Being an island and closing the borders helped immensely. The vaccine rollout is very slow, I can't get it till end of May last I heard (lack of supply).
  12. Vincent Parrett

    Decrease Your Build Time

    Using precompiled dcu's is common sense really.. imagine if you had to build the rtl/vcl/fmx every time you build your application⏲️ In the dpm package manager I'm, working on, it compiles the packages/library when the library is installed (assuming its designed to do that) - so the first time you install the package it takes a bit longer, but then builds are a lot faster.
  13. Vincent Parrett

    List of usable RegEx for source code

    As the old saying goes, used regex to solve a problem? now you have two problems! 🀣 That said, I use regex extensively both in Delphi (I wrote the original System.RegularExpressions code) and .Net (keep it simple, and it's not for parsing html!) - but using it to find problems with my code? ah nope, for that I use Eyeballs 1.0 and static analysis tools like FixInsight and Pascal Analyzer (yes I know they have their limitations). Plus I guess I have learned a few things over the years that I apply in new code I write. As for the old code, well refactoring is a work in progress. Yesterday I rewrote a lexer/parser framework I initially wrote 10 years ago due to performance issues, and that issue was identified through profiling (see the thread on vtune). Switching to records took the memory manager from being a big % to insignificant (ie no longer shows up in the profiler). I thought I might get something like a 10% improvement, but was pleasantly surprised to see a 30% improvement! Those sort of gains don't come often in a mature code base.
  14. Vincent Parrett

    MAP2PDB - Profiling with VTune

    I just had my first big win with VTune πŸ˜ƒ I was looking into improving the performance of loading projects in FinalBuilder 9 (in dev) - we have some customers with huge projects that were taking a while to load. Profiling with VTune showed that most of the time was spent in the project lexer/parser - the lexer created class based tokens (and some other associated classes) and a lot of time was spent in the lexer and the memory manager. So 3 hours later, the code has been converted to use records rather than classes - the unit tests all pass (I only had to comment out all the Assert.IsNotNull(token); calls) and the application runs normally (still need to code review to make sure I didn't break things). The result is around a 30% improvement with that change alone! That's just me counting out loud as the project loads πŸ˜‰ - I'll do more formal timing/testing tomorrow. I also just compared to FinalBuilder 8 and the total improvement is more like 60% - I'll put that down to some manual code review looking for possible hotspots over the last week, and also to switching from the rtl generic collections to using spring4d everywhere! Time for some sleep, but looking forward to more VTuning tomorrow. Thanks @Anders Melander again for this amazing bit of work!
  15. Vincent Parrett

    MAP2PDB - Profiling with VTune

    I recreated the dproj file and now it works.. gotta love the mess that is dproj files upgraded through multiple delphi versions πŸ™„
  16. Vincent Parrett

    MAP2PDB - Profiling with VTune

    Weird since the file is definitely being compiled with debug info. I added this to test {$IFOPT D+} Well debug info is turned on so this should not compile {$ENDIF} and it hits the error. I'll investigate further.
  17. Vincent Parrett

    MAP2PDB - Profiling with VTune

    This is an odd one, the package is compiled with debug info etc, but I get this output : :\map2pdb>map2pdb.exe I:\FBAT_HG9\Output\FB9\VSoft.Core.DB.map -bind:I:\FBAT_HG9\Output\FB9\VSoft.Core.DB.bpl -v map2pdb - Copyright (c) 2021 Anders Melander Version 2.0 Constructed a new PDB GUID: {B1FCFCB0-3F09-4207-BB64-0D1D08101C3F} Output filename not specified. Defaulting to VSoft.Core.DB.pdb Reading MAP file - Segments Warning: [ 7] Empty segment: .tls [0005:00000000] Warning: [ 8] Empty segment: .pdata [0006:00400000] - Modules Warning: [ 791] Module exceed segment bounds - ignored: nxllConst [0005:00000000+4] Warning: [ 792] Module exceed segment bounds - ignored: nxllSync [0005:00000004+12] Warning: [ 793] Module exceed segment bounds - ignored: nxllUtils [0005:00000010+8] Warning: [ 794] Module exceed segment bounds - ignored: nxllException [0005:00000018+12] Warning: [ 795] Module exceed segment bounds - ignored: nxllPlatformInterface [0005:00000024+4] Warning: [ 796] Module exceed segment bounds - ignored: nxsdDataDictionary [0005:00000028+4] Warning: [ 797] Module exceed segment bounds - ignored: nxsdServerEngine [0005:0000002C+4] Warning: [ 798] Module exceed segment bounds - ignored: nxsrFileImplWin32 [0005:00000030+8] Warning: [ 799] Module exceed segment bounds - ignored: nxsrTimeoutHandling [0005:00000038+56] Warning: [ 800] Module exceed segment bounds - ignored: nxseHeapEngineCached [0005:00000070+4] Warning: [ 801] Module exceed segment bounds - ignored: nxsrServerEngine [0005:00000074+4] Warning: [ 802] Module exceed segment bounds - ignored: nxllTransport [0005:00000078+4] Warning: [ 803] Module exceed segment bounds - ignored: nxrbCallContext [0005:0000007C+4] Warning: [ 804] Module exceed segment bounds - ignored: nxptBasePooledTransport [0005:00000080+24] Warning: [ 805] Module exceed segment bounds - ignored: nxsqlTableExp [0005:00000098+4] Warning: [ 806] Module exceed segment bounds - ignored: nxsqlCondExp [0005:0000009C+4] Warning: [ 807] Module exceed segment bounds - ignored: nxsqlProxies [0005:000000A0+4] Warning: [ 808] Module exceed segment bounds - ignored: nxdb [0005:000000A4+4] Warning: [ 809] Module exceed segment bounds - ignored: nxllSocket [0005:000000A8+4] - Symbols Warning: [ 2213] Failed to resolve symbol to module: [0005:000000A4] nxdb._nxDefaultSession Warning: [ 3236] Failed to resolve symbol to module: [0005:00000000] nxllConst._CurrentThreadNxVersion Warning: [ 3391] Failed to resolve symbol to module: [0005:00000020] nxllException._CurrentExceptionHookInfo Warning: [ 3395] Failed to resolve symbol to module: [0005:00000018] nxllException._LastError Warning: [ 3396] Failed to resolve symbol to module: [0005:0000001C] nxllException._LastMessage Warning: [ 4052] Failed to resolve symbol to module: [0005:00000024] nxllPlatformInterface.nxIsUIThread Warning: [ 4216] Failed to resolve symbol to module: [0005:000000A8] nxllSocket.SocketErrorProc Warning: [ 4455] Failed to resolve symbol to module: [0005:00000008] nxllSync.nxtv_BreathCallback Warning: [ 4649] Failed to resolve symbol to module: [0005:00000078] nxllTransport.nxitvTransport Warning: [ 4990] Failed to resolve symbol to module: [0005:00000014] nxllUtils._ThreadCodePage Warning: [ 4991] Failed to resolve symbol to module: [0005:00000010] nxllUtils._ThreadLocale Warning: [ 5545] Failed to resolve symbol to module: [0005:00000080] nxptBasePooledTransport.nxitvReplyInfos Warning: [ 5732] Failed to resolve symbol to module: [0005:00000090] nxptBasePooledTransport._Interval Warning: [ 5733] Failed to resolve symbol to module: [0005:00000094] nxptBasePooledTransport._Mask Warning: [ 5734] Failed to resolve symbol to module: [0005:00000088] nxptBasePooledTransport._NetIdle Warning: [ 5757] Failed to resolve symbol to module: [0005:0000007C] nxrbCallContext._CurrentCallContext Warning: [ 7123] Failed to resolve symbol to module: [0005:00000028] nxsdDataDictionary._DontLoadID Warning: [ 9598] Failed to resolve symbol to module: [0005:0000002C] nxsdServerEngine._SessionStatsCurrent Warning: [10232] Failed to resolve symbol to module: [0005:00000070] nxseHeapEngineCached._FindBlockNumber Warning: [12890] Failed to resolve symbol to module: [0005:0000009C] nxsqlCondExp._CurrentlyProcessedContains Warning: [14747] Failed to resolve symbol to module: [0005:000000A0] nxsqlProxies.nxsqlNoProcessingCounter Warning: [16463] Failed to resolve symbol to module: [0005:00000098] nxsqlTableExp._LockUnbindIfRequired Warning: [17204] Failed to resolve symbol to module: [0005:00000030] nxsrFileImplWin32.FileBlocks Warning: [17207] Failed to resolve symbol to module: [0005:00000034] nxsrFileImplWin32.HighestBlock Warning: [18261] Failed to resolve symbol to module: [0005:00000074] nxsrServerEngine._ForRecover Warning: [18471] Failed to resolve symbol to module: [0005:00000038] nxsrTimeoutHandling.nxtv_TimeoutHandling Warning: [18617] Failed to resolve symbol to module: [0005:000000AC] SysInit.TlsLast Warning: [18621] Failed to resolve symbol to module: [0004:FFC91000] SysInit.__ImageBase - Line numbers Constructing PDB file - Collecting source file names - Module streams - Strings stream - PDB Info stream - TPI stream - Symbols stream - DBI stream - IPI stream - Finalizing PDB file Patching PE file - PE32 image (32-bit) Image does not contain a debug directory address - please link with debug info enabled bpl, map and pdb attached. VSoft_Core.DB.zip
  18. Vincent Parrett

    MAP2PDB - Profiling with VTune

    Agree, there is already a few issues asking for pdb support that have lots of votes and have been open for years. @Marco Cantu @David Millington FYI.
  19. Vincent Parrett

    MAP2PDB - Profiling with VTune

    Well that's what happens when you strip the team down to the bare bones and then hire short term contractors, maintaining things becomes a problem when your teams domain knowledge is low. FWIW, 5 minutes in and I already fixed a perf issue in the area that I have been trying to optimise for the last week (replaced a list with a hashset) - a small win but I'll take any win I can get right nowπŸ˜ƒ Pity embarcadero don't ship map files for their bpl's - hmmm will log a qc for that - because as I dig deeper into my perf issues I end up in the weeds in rtl etc with func@xxx a lot.
  20. Vincent Parrett

    MAP2PDB - Profiling with VTune

    It wasn't that, and I probably did forget the bind switch before I sent it to you, however with the new version.... we have lift off! Awesome work! E:\map2pdb>map2pdb.exe I:\FBAT_HG9\Output\FB9\FinalBuilder9.map -v -bind:I:\FBAT_HG9\Output\FB9\FinalBuilder9.exe map2pdb - Copyright (c) 2021 Anders Melander Version 2.0 Constructed a new PDB GUID: {CE1E6D08-67E6-4B5B-B42A-3FC719254F1E} Output filename not specified. Defaulting to FinalBuilder9.pdb Reading MAP file - Segments Warning: [ 8] Empty segment: .pdata [0006:00400000] - Modules - Symbols Warning: [20671] Failed to resolve symbol to module: [0005:00000608] SysInit.TlsLast Warning: [20673] Failed to resolve symbol to module: [0004:FF77A000] SysInit.__ImageBase - Line numbers Warning: [71563] Line number with zero offset ignored. Module:VSoft.IDE.Types, Segment:0001, Source:VSoft.IDE.Types.pas, Line:49 Warning: [71567] Line number with zero offset ignored. Module:VSoft.IDE.Interfaces, Segment:0001, Source:VSoft.IDE.Interfaces.pas, Line:328 Warning: [75481] Line number with zero offset ignored. Module:LMDRTLConst, Segment:0001, Source:LMDRTLConst.pas, Line:213 Warning: [75621] Line number with zero offset ignored. Module:intfLMDBase, Segment:0001, Source:intfLMDBase.pas, Line:44 Warning: [76980] Line number with zero offset ignored. Module:LMDDckCst, Segment:0001, Source:LMDDckCst.pas, Line:29 Warning: [79649] Line number with zero offset ignored. Module:VSoft.IDE.ActionListInterfaces, Segment:0001, Source:VSoft.IDE.ActionListInterfaces.pas, Line:136 Warning: [90056] Line number with zero offset ignored. Module:SynEditStrConst, Segment:0001, Source:SynEditStrConst.pas, Line:577 Warning: [98436] Line number with zero offset ignored. Module:VSoft.IDE.WizardManagerService, Segment:0001, Source:VSoft.IDE.WizardManagerService.pas, Line:61 Warning: [99799] Line number with zero offset ignored. Module:dwTaskbarList, Segment:0001, Source:dwTaskbarList.pas, Line:213 Warning: [103835] Line number with zero offset ignored. Module:RestException, Segment:0001, Source:RestException.pas, Line:26 Warning: [105461] Line number with zero offset ignored. Module:VSoft.Shared.UXLControlIntf, Segment:0001, Source:VSoft.Shared.UXLControlIntf.pas, Line:60 Warning: [107033] Line number with zero offset ignored. Module:VSoft.IDE.MS.ActionCollection.Interfaces, Segment:0001, Source:VSoft.IDE.MS.ActionCollection.Interfaces.pas, Line:1085 Constructing PDB file - Collecting source file names - Module streams - Strings stream - PDB Info stream - TPI stream - Symbols stream - DBI stream - IPI stream - Finalizing PDB file Patching PE file - PE32 image (32-bit) - PDB file name has been stored in debug data. - Header checksum has been cleared. - PE file has been updated. I was also able to create a pdb for the package E:\map2pdb>map2pdb.exe I:\FBAT_HG9\Output\FB9\VSoft.Core.map -bind:I:\FBAT_HG9\Output\FB9\VSoft.Core.bpl -v map2pdb - Copyright (c) 2021 Anders Melander Version 2.0 Constructed a new PDB GUID: {76323C0F-0787-44F8-BC72-2B6ACC9CBF82} Output filename not specified. Defaulting to VSoft.Core.pdb Reading MAP file - Segments Warning: [ 7] Empty segment: .tls [0005:00000000] Warning: [ 8] Empty segment: .pdata [0006:00400000] - Modules Warning: [ 1682] Module exceed segment bounds - ignored: OtlCommon.Utils [0005:00000000+256] - Symbols Warning: [ 6403] Failed to resolve symbol to module: [0005:00000000] OtlCommon.Utils.LastThreadName Warning: [ 8705] Failed to resolve symbol to module: [0005:00000100] SysInit.TlsLast Warning: [ 8709] Failed to resolve symbol to module: [0004:FFBF8000] SysInit.__ImageBase - Line numbers Warning: [64147] Line number offset out of range for module. Offset:003DAEEF, Module:.VSoft.Core [003DAEF0 - 003E5738] Constructing PDB file - Collecting source file names - Module streams - Strings stream - PDB Info stream - TPI stream - Symbols stream - DBI stream - IPI stream - Finalizing PDB file Patching PE file - PE32 image (32-bit) - PDB file name has been stored in debug data. - Header checksum has been cleared. - PE file has been updated. Now to hook it into every project in the group and see how it goes πŸ˜ƒ Thanks again for this awesome effort.. my only question now is, if you can do this in your spare time, why TF can't embarcadero do it πŸ™„
  21. Vincent Parrett

    MAP2PDB - Profiling with VTune

    I compiled map2pdb from source using 10.4.2 and vtune now loads the pdb from the test project. Sadly it didn't work for my real application Cannot locate debugging information for file 'I:\FBAT_HG9\Output\FB9\FinalBuilder9.exe'. Cannot match the module with the symbol file 'I:\FBAT_HG9\Output\FB9\FinalBuilder9.pdb'. Make sure to specify the correct path to the symbol file in the Binary/Symbol Search list of directories.
  22. Vincent Parrett

    MAP2PDB - Profiling with VTune

    Well I tried the same project with 10.3 and got the same result, so it's not the compiler version. I'm using Vtune 2021.1.1 Gold - perhaps it's the vtune version?
  23. Vincent Parrett

    MAP2PDB - Profiling with VTune

    I suspect this has to do with the compiler version, using 10.4.2 even the test console app doesn't show function names. Project3.zip
  24. Vincent Parrett

    MAP2PDB - Profiling with VTune

    I have pm'd the map file, I didn't have your email address handy.
  25. Vincent Parrett

    MAP2PDB - Profiling with VTune

    I was seriously excited about this, until I realized I don't really know how to drive vtune πŸ™„ (terrible user interface!). So I was able to generate a pdb (9.5MB) and it appears to bind, however when running with vtune I don't see function names CPU Time 1 of 1: 100.0% (0.010s of 0.010s) FinalBuilder9.exe ! func@0x77c258 - [unknown source file] FinalBuilder9.exe ! func@0x4de4bf + 0xca - [unknown source file] FinalBuilder9.exe ! func@0x4ea8f8 + 0x176 - [unknown source file] FinalBuilder9.exe ! func@0x4ea518 + 0x10c - [unknown source file] FinalBuilder9.exe ! func@0x4ea8f8 + 0xf5 - [unknown source file] FinalBuilder9.exe ! func@0x4ea518 + 0x10c - [unknown source file] FinalBuilder9.exe ! func@0x4ea8f8 + 0xf5 - [unknown source file] FinalBuilder9.exe ! func@0x4ea518 + 0x10c - [unknown source file] FinalBuilder9.exe ! func@0x4ea8f8 + 0xf5 - [unknown source file] FinalBuilder9.exe ! func@0x4ea518 + 0x10c - [unknown source file] ..... How can I see if vtune is actually using the pdb? Also I'm using runtime packages, however when I tried to create a pdb for packages map2pdb crashed E:\map2pdb>map2pdb.exe I:\FBAT_HG9\Output\FB9\VSoft.Core.map -bind:I:\FBAT_HG9\Output\FB9\VSoft.Core.bpl -v map2pdb - Copyright (c) 2021 Anders Melander Version 2.0 Output filename not specified. Defaulting to VSoft.Core.pdb Reading MAP file - Segments - Modules An error occurred in the application. date/time : 2021-04-04, 08:53:18, 171ms computer name : SR22 user name : vincent registered owner : Vincent operating system : Windows 10 x64 build 19042 system language : English system up time : 42 minutes 16 seconds program up time : 185 milliseconds processors : 8x Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz physical memory : 52813/65477 MB (free/total) free disk space : (C:) 78.24 GB (E:) 233.56 GB display mode : 2560x1440, 32 bit process id : $55d0 allocated memory : 118.39 MB largest free block : 1.47 GB command line : map2pdb.exe I:\FBAT_HG9\Output\FB9\VSoft.Core.map -bind:I:\FBAT_HG9\Output\FB9\VSoft.Core.bpl -v executable : map2pdb.exe exec. date/time : 2021-04-04 08:00 compiled with : Delphi 10.3 Rio madExcept version : 5.1.0 callstack crc : $7846b8db, $f263fd00, $f263fd00 exception number : 1 exception class : EArgumentOutOfRangeException exception message : Argument out of range. thread $5a5c: 0046c541 +029 map2pdb.exe debug.info TDebugInfoSegments.FindByIndex 0047e90f +58b map2pdb.exe debug.info.reader.map TDebugInfoMapReader.LoadFromStream 0047d844 +034 map2pdb.exe debug.info.reader TDebugInfoReader.LoadFromFile 004aa13e +2e6 map2pdb.exe map2pdb 140 +62 initialization 76dffa27 +017 KERNEL32.DLL BaseThreadInitThunk thread $5c8: 76dffa27 +17 KERNEL32.DLL BaseThreadInitThunk thread $55d8: 76dffa27 +17 KERNEL32.DLL BaseThreadInitThunk thread $5b2c: 76dffa27 +17 KERNEL32.DLL BaseThreadInitThunk thread $4fac: 76dffa27 +17 KERNEL32.DLL BaseThreadInitThunk thread $5bc0: 76dffa27 +17 KERNEL32.DLL BaseThreadInitThunk
Γ—