From 8779a95c72a3df4f66ab7844f76e2292d96c75eb Mon Sep 17 00:00:00 2001 From: ccrause Date: Sun, 12 May 2024 13:49:01 +0200 Subject: [PATCH] Output descriptions of target enumerations in place of the ordinal values. --- components/fpdebug/fpdbgcommon.pas | 25 +++++++++++++++++++++++++ components/fpdebug/fpdbgcontroller.pas | 8 ++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/components/fpdebug/fpdbgcommon.pas b/components/fpdebug/fpdbgcommon.pas index 74ef013cec..950f25e6b0 100644 --- a/components/fpdebug/fpdbgcommon.pas +++ b/components/fpdebug/fpdbgcommon.pas @@ -27,6 +27,11 @@ type // Use when target information not yet loaded - assumes that debug target is the same as host function hostDescriptor: TTargetDescriptor; +function dbgs(AMachineType: TMachineType): String; overload; +function dbgs(ABitness: TBitness): String; overload; +function dbgs(AByteOrder: TByteOrder): String; overload; +function dbgs(AOperatingSystem: TOperatingSystem): String; overload; + {$IFDEF FPDEBUG_THREAD_CHECK} procedure AssertFpDebugThreadId(const AName: String); procedure AssertFpDebugThreadIdNotMain(const AName: String); @@ -66,6 +71,26 @@ begin end; end; +function dbgs(AMachineType: TMachineType): String; +begin + writestr(Result{%H-}, AMachineType); +end; + +function dbgs(ABitness: TBitness): String; +begin + writestr(Result{%H-}, ABitness); +end; + +function dbgs(AByteOrder: TByteOrder): String; +begin + writestr(Result{%H-}, AByteOrder); +end; + +function dbgs(AOperatingSystem: TOperatingSystem): String; +begin + writestr(Result{%H-}, AOperatingSystem); +end; + {$IFDEF FPDEBUG_THREAD_CHECK} var FCurrentFpDebugThreadIdForAssert: TThreadID; diff --git a/components/fpdebug/fpdbgcontroller.pas b/components/fpdebug/fpdbgcontroller.pas index a62b0da85c..7743f92a0f 100644 --- a/components/fpdebug/fpdbgcontroller.pas +++ b/components/fpdebug/fpdbgcontroller.pas @@ -2027,10 +2027,10 @@ begin DebugLn(DBG_WARNINGS and (not Assigned(FCurrentProcess.DbgInfo) or not(FCurrentProcess.DbgInfo.HasInfo)), ['TDbgController.SendEvents called - deCreateProcess - No debug info. [CurrentProcess=',dbgsname(FCurrentProcess),',DbgInfo=',dbgsname(FCurrentProcess.DbgInfo),']']); - DebugLn(DBG_VERBOSE, Format(' Target.MachineType = %d', [FCurrentProcess.DbgInfo.TargetInfo.machineType])); - DebugLn(DBG_VERBOSE, Format(' Target.Bitness = %d', [FCurrentProcess.DbgInfo.TargetInfo.bitness])); - DebugLn(DBG_VERBOSE, Format(' Target.byteOrder = %d', [FCurrentProcess.DbgInfo.TargetInfo.byteOrder])); - DebugLn(DBG_VERBOSE, Format(' Target.OS = %d', [FCurrentProcess.DbgInfo.TargetInfo.OS])); + DebugLn(DBG_VERBOSE, ' Target.MachineType = ', dbgs(FCurrentProcess.DbgInfo.TargetInfo.machineType)); + DebugLn(DBG_VERBOSE, ' Target.Bitness = ', dbgs(FCurrentProcess.DbgInfo.TargetInfo.bitness)); + DebugLn(DBG_VERBOSE, ' Target.byteOrder = ', dbgs(FCurrentProcess.DbgInfo.TargetInfo.byteOrder)); + DebugLn(DBG_VERBOSE, ' Target.OS = ', dbgs(FCurrentProcess.DbgInfo.TargetInfo.OS)); DoOnDebugInfoLoaded(self);