Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


TiGü last won the day on January 4

TiGü had the most liked content!

Community Reputation

13 Good

About TiGü

  • Birthday 01/14/1986

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

105 profile views
  1. TiGü

    Creating a "pull request" for jvcl

    Please, don't feel sorry. My answer was for Schokohase. But if KB4482887 fixed this issue (without any hints in the official description - tz tz tz), everything is okay. I try to cancel my pull request.
  2. TiGü

    Creating a "pull request" for jvcl

    Especially when younger pull requests are commented and this one is simply ignored. The maintainers can say: "Ok, that was nice, but come back when you have a version that works with Delphi 6". But ignoring it completely is not cool. You know the German proverb: "Kannste man so machen, aber dann ist halt K*cke!" My motivation to ever participate again for the JCL or JVCL is at a minimum.
  3. TiGü

    Creating a "pull request" for jvcl

    But all effort is pointless if none of the maintainers integrates the pull requests. https://github.com/project-jedi/jvcl/pull/56
  4. Funny, the embedded PASCAL code editor don't recognized the (* and *) comments.
  5. Hm...in Delphi Tokyo we can find in SysSysctlTypes.inc: (* TODO -otgerdes -cTranslate: kinfo_proc (needs proc.h) struct kinfo_proc { struct extern_proc kp_proc; // proc structure struct eproc { struct proc *e_paddr; // address of proc struct session *e_sess; // session pointer struct _pcred e_pcred; // process credentials struct _ucred e_ucred; // current credentials struct vmspace e_vm; // address space pid_t e_ppid; // parent process id pid_t e_pgid; // process group id short e_jobc; // job control counter dev_t e_tdev; // controlling tty dev pid_t e_tpgid; // tty process group id struct session *e_tsess; // tty session pointer #define WMESGLEN 7 char e_wmesg[WMESGLEN+1]; // wchan message segsz_t e_xsize; // text size short e_xrssize; // text rss short e_xccount; // text references short e_xswrss; int32_t e_flag; #define EPROC_CTTY 0x01 // controlling tty vnode active #define EPROC_SLEADER 0x02 // session leader #define COMAPT_MAXLOGNAME 12 char e_login[COMAPT_MAXLOGNAME]; // short setlogin() name #if CONFIG_LCTX pid_t e_lcid; int32_t e_spare[3]; #else int32_t e_spare[4]; #endif } kp_eproc; }; *)
  6. Okay, here we have solutions for macOS and Linux. https://stackoverflow.com/questions/2200277/detecting-debugger-on-mac-os-x It looks like easy to convert (depends of the status of the source\rtl\osx-Units).
  7. That's good to know! Thank you for the clarification. I stumbled upon this interesting blog post: https://xorl.wordpress.com/2017/11/20/reverse-engineering-isdebuggerpresent/ There must be similar mechanics on iOS, Android, Linux and macOS. I personally know too little about that. 😞
  8. But as we can see in the class procedure TThread.NameThreadForDebugging(AThreadName: string; AThreadID: TThreadID); there are following lines: ... {$ELSEIF Defined(ANDROID)} if (System.DebugHook <> 0) or (getenv(EMBDBKPRESENTNAME) <> nil) then {$ELSE} ... So, i guess it's defined for Windows and Android and working on both platforms. Hast du wirklich deine IDE auf Deutsch gestellt?
  9. var IsCrossPlatformDebuggerPresent: Boolean; begin IsCrossPlatformDebuggerPresent := System.DebugHook <> 0; end;
  10. Do you use Windows 10? Why not increase the DPI for the current Monitors? You can use a 1920 x 1200 Monitor with a 125%, 150% or 175% scaling. Source: https://www.tenforums.com/tutorials/5990-change-dpi-scaling-level-displays-windows-10-a.html
  11. Have a look to Microsofts Team Foundation Server: https://en.wikipedia.org/wiki/Team_Foundation_Server
  12. TiGü

    Caching with class variables

    Hi Primož, that's a nice piece of code, but i notice in my Delphi Tokyo, that the ens-Result for the TEnumSet (for valid values) is empty. But if you add a untyped Move, than it works: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.TypInfo, System.Rtti, System.SysUtils; resourcestring SValueLiesOutsideAllowedRange = 'Value %d lies outside allowed range for %s (%d .. %d)'; type TypeInfoCache<T> = class class var FMinIntVal: Integer; FMaxIntVal: Integer; FIsSet: Boolean; public class constructor Create; class property MaxIntVal: Integer read FMaxIntVal; class property MinIntVal: Integer read FMinIntVal; class property IsSet: Boolean read FIsSet; end; Range<T> = record private class function MaxIntVal: Integer; static; inline; class function MinIntVal: Integer; static; inline; class procedure RaiseException(const Value: Integer); static; public class function Check(const Value: Integer): T; static; end; { Range<T> } class function Range<T>.Check(const Value: Integer): T; begin if (Value < MinIntVal) or (Value > MaxIntVal) then RaiseException(Value); if TypeInfoCache<T>.IsSet then begin Move(Value, Result, SizeOf(T)); // here is the magic end; end; class function Range<T>.MaxIntVal: Integer; begin Result := TypeInfoCache<T>.MaxIntVal; end; class function Range<T>.MinIntVal: Integer; begin Result := TypeInfoCache<T>.MinIntVal; end; class procedure Range<T>.RaiseException(const Value: Integer); begin raise Exception.CreateFmt(SValueLiesOutsideAllowedRange, [Value, PTypeInfo(TypeInfo(T)).Name, MinIntVal, MaxIntVal]); end; { TypeInfoCache<T> } class constructor TypeInfoCache<T>.Create; var ti: PTypeInfo; typeData: PTypeData; i: Integer; begin ti := TypeInfo(T); FIsSet := ti.Kind = tkSet; if FIsSet then ti := GetTypeData(ti).CompType^; typeData := GetTypeData(ti); FMinIntVal := typeData.MinValue; if FIsSet then begin FMaxIntVal := 0; for i := typeData.MinValue to typeData.MaxValue do FMaxIntVal := FMaxIntVal or (1 shl i); end else FMaxIntVal := typeData.MaxValue; end; type TEnum = (en1, en2, en3); TEnumSet = set of TEnum; var en: TEnum; ens: TEnumSet; begin try try en := Range<TEnum>.Check(0); en := Range<TEnum>.Check(2); en := Range<TEnum>.Check(3); except on E: Exception do Writeln('Expected exception: ', E.ClassName, ' ', E.Message); end; try ens := Range<TEnumSet>.Check(0); ens := Range<TEnumSet>.Check(2); ens := Range<TEnumSet>.Check(7); ens := Range<TEnumSet>.Check(8); except on E: Exception do Writeln('Expected exception: ', E.ClassName, ' ', E.Message); end; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; if DebugHook <> 0 then Readln; end.
  13. TiGü

    Embarcadero DocWiki for Rio

    OT: I liked the depressive design, it fit well with the daily frustrating experience with the IDE. 👿
  14. TiGü

    Debugging multiple DLLs simultaneously

    I guess it will have a good reason/requirement why he needs to use an application with multiple DLLs.
  15. TiGü

    Debugging multiple DLLs simultaneously

    program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, Winapi.Windows; procedure Main; var I: Integer; begin Writeln('Start'); while not IsDebuggerPresent do begin Writeln('I''m waiting for you!'); Sleep(100); end; for I := 1 to 1000 do Writeln(' I:', I); Writeln('End'); end; begin try Main; Readln; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. Try the good old While-Not-IsDebuggerPresent-Trick!