Jump to content

dummzeuch

Members
  • Content Count

    2611
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by dummzeuch

  1. After playing around with debug visualizers, I found that there is a very simple way to provide a visualiser for many record types: Just add a special method (I called it Dump) to those records that returns a string that you can then evaluate in the debugger and display in the debug windows. There are two caveats though: read on in the blog post...
  2. Value is a property which I have left out in the shortened type declaration. The same goes for the function IsValid, that checks if the field FIsValid is assigned. So, strictly speaking you are right, the example code won't compile. But the point was to show how to implement a Dump method in principle. If you want to have a look at the actual imlementation of TNullableDateTime, see the unit u_dzNullableDateTime in the dzlib svn repositiory on SourceForge.
  3. Hm, maybe the map file? Do you build dcu files containing debug information? If yes, the debug information contains a line number, so the size might change if the number of lines containing code changes. There might be other kinds of information in the dcu which are similarly affected. The dcu format isn't documented, but I remember a project on GitHub that could read them - at least get identifiers out of them - so maybe that project also contains some kind of documentation or at least parsing code that might shed some light on this.
  4. The same would work with explicitly adding the method call to the watch window and allowing side effects. But the point is to show the values in all debugger windows and hints not just in the watch window. You just gave me an additional idea though: The display value could be cached in a string field which gets updated when the record's value changes, and the visualizer would then just read the field. This would be much faster in the visualizer as no code in the debugged program needs to be executed. But it could significantly slow down the executable in debug mode, depending on how often the value changes.
  5. dummzeuch

    Close current form when opening other form

    Closing the main form of an application terminates that application and thereby also frees that form and all other forms. The main form of an application is defined as the first form it creates and that cannot be changed easily. So, creating a login form as the first form, has the side effect of terminating the application as soon as it gets closed. which is usually not desirable. Therefore such a login form should never be the first form an application creates. (Unless something has been changed over the years and my experience is outdated (again).)
  6. I have seen that happen even without using GetIt. I think it is related to converting the files from LF to CR/LF style line ends. But I never actualy verified this, so I might be wrong.
  7. dummzeuch

    Embed line number at design time??

    No, at least if I remember correctly that the generated format was compatible to jcldebug. But thanks for the link anyway. I have wanted to look into synopse logging since I read about it in that blog post ... OMG: 2011? > 10 years ago!
  8. dummzeuch

    Embed line number at design time??

    You should get the line number of the original function if you pass 1 as the parameter to LineByLevel instead of the default 0.
  9. dummzeuch

    Embed line number at design time??

    Just keep in mind that calling GetLocationInfo is rather costly. It's not meant to be called all over the place. If I remember correctly somebody claimed to have improved the jcldebug file format to make it much smaller and lookups faster. Unfortunately I don't remember who it was and where I read about it. It's quite possible that he donated the code to the jcl in the mean time
  10. dummzeuch

    Embed line number at design time??

    It does indeed. It should also be possible to write a function that reads its own return address from the stack and then returns this value as the result. This then could be passed to GetLocationInfo. I'm not sure how to implement this, but it shouldn't be rocket science. Edit: There is System.ReturnAddress, introduced with Delphi XE2, which gives you just that, so function GetCurrentLineNumber: Integer; var ModInfo: TJclLocationInfo; begin ModInfo := GetLocationInfo(ReturnAddress); Result := ModInfo.LineNumber; end; Should do the trick (untested) Edit: Just tried it. It works, at least in Delphi 10.2. Edit: JclDebug already contains such a function called LineByLevel.
  11. dummzeuch

    Formatter line wrapping and indention

    No idea. I currently don't find the time to do anything on it.
  12. dummzeuch

    Delphi 12 error when closing the ide

    I know that GExperts can cause this. Unfortunately I so far was unable to find the actual problem. It seems to be connected with using the formatter very frequently.
  13. dummzeuch

    Can LoadResString be done according to language ?

    dxgettext can translate ressource strings. It does so by hooking several RTL functions, one of them being LoadResString. Last time I looked it only worked for 32 bit Delphi, unless somebody has ported it to 64 bit by now.
  14. I can't be bothered, sorry. I was only "thinking aloud". Maybe I shouldn't have written it as a comment, though.
  15. I wonder how much of the time depends on where the file is read from: RAM Disk, SSD, HDD and for the latter whether it's already in the cache or not. 2 (American billion) = 2.000.000.000 lines of about 15 characters makes it about 30.000.000.000 bytes, that's 30 Gig of data to read, split into lines, then split into name and value and then aggregate by name. 32 bit Delphi won't be able to handle that with Stringlist because it won't fit into memroy, I wonder whether there are any bugs in the RTL that would prevent that with a 64 bit Delphi program. But anyway: Using a StringList is probably not the most efficient way of reading the data. Plain old ReadLn would likely do the trick faster. Some kind of buffering might speed it up and maybe parsing based on a PChar pointer rather than strings. Then selecting a suitable datastructure, probably some hash based dictionary. The rest is not much of a challenge.
  16. Delphi 12 creates an entry in the (Open Shell) start menu directly under programs. I don't want that entry that so I deleted it. But every time I start the Delphi 12 IDE that entry is added again. This is really annoying. Is there a setting somewhere that controls this?
  17. dummzeuch

    Visually edit a custom component

    There is also Delphi Custom Containers Pack. For some types of components I prefer that over frames.
  18. dummzeuch

    Delphi 12 Watch list

    I was just about to ask the same as @Der schöne Günther: Why did you put those two dots in front of AsString? That might confuse the watch window.
  19. dummzeuch

    Delphi and "Use only memory safe languages"

    We already had that: It was called Delphi for dotNET. AFAIK the last Version was Delphi for dotNET 2007. Somehow it didn't catch on.
  20. dummzeuch

    Delphi and "Use only memory safe languages"

    Some parts of the Linux kernel are being converted to Rust. Also, many parts of the Linux distributions are written in Python oder even shell scripts. Some Perl can still be found there too.
  21. dummzeuch

    How to rearrange projects in projects group file?

    Or, if you prefer using the mouse: There are Build Sooner / Build Later entries in the popup menu.
  22. dummzeuch

    GExperts 1.3.24 Beta1 for Delphi 12

    I have just built an installer for GExperts 1.3.24 Beta1 for Delphi 12. Note the word “Beta” in the release name! We are one step up from Alpha, there are still many bugs, but overall it seems to be stable. Most of the bugs manifest themselves as display glitches on high DPI monitors. Continue reading in the blog post
  23. dummzeuch

    What's the general opinion on v12?

    On my computer it works exactly that way. 1200 pixels: 960 pixels: Maybe there is some configuration setting that causes this. I don't remember changing anything though.
  24. dummzeuch

    What's the general opinion on v12?

    It depends on how wide your browser window is. Yours is too narrow, so you get the condensed view. I get that too if I move the browser window to half of a HD monitor -> 960 pixels wide. If I make it a bit wider, I get the full path. That's called "responsive design" I think, and I usually hate it. Be we digress.
  25. dummzeuch

    GExperts 1.3.24 Beta1 for Delphi 12

    Please file a bug report on sourceforge.
×