Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/23/23 in all areas

  1. Not trying to be a smartass, but doesn't the compiler warn you explicitly? Like
  2. Anders Melander

    MAP2PDB - Profiling with VTune

    So I'm looking at checkInvariants in msf.cpp and there's this comment: MSF is the container format for a PDB file. The MSF format is pretty much a mini FAT file system, the files being the different PDB tables: Source file names, line numbers, symbols, etc. Internally the MSF file system is divided into intervals. Each interval contains <blocksize> blocks and each block is <blocksize> bytes long. The blocksize used to be 4096. Now it can apparently also be 8192. At the start of each interval, there are two blocks (the Free Page Map) that contain a bitmap of allocated blocks in the interval. Allocated as in "in-use" by a stream. A stream is just a collection of blocks. All streams are listed in the stream directory. The stream directory is stored in one or more blocks. At the start of the file is the superblock. It contains various info about the file: blocksize, index of the first Free Page Map, the number of blocks in the file, a pointer to the stream directory, etc. MSF Block and Interval layout Interval | 0 | 1 ------------+------------+------+------+------+------+------+------+------+------+------+------+------+- - - Block index | 0 | 1 | 2 | 3 | 4 | ... | 4095 | 4096 | 4097 | 4095 | 4096 | 4097 | ... ------------+------------+------+------+------+------+------+------+------+------+------+------+------+- - - Log block | 0 (N/A) | N/A | N/A | 1 | 2 | ... | ... | 4094 | N/A | N/A | 4095 | ... | ... ------------+------------+------+------+------+------+------+------+------+------+------+------+------+- - - Phys offset | 0 | 4096 | 8192 |12288 |16384 | ... | ... |4096^2|+4096 |+8192 | ... | ... | ... ------------+------------+------+------+------+------+------+------+------+------+------+------+------+- - - Content | Superblock | FPM1 | FPM2 | Data | Data | Data | Data | Data | FPM1 | FPM2 | Data | Data | Data So in theory some of the blocks in an interval can be in use and some of them can be free and those that are in use should be referenced in the higher level stream's index of MSF blocks - otherwise, they are "leaked". I believe this is what checkInvariants verifies. Now, since I'm writing the PDB file in one go and never have a need to go back and free or modify an already allocated MSF block, I always mark all blocks as allocated when I start a new interval in the file. This means that I can, and most likely will, end up with blocks marked as allocated in the bitmap but not actually in use (or physically present in the file). procedure TBinaryBlockWriter.WriteBlockMap; const NoVacancies: Byte = $FF; begin BeginBlock; Assert((BlockIndex mod FBlockSize) in [1, 2]); // Mark all BlockSize*8 blocks occupied for var i := 0 to FBlockSize-1 do FStream.WriteBuffer(NoVacancies, 1); FStreamSize := Max(FStreamSize, FStream.Position); EndBlock(True); end; So why wasn't this a problem with the old version? In the old Microsoft source checkInvariants is only active in debug builds so my guess is that the old version simply doesn't perform this validation. Anyway, it's the best guess I have right now so it should be pursued. I'm not sure when I will get time to do so though.
  3. I told ChatGPT to write a blog post for me thinking I might save some effort and finally get something useful out of it. Write a blog post about the Uses Clause Manager Expert in GExperts (Yes, I'm a lazy basterd™) It wrote a very convincing blog post on the topic which unfortunately was utter bullshit. None, I repeat: None, of the claims were true. So what did I do? I blogged about it.
  4. programmerdelphi2k

    Any Demo On How To Use TBiometricAuth In Delphi

    DAMMMMMHHHH 🤪
  5. Dave Nottage

    Any Demo On How To Use TBiometricAuth In Delphi

    Incorrect. USE_BIOMETRIC needs to be included in the permissions, but only dangerous permissions need to be explicitly requested at runtime. You're also missing the Use Biometric permission in the Permissions section of Project Options. Sorry, I should have checked for that earlier.
  6. Jan Rysavy

    MAP2PDB - Profiling with VTune

    CONFIRMED! Patched version of amplxe_msdia140!MSF_HB::checkInvariants (version 14.34.31942.0 from VTune 2023.1) works fine with MAP2PDB PDBs. amplxe_msdia140.zip
  7. Stefan Glienke

    MAP2PDB - Profiling with VTune

    No, it's not - it's the call from this line: https://github.com/microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L1627 It however might look different today given that source on GitHub is from seven years ago but it might still give a clue. The weirdest way I got a "thank you" ever ngl
  8. Anders Melander

    MAP2PDB - Profiling with VTune

    I want a sex change operation so I can have your children. (it means "thank you" in case you wondered)
  9. Stefan Glienke

    MAP2PDB - Profiling with VTune

    FWIW: https://github.com/microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L1385
  10. Jan Rysavy

    MAP2PDB - Profiling with VTune

    Yes, exactly. I'm using WinDbg Preview from https://apps.microsoft.com/store/detail/windbg-preview/9PGJGD53TN86 Set breakpoint: bp msdia140!CDiaDataSource::loadDataFromPdb Run 'wt' trace command: wt -m msdia140 -oR Btw, see attached dumps. Both are using msdia140.dll version 14.36.32532.0. msdia140_14_36_32532_error.txt is loading PDB from MAP2PDB, while msdia140_14_36_32532_success.txt is loading PDB from MSVC simple application. Look at difference in msdia140!MSF_HB::checkInvariants return value rax = 0 vs rax = 1. msdia140_diff.zip
  11. Anders Melander

    set of object instances

    With a list of TEdits? Not likely. I would go for an encapsulated TList<T>: type TSetOfStuff<T> = class private FList: TList<T>; public function Contains(const Value: T): boolean; function Add(const Value: T): integer; procedure Remove(const Value: T); function GetEnumarator: TEnumerator<T>; end; function TSetOfStuff<T>.Contains(const Value: T): boolean; begin var Index: integer; Result := FList.BinarySearch(Value, Index); end; function TSetOfStuff<T>.Add(const Value: T): integer; begin if (not FList.BinarySearch(Value, Result)) then FList.Insert(Result, Value); end; procedure TSetOfStuff<T>.Remove(const Value: T); begin var Index: integer; if (FList.BinarySearch(Value, Index)) then FList.Delete(Index); end; function TSetOfStuff<T>.GetEnumarator: TEnumerator<T>; begin Result := FList.GetEnumerator; end; etc...
  12. David Heffernan

    set of object instances

    All these people suggesting TList (i.e. an array) are just asking for performance problems if ever the collection has a significant size.
  13. Next step would be "Write blog post about a blog post you'd write on topic X" 🙂
  14. David Heffernan

    Why Should a C-Sharper Learn Delphi?

    I don't know about FPC, but FPC is just a pascal compiler. You are asking about libraries. And I certainly don't know anything about them.
  15. shineworld

    Community license

    Your argument lines up right doesn't make a dent. In fact, beyond describing the reasons, we went no further and paid what was due. At the company there are no constraints on what one does in one's free time between lunch breaks, and the company has been favorably disposed to those who devote that time to opensource projects that do not conflict with company business, so I have never had a problem collaborating with the Linux project (support embeded boards), or .net-based projects. At the end of it all, I left the open world of Delphi and devote myself to other projects with Linux, FreePascal and .NET.
  16. Patrick PREMARTIN

    Something like SimpleNote with an API?

    Hi @David Schwartz Did you finally found something to answer your need ?
  17. programmerdelphi2k

    Community license

    Now imagine the following: I, develop an application using an Embarcadero CE edition! I'm on my latest generation notebook, with an nVida 40xx video card, running my favorite online game, connected to a Microsoft public wifi (if any)... I'm there, killing all the opponents.... however, I forgot that on my notebook is my application created in an Embarcadero CE edition is running, because I was registering my favorite songs... and, suddenly, the Embarcadero servers are about to send a warning letter to Microsoft, because I I'm using their wifi network... what happens now? I don't have a VPN (and if I do, they can find me)... Does Microsoft get the letter or do I?
  18. shineworld

    Community license

    On the use of the community license, my advice is to be very careful about what you do. I bring them my case. At home, on my personal notebook I had installed the community version of Delphi, it was the Rio, to work on an open-source project, GLSCENE. Since I have little time at home to develop I, unhappily, thought of taking advantage of the hour and a half of free time for lunch break I have at the office, to continue development on my personal notebook BUT attached to the company WIFI network to access the sources, do push and everything else. Well after a month or so I got a tethered notification from Embarcadero, that according to their logs, Community sends logs of what files you compile, when you compile, what network and domain you are working on, my company was not using Community intebitually for application development while earning over 5000E. The email came directly to the company by going back to the company's internet domain data. There was no way to make it clear, even after sending the project report I worked on, that it was not of company interest but personal, about it being my personal laptop, etc. Moral of the story, they gave me a number of days to purchase the full Architect product (the most expensive formula) or legal action would start. The company covered the cost, thankfully. Be careful where you connect with terminals.... Since then never again a Community product and since I personally cannot buy Licensed products at those prices, I now participate in open-source projects with other environments and languages.
×