From c5a2b6bfaa80d8dc67eccb74395b24eca1878eb2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 02:44:21 +0000 Subject: [PATCH 01/10] Initial plan From 24ed2ecf6616a7b5639a492265282a436f58263b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 02:57:06 +0000 Subject: [PATCH 02/10] Replace BaseString with std::string and std::basic_string Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- src/SOS/Strike/strike.cpp | 16 ++-- src/SOS/Strike/util.cpp | 6 +- src/SOS/Strike/util.h | 161 ++------------------------------------ 3 files changed, 16 insertions(+), 167 deletions(-) diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index 025da72483..760663125c 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -4513,9 +4513,9 @@ HRESULT PrintThreadsFromThreadStore(BOOL bMiniDump, BOOL bPrintLiveThreadsOnly) if (SafeReadMemory(taLTOH, &taMT, sizeof(taMT), NULL)) { if (NameForMT_s(taMT, g_mdName, mdNameLen)) - lastCol += WString(g_mdName) + W(" ") + ExceptionPtr(taLTOH); + lastCol += WString(g_mdName) + W(" ") + WString(ExceptionPtr(taLTOH)); else - lastCol += WString(W(" (")) + Pointer(taLTOH) + W(")"); + lastCol += WString(W(" (")) + WString(Pointer(taLTOH)) + W(")"); // Print something if there are nested exceptions on the thread if (Thread.firstNestedException) @@ -11051,12 +11051,12 @@ class ClrStackImpl foundPlatform = true; String outputFormat3 = " %3s=%016llx %3s=%016llx %3s=%016llx\n"; String outputFormat2 = " %3s=%016llx %3s=%016llx\n"; - ExtOut(outputFormat3, "rsp", context.Amd64Context.Rsp, "rbp", context.Amd64Context.Rbp, "rip", context.Amd64Context.Rip); - ExtOut(outputFormat3, "rax", context.Amd64Context.Rax, "rbx", context.Amd64Context.Rbx, "rcx", context.Amd64Context.Rcx); - ExtOut(outputFormat3, "rdx", context.Amd64Context.Rdx, "rsi", context.Amd64Context.Rsi, "rdi", context.Amd64Context.Rdi); - ExtOut(outputFormat3, "r8", context.Amd64Context.R8, "r9", context.Amd64Context.R9, "r10", context.Amd64Context.R10); - ExtOut(outputFormat3, "r11", context.Amd64Context.R11, "r12", context.Amd64Context.R12, "r13", context.Amd64Context.R13); - ExtOut(outputFormat2, "r14", context.Amd64Context.R14, "r15", context.Amd64Context.R15); + ExtOut(outputFormat3.c_str(), "rsp", context.Amd64Context.Rsp, "rbp", context.Amd64Context.Rbp, "rip", context.Amd64Context.Rip); + ExtOut(outputFormat3.c_str(), "rax", context.Amd64Context.Rax, "rbx", context.Amd64Context.Rbx, "rcx", context.Amd64Context.Rcx); + ExtOut(outputFormat3.c_str(), "rdx", context.Amd64Context.Rdx, "rsi", context.Amd64Context.Rsi, "rdi", context.Amd64Context.Rdi); + ExtOut(outputFormat3.c_str(), "r8", context.Amd64Context.R8, "r9", context.Amd64Context.R9, "r10", context.Amd64Context.R10); + ExtOut(outputFormat3.c_str(), "r11", context.Amd64Context.R11, "r12", context.Amd64Context.R12, "r13", context.Amd64Context.R13); + ExtOut(outputFormat2.c_str(), "r14", context.Amd64Context.R14, "r15", context.Amd64Context.R15); } #endif #if defined(SOS_TARGET_X86) diff --git a/src/SOS/Strike/util.cpp b/src/SOS/Strike/util.cpp index 4c644db051..70622e121e 100644 --- a/src/SOS/Strike/util.cpp +++ b/src/SOS/Strike/util.cpp @@ -5394,7 +5394,7 @@ WString GetFrameFromAddress(TADDR frameAddr, IXCLRDataStackWalk *pStackWalk, BOO else frameOutput += W("Frame"); - frameOutput += WString(W(": ")) + Pointer(frameAddr) + W("] "); + frameOutput += WString(W(": ")) + WString(Pointer(frameAddr)) + W("] "); // Print the frame's associated function info, if it has any. CLRDATA_ADDRESS mdesc = 0; @@ -5511,7 +5511,7 @@ WString MethodNameFromIP(CLRDATA_ADDRESS ip, BOOL bSuppressLines, BOOL bAssembly if (!bSuppressLines && SUCCEEDED(GetLineByOffset(TO_CDADDR(ip), &linenum, wszFileName, MAX_LONGPATH, bAdjustIPForLineNumber))) { - methodOutput += WString(W(" [")) + wszFileName + W(" @ ") + Decimal(linenum) + W("]"); + methodOutput += WString(W(" [")) + WString((const WCHAR*)wszFileName) + W(" @ ") + WString(Decimal(linenum)) + W("]"); } } @@ -5521,7 +5521,7 @@ WString MethodNameFromIP(CLRDATA_ADDRESS ip, BOOL bSuppressLines, BOOL bAssembly WString DmlEscape(const WString &input) { const WCHAR *str = input.c_str(); - size_t len = input.GetLength(); + size_t len = input.length(); WString result; for (size_t i = 0; i < len; i++) diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index e86e881ed0..8ae309735c 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -453,159 +453,8 @@ void ConvertToLower(__out_ecount(len) char *buffer, size_t len); extern const char * const DMLFormats[]; int GetHex(CLRDATA_ADDRESS addr, __out_ecount(len) char *out, size_t len, bool fill); -// A simple string class for mutable strings. We cannot use STL, so this is a stand in replacement -// for std::string (though it doesn't use the same interface). -template -class BaseString -{ -public: - BaseString() - : mStr(0), mSize(0), mLength(0) - { - const size_t size = 64; - - mStr = new T[size]; - mSize = size; - mStr[0] = 0; - } - - BaseString(const T *str) - : mStr(0), mSize(0), mLength(0) - { - CopyFrom(str, LEN(str)); - } - - BaseString(const BaseString &rhs) - : mStr(0), mSize(0), mLength(0) - { - *this = rhs; - } - - ~BaseString() - { - Clear(); - } - - const BaseString &operator=(const BaseString &rhs) - { - Clear(); - CopyFrom(rhs.mStr, rhs.mLength); - return *this; - } - - const BaseString &operator=(const T *str) - { - Clear(); - CopyFrom(str, LEN(str)); - return *this; - } - - const BaseString &operator +=(const T *str) - { - size_t len = LEN(str); - CopyFrom(str, len); - return *this; - } - - const BaseString &operator +=(const BaseString &str) - { - CopyFrom(str.mStr, str.mLength); - return *this; - } - - BaseString operator+(const T *str) const - { - return BaseString(mStr, mLength, str, LEN(str)); - } - - BaseString operator+(const BaseString &str) const - { - return BaseString(mStr, mLength, str.mStr, str.mLength); - } - - operator const T *() const - { - return mStr; - } - - const T *c_str() const - { - return mStr; - } - - size_t GetLength() const - { - return mLength; - } - -private: - BaseString(const T * str1, size_t len1, const T * str2, size_t len2) - : mStr(0), mSize(0), mLength(0) - { - const size_t size = len1 + len2 + 1 + ((len1 + len2) >> 1); - mStr = new T[size]; - mSize = size; - - CopyFrom(str1, len1); - CopyFrom(str2, len2); - } - - void Clear() - { - mLength = 0; - mSize = 0; - if (mStr) - { - delete [] mStr; - mStr = 0; - } - } - - void CopyFrom(const T *str, size_t len) - { - if (mLength + len + 1 >= mSize) - Resize(mLength + len + 1); - - COPY(mStr+mLength, mSize-mLength, str); - mLength += len; - } - - void Resize(size_t size) - { - /* We always resize at least one half bigger than we need. When CopyFrom requests a resize - * it asks for the exact size that's needed to concatenate strings. However in practice - * it's common to add multiple strings together in a row, e.g.: - * String foo = "One " + "Two " + "Three " + "Four " + "\n"; - * Ensuring the size of the string is bigger than we need, and that the minimum size is 64, - * we will cut down on a lot of needless resizes at the cost of a few bytes wasted in some - * cases. - */ - size += size >> 1; - if (size < 64) - size = 64; - - T *newStr = new T[size]; - - if (mStr) - { - COPY(newStr, size, mStr); - delete [] mStr; - } - else - { - newStr[0] = 0; - } - - mStr = newStr; - mSize = size; - } -private: - T *mStr; - size_t mSize, mLength; -}; - -typedef BaseString String; -typedef BaseString WString; +typedef std::string String; +typedef std::basic_string WString; template void Flatten(__out_ecount(len) T *data, unsigned int len) @@ -778,7 +627,7 @@ namespace Output operator WString() const { String str = *this; - const char *cstr = (const char *)str; + const char *cstr = str.c_str(); int len = MultiByteToWideChar(CP_ACP, 0, cstr, -1, NULL, 0); WCHAR *buffer = (WCHAR *)alloca(len*sizeof(WCHAR)); @@ -1281,12 +1130,12 @@ class TableOutput void WriteColumn(int col, const String &str) { - WriteColumn(col, Output::Format(str)); + WriteColumn(col, Output::Format(str.c_str())); } void WriteColumn(int col, const WString &str) { - WriteColumn(col, Output::Format(str)); + WriteColumn(col, Output::Format(str.c_str())); } void WriteColumn(int col, __in_z WCHAR *str) From 403fddbc72941d7daf7ddb91c3b8b0fc8cc985c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 03:05:44 +0000 Subject: [PATCH 03/10] Address code review comments - use implicit conversion instead of cast Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- src/SOS/Strike/util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SOS/Strike/util.cpp b/src/SOS/Strike/util.cpp index 70622e121e..69a238a291 100644 --- a/src/SOS/Strike/util.cpp +++ b/src/SOS/Strike/util.cpp @@ -5511,7 +5511,8 @@ WString MethodNameFromIP(CLRDATA_ADDRESS ip, BOOL bSuppressLines, BOOL bAssembly if (!bSuppressLines && SUCCEEDED(GetLineByOffset(TO_CDADDR(ip), &linenum, wszFileName, MAX_LONGPATH, bAdjustIPForLineNumber))) { - methodOutput += WString(W(" [")) + WString((const WCHAR*)wszFileName) + W(" @ ") + WString(Decimal(linenum)) + W("]"); + const WCHAR* fileNamePtr = wszFileName; + methodOutput += WString(W(" [")) + fileNamePtr + W(" @ ") + WString(Decimal(linenum)) + W("]"); } } From 198cce63def1b616ba7609cb5958209d0dc680f7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 03:58:06 +0000 Subject: [PATCH 04/10] Add String overloads for ExtOut, DMLOut, etc using SFINAE templates Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- src/SOS/Strike/strike.cpp | 12 ++++++------ src/SOS/Strike/util.h | 37 +++++++++++++++++++++++++++++++++++++ test_overload.o | Bin 0 -> 3784 bytes 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 test_overload.o diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index 760663125c..1aa359bf0d 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -11051,12 +11051,12 @@ class ClrStackImpl foundPlatform = true; String outputFormat3 = " %3s=%016llx %3s=%016llx %3s=%016llx\n"; String outputFormat2 = " %3s=%016llx %3s=%016llx\n"; - ExtOut(outputFormat3.c_str(), "rsp", context.Amd64Context.Rsp, "rbp", context.Amd64Context.Rbp, "rip", context.Amd64Context.Rip); - ExtOut(outputFormat3.c_str(), "rax", context.Amd64Context.Rax, "rbx", context.Amd64Context.Rbx, "rcx", context.Amd64Context.Rcx); - ExtOut(outputFormat3.c_str(), "rdx", context.Amd64Context.Rdx, "rsi", context.Amd64Context.Rsi, "rdi", context.Amd64Context.Rdi); - ExtOut(outputFormat3.c_str(), "r8", context.Amd64Context.R8, "r9", context.Amd64Context.R9, "r10", context.Amd64Context.R10); - ExtOut(outputFormat3.c_str(), "r11", context.Amd64Context.R11, "r12", context.Amd64Context.R12, "r13", context.Amd64Context.R13); - ExtOut(outputFormat2.c_str(), "r14", context.Amd64Context.R14, "r15", context.Amd64Context.R15); + ExtOut(outputFormat3, "rsp", context.Amd64Context.Rsp, "rbp", context.Amd64Context.Rbp, "rip", context.Amd64Context.Rip); + ExtOut(outputFormat3, "rax", context.Amd64Context.Rax, "rbx", context.Amd64Context.Rbx, "rcx", context.Amd64Context.Rcx); + ExtOut(outputFormat3, "rdx", context.Amd64Context.Rdx, "rsi", context.Amd64Context.Rsi, "rdi", context.Amd64Context.Rdi); + ExtOut(outputFormat3, "r8", context.Amd64Context.R8, "r9", context.Amd64Context.R9, "r10", context.Amd64Context.R10); + ExtOut(outputFormat3, "r11", context.Amd64Context.R11, "r12", context.Amd64Context.R12, "r13", context.Amd64Context.R13); + ExtOut(outputFormat2, "r14", context.Amd64Context.R14, "r15", context.Amd64Context.R15); } #endif #if defined(SOS_TARGET_X86) diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index 8ae309735c..b009d5f3d5 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -456,6 +456,43 @@ int GetHex(CLRDATA_ADDRESS addr, __out_ecount(len) char *out, size_t len, bool f typedef std::string String; typedef std::basic_string WString; +// Forward declarations for variadic templates +template +inline typename std::enable_if< + std::is_same::type>::type, String>::value, + void +>::type +ExtOut(FirstArg&& format, Args&&... args) { + ExtOut(format.c_str(), std::forward(args)...); +} + +template +inline typename std::enable_if< + std::is_same::type>::type, String>::value, + void +>::type +ExtWarn(FirstArg&& format, Args&&... args) { + ExtWarn(format.c_str(), std::forward(args)...); +} + +template +inline typename std::enable_if< + std::is_same::type>::type, String>::value, + void +>::type +ExtErr(FirstArg&& format, Args&&... args) { + ExtErr(format.c_str(), std::forward(args)...); +} + +template +inline typename std::enable_if< + std::is_same::type>::type, String>::value, + void +>::type +DMLOut(FirstArg&& format, Args&&... args) { + DMLOut(format.c_str(), std::forward(args)...); +} + template void Flatten(__out_ecount(len) T *data, unsigned int len) { diff --git a/test_overload.o b/test_overload.o new file mode 100644 index 0000000000000000000000000000000000000000..5a01561c6455ed96f182c7512289d8cb9c71a446 GIT binary patch literal 3784 zcmb_dU1%It6uz^YAB}A{wh@F#*@{XQ?T}5HnAReJWSS|7F(h3qfiO;HC)p*tJIm~B zvI(|UYQ-f4_Cb9Sq@aR62z^jm5n&-}Er@9G!Jh|%pakrL;!E*|^_)BRY;K0#LaPVv zoO{0Wdw`Q1D7VLlyZUF-n2MHTvVz_p z`uQ8WUjA6G)oObAgVUV7`YdM~DPR-j3wh2qO2A&MdeKNsI~R#PRf)tB7bCH`OOcpe zjl{BFMPkLRNbJmSm1~>z;4j>$LazTezP^6JulDLT#D?HkuOR1wlzRqOmeki<9`4~* z+IGCEZ)lhGvUa6X(Kiy8K>}niI_u>xA&wu9+xT-ZYxUJq4(=u={fL`jFcG5st-hYv zPU??#@!a0AU;A-K^zx=(00j@)wbFt(_l5Pjo7Xm3%FbjQmPvcIYi3xjrgS{f`kKN% zQJ}o~W|z<0tjujkD-~!phpz1drVQI*Q#C{~-`?AbkS^YpTc4&WA&v@i4rGw@?QZ!4Ks*;p-7< zMA#QC?DtwDUAVsb-P$l~-wl9t0EQyra*u`?Y(xVJGpT8XUgcc&_7xMr_Dl8fy#{Pn z;3V@s1`Kx*&ofBh1AuY96AIi@q#t1%3gHXk6IJ{dh>hYLhY}x@>gRh7wzGgYvVWxs z{&o}mmnM1NZ<3dJcEK~8W!ud-W>U5Cd1lPccoXrX`Lu1>E9ru5SWd3sxkbwZ)#Qv9 zA25uZy<(WqUzX`P?nz4<9nh9RJE)bsr;FayxV5$;O^<`q*j%h6!R%*#uFw+@kByub1 zT+*1f3&pH`i@fOV)2D)C-{bB48~#K{*Cib9D&ZY)Kak-4;@$F(Z(h4k;1~y=eX>6! z;rk>!7KlUd;GkqL=N*%9>}raCTEekM2tO;~a$b1ZIbogHM`Ztogx@RSZ%Vjq&x61R z)%!^R9u;%k9~?x(VnR5*Crc8(hm3)rlW_E*_oOW0{QoKBcO<+`%sEpFt69&SXDW1( z&r>vW?To2wlR4 z0KRzcK^hhSz1L`ie@NW`1@>%JMIvqgWLlOORYV0f2yogK)hU?9CG?x8RFwlqiH z4Fh8h!`MaQS2`s8F+cVit>=DW{0ML~p*|EaQ{+obps Date: Wed, 14 Jan 2026 03:58:29 +0000 Subject: [PATCH 05/10] Remove accidentally committed test file Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- test_overload.o | Bin 3784 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test_overload.o diff --git a/test_overload.o b/test_overload.o deleted file mode 100644 index 5a01561c6455ed96f182c7512289d8cb9c71a446..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3784 zcmb_dU1%It6uz^YAB}A{wh@F#*@{XQ?T}5HnAReJWSS|7F(h3qfiO;HC)p*tJIm~B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wed, 14 Jan 2026 04:09:37 +0000 Subject: [PATCH 06/10] Add detailed comments explaining why SFINAE is required for String overloads Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- a.out | Bin 0 -> 16864 bytes src/SOS/Strike/util.h | 7 ++++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 a.out diff --git a/a.out b/a.out new file mode 100755 index 0000000000000000000000000000000000000000..3c45ec64d28eb3b04df60ae7e47314ab65378c37 GIT binary patch literal 16864 zcmeHOeQaCR6~9iCHb7gar5&MV)D(&crEZ+0p#=(V6Q?h0+Gb573R-z_?3cvCv5o!Q zx*f2fl8vZD3zL9Jt589jsKx}{7nC7JpsXL7_~{LIlNXF$dp1 zu|&)ST#h5C#BO@3%n~rIRC+T&$*!6z1?WWQGD{-rcaOp3R9;Y*U2VOyL>q4n%c0r zQ^3tAVJeNHY{25#AITOdIq9$Y^6)qBFRH~`!&6ozuvAC4u&&J_A;_CONJh4r2obz+Yppq4SC zk>$(jMrtIsHv&820>niud_z-{Uhl6J8`@geH|cf$2D?^2Rju={5>4B;uUp@$2mJMx z#`f*7Yw*_va3ag_DaZX&0Xh@+%Pbro`~IYQKdu43&e|{EeV%~MAYDi(r1@nf4}xD1 zi_M|CeOO^Xyzc?re&ymp#b+1A&Y`>Y5!=2@+@fUU?-x(pilJhrcwAw(O+JWQxlBB* z^!fR~Px0#uoF z;7FKVs)AOPx--j0g*d462~%B_(nAj1Ildis;4~g`8Fk?DIj#i99k?|fT7p*{I8IEd zlrm7tKq&*I43siZ%77ySA9yeRo3{7eN^M`on=6IT21m`Z{HxmD7b}lQt^BGq;QTTZ z-`*ubLHd0pnRqLo&-aW-o*wKIKcC|1fj;rV6i+W46W^cW>A^nn$P`Zx^oeiSe16&W zh}Pp>(kx`W{IWCt>HJ47{yi7}I~V_J7ysHcKJdrZp_8|0LvLw&e|x%pTPQFZIH3)% zU5IYv7d`{k4}1LHC3mBdNYL=wH-Tuw6~7{~X3|`U)ICIXr0$&j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}}cYBh+3+3(Wzc(-mO%=B*2lMeSAdNkYLzZ)hF zPKTyBP1Q6qroJ$VN=~ zY}vYQQ%DbOZl)axI`)R>Ax(i=^H!lZ-?Vw%rq(8*Z)n@HeqEcsrKP1Kv`yc(Zhcz_ z7PRm`uu9hx#x6aKpL!!wHkl= zHULYCb^Wx2Uv3vbqBBXoFPw#4Z|hw*%_V#;~m`7F7^7kgTBLLaO(LGkwAz-JL)P zi<)UmvJ-o8V#&lbMu#kI#KUBuYN@y>{PNuUQT6vG!BQn-M1_$<)V+in{G@1pX1;`MLc(FJj8^d0ymhe;D>OCt`b^H!-FE$*52psmk^|e~AIZ zBhR+yc^FfkcR@uK<&If#8)`JCvE!?T@_Ytw0HW@G z*p9L1P;vI3-;i+&fia!J)eK!Q<{qMc~+>rR=7^|B^(r=?W=uYP?)w^to`kd z|2ia2`#ztg%Cv!mj>6XuLvN$vwBLV;C1I+jC9E!WZ3dN(am>ZRY36-?ydT*ek9npu z5S->jMgVLgkR;u-hCp00hi=XoISFRxOGrTdo(+wpbq7%=KT+w**JWF={1 zf4fEOZ?G zC*^C;sj4Z51L}gK-zVr=;P!C8&H=`4ciJCsu()?zLXOM2G@W#*NYM{gTN+on3|y@E EC$A>4UjP6A literal 0 HcmV?d00001 diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index b009d5f3d5..3158c9bf0a 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -456,7 +456,12 @@ int GetHex(CLRDATA_ADDRESS addr, __out_ecount(len) char *out, size_t len, bool f typedef std::string String; typedef std::basic_string WString; -// Forward declarations for variadic templates +// Variadic template overloads that accept String and forward to PCSTR versions +// Note: SFINAE (std::enable_if) is required to avoid ambiguity. Without it: +// 1. String literals could match both const char* and const std::string& (via implicit conversion) +// 2. The recursive call ExtOut(format.c_str(), ...) inside the template would be ambiguous +// 3. Template instantiation would fail or cause infinite recursion +// With SFINAE, the template only matches when the first argument is exactly String type. template inline typename std::enable_if< std::is_same::type>::type, String>::value, From d85883ca991085fb8ad7cf555bc9b0b868c4d9b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 04:10:12 +0000 Subject: [PATCH 07/10] Remove accidentally committed binary Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- a.out | Bin 16864 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 a.out diff --git a/a.out b/a.out deleted file mode 100755 index 3c45ec64d28eb3b04df60ae7e47314ab65378c37..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16864 zcmeHOeQaCR6~9iCHb7gar5&MV)D(&crEZ+0p#=(V6Q?h0+Gb573R-z_?3cvCv5o!Q zx*f2fl8vZD3zL9Jt589jsKx}{7nC7JpsXL7_~{LIlNXF$dp1 zu|&)ST#h5C#BO@3%n~rIRC+T&$*!6z1?WWQGD{-rcaOp3R9;Y*U2VOyL>q4n%c0r zQ^3tAVJeNHY{25#AITOdIq9$Y^6)qBFRH~`!&6ozuvAC4u&&J_A;_CONJh4r2obz+Yppq4SC zk>$(jMrtIsHv&820>niud_z-{Uhl6J8`@geH|cf$2D?^2Rju={5>4B;uUp@$2mJMx z#`f*7Yw*_va3ag_DaZX&0Xh@+%Pbro`~IYQKdu43&e|{EeV%~MAYDi(r1@nf4}xD1 zi_M|CeOO^Xyzc?re&ymp#b+1A&Y`>Y5!=2@+@fUU?-x(pilJhrcwAw(O+JWQxlBB* z^!fR~Px0#uoF z;7FKVs)AOPx--j0g*d462~%B_(nAj1Ildis;4~g`8Fk?DIj#i99k?|fT7p*{I8IEd zlrm7tKq&*I43siZ%77ySA9yeRo3{7eN^M`on=6IT21m`Z{HxmD7b}lQt^BGq;QTTZ z-`*ubLHd0pnRqLo&-aW-o*wKIKcC|1fj;rV6i+W46W^cW>A^nn$P`Zx^oeiSe16&W zh}Pp>(kx`W{IWCt>HJ47{yi7}I~V_J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)X<6iNS*V4J_{kQ*X&=J;GK})B`}hIi)L(c0 zACZ2l#9`G~`I{Bu{-%ikdbE?yqX^1o+FwD5FBU!*9s*wIdWa}}cYBh+3+3(Wzc(-mO%=B*2lMeSAdNkYLzZ)hF zPKTyBP1Q6qroJ$VN=~ zY}vYQQ%DbOZl)axI`)R>Ax(i=^H!lZ-?Vw%rq(8*Z)n@HeqEcsrKP1Kv`yc(Zhcz_ z7PRm`uu9hx#x6aKpL!!wHkl= zHULYCb^Wx2Uv3vbqBBXoFPw#4Z|hw*%_V#;~m`7F7^7kgTBLLaO(LGkwAz-JL)P zi<)UmvJ-o8V#&lbMu#kI#KUBuYN@y>{PNuUQT6vG!BQn-M1_$<)V+in{G@1pX1;`MLc(FJj8^d0ymhe;D>OCt`b^H!-FE$*52psmk^|e~AIZ zBhR+yc^FfkcR@uK<&If#8)`JCvE!?T@_Ytw0HW@G z*p9L1P;vI3-;i+&fia!J)eK!Q<{qMc~+>rR=7^|B^(r=?W=uYP?)w^to`kd z|2ia2`#ztg%Cv!mj>6XuLvN$vwBLV;C1I+jC9E!WZ3dN(am>ZRY36-?ydT*ek9npu z5S->jMgVLgkR;u-hCp00hi=XoISFRxOGrTdo(+wpbq7%=KT+w**JWF={1 zf4fEOZ?G zC*^C;sj4Z51L}gK-zVr=;P!C8&H=`4ciJCsu()?zLXOM2G@W#*NYM{gTN+on3|y@E EC$A>4UjP6A From 795d2786ac733b2b1d1af3c8d765676db9fd98c4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 15:32:04 +0000 Subject: [PATCH 08/10] Revert SFINAE template overloads, use .c_str() for String parameters Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- src/SOS/Strike/strike.cpp | 12 +++++------ src/SOS/Strike/util.h | 42 --------------------------------------- 2 files changed, 6 insertions(+), 48 deletions(-) diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index 1aa359bf0d..760663125c 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -11051,12 +11051,12 @@ class ClrStackImpl foundPlatform = true; String outputFormat3 = " %3s=%016llx %3s=%016llx %3s=%016llx\n"; String outputFormat2 = " %3s=%016llx %3s=%016llx\n"; - ExtOut(outputFormat3, "rsp", context.Amd64Context.Rsp, "rbp", context.Amd64Context.Rbp, "rip", context.Amd64Context.Rip); - ExtOut(outputFormat3, "rax", context.Amd64Context.Rax, "rbx", context.Amd64Context.Rbx, "rcx", context.Amd64Context.Rcx); - ExtOut(outputFormat3, "rdx", context.Amd64Context.Rdx, "rsi", context.Amd64Context.Rsi, "rdi", context.Amd64Context.Rdi); - ExtOut(outputFormat3, "r8", context.Amd64Context.R8, "r9", context.Amd64Context.R9, "r10", context.Amd64Context.R10); - ExtOut(outputFormat3, "r11", context.Amd64Context.R11, "r12", context.Amd64Context.R12, "r13", context.Amd64Context.R13); - ExtOut(outputFormat2, "r14", context.Amd64Context.R14, "r15", context.Amd64Context.R15); + ExtOut(outputFormat3.c_str(), "rsp", context.Amd64Context.Rsp, "rbp", context.Amd64Context.Rbp, "rip", context.Amd64Context.Rip); + ExtOut(outputFormat3.c_str(), "rax", context.Amd64Context.Rax, "rbx", context.Amd64Context.Rbx, "rcx", context.Amd64Context.Rcx); + ExtOut(outputFormat3.c_str(), "rdx", context.Amd64Context.Rdx, "rsi", context.Amd64Context.Rsi, "rdi", context.Amd64Context.Rdi); + ExtOut(outputFormat3.c_str(), "r8", context.Amd64Context.R8, "r9", context.Amd64Context.R9, "r10", context.Amd64Context.R10); + ExtOut(outputFormat3.c_str(), "r11", context.Amd64Context.R11, "r12", context.Amd64Context.R12, "r13", context.Amd64Context.R13); + ExtOut(outputFormat2.c_str(), "r14", context.Amd64Context.R14, "r15", context.Amd64Context.R15); } #endif #if defined(SOS_TARGET_X86) diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index 3158c9bf0a..8ae309735c 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -456,48 +456,6 @@ int GetHex(CLRDATA_ADDRESS addr, __out_ecount(len) char *out, size_t len, bool f typedef std::string String; typedef std::basic_string WString; -// Variadic template overloads that accept String and forward to PCSTR versions -// Note: SFINAE (std::enable_if) is required to avoid ambiguity. Without it: -// 1. String literals could match both const char* and const std::string& (via implicit conversion) -// 2. The recursive call ExtOut(format.c_str(), ...) inside the template would be ambiguous -// 3. Template instantiation would fail or cause infinite recursion -// With SFINAE, the template only matches when the first argument is exactly String type. -template -inline typename std::enable_if< - std::is_same::type>::type, String>::value, - void ->::type -ExtOut(FirstArg&& format, Args&&... args) { - ExtOut(format.c_str(), std::forward(args)...); -} - -template -inline typename std::enable_if< - std::is_same::type>::type, String>::value, - void ->::type -ExtWarn(FirstArg&& format, Args&&... args) { - ExtWarn(format.c_str(), std::forward(args)...); -} - -template -inline typename std::enable_if< - std::is_same::type>::type, String>::value, - void ->::type -ExtErr(FirstArg&& format, Args&&... args) { - ExtErr(format.c_str(), std::forward(args)...); -} - -template -inline typename std::enable_if< - std::is_same::type>::type, String>::value, - void ->::type -DMLOut(FirstArg&& format, Args&&... args) { - DMLOut(format.c_str(), std::forward(args)...); -} - template void Flatten(__out_ecount(len) T *data, unsigned int len) { From d79d619d23a19e44d328f415a87099e515a11694 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:04:02 +0000 Subject: [PATCH 09/10] Add .c_str() calls for String variables in all platform-specific sections Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- src/SOS/Strike/strike.cpp | 64 +++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index 760663125c..5ea9d956d2 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -11065,9 +11065,9 @@ class ClrStackImpl foundPlatform = true; String outputFormat3 = " %3s=%08x %3s=%08x %3s=%08x\n"; String outputFormat2 = " %3s=%08x %3s=%08x\n"; - ExtOut(outputFormat3, "esp", context.X86Context.Esp, "ebp", context.X86Context.Ebp, "eip", context.X86Context.Eip); - ExtOut(outputFormat3, "eax", context.X86Context.Eax, "ebx", context.X86Context.Ebx, "ecx", context.X86Context.Ecx); - ExtOut(outputFormat3, "edx", context.X86Context.Edx, "esi", context.X86Context.Esi, "edi", context.X86Context.Edi); + ExtOut(outputFormat3.c_str(), "esp", context.X86Context.Esp, "ebp", context.X86Context.Ebp, "eip", context.X86Context.Eip); + ExtOut(outputFormat3.c_str(), "eax", context.X86Context.Eax, "ebx", context.X86Context.Ebx, "ecx", context.X86Context.Ecx); + ExtOut(outputFormat3.c_str(), "edx", context.X86Context.Edx, "esi", context.X86Context.Esi, "edi", context.X86Context.Edi); } #endif #if defined(SOS_TARGET_ARM) @@ -11077,13 +11077,13 @@ class ClrStackImpl String outputFormat3 = " %3s=%08x %3s=%08x %3s=%08x\n"; String outputFormat2 = " %s=%08x %s=%08x\n"; String outputFormat1 = " %s=%08x\n"; - ExtOut(outputFormat3, "r0", context.ArmContext.R0, "r1", context.ArmContext.R1, "r2", context.ArmContext.R2); - ExtOut(outputFormat3, "r3", context.ArmContext.R3, "r4", context.ArmContext.R4, "r5", context.ArmContext.R5); - ExtOut(outputFormat3, "r6", context.ArmContext.R6, "r7", context.ArmContext.R7, "r8", context.ArmContext.R8); - ExtOut(outputFormat3, "r9", context.ArmContext.R9, "r10", context.ArmContext.R10, "r11", context.ArmContext.R11); - ExtOut(outputFormat1, "r12", context.ArmContext.R12); - ExtOut(outputFormat3, "sp", context.ArmContext.Sp, "lr", context.ArmContext.Lr, "pc", context.ArmContext.Pc); - ExtOut(outputFormat2, "cpsr", context.ArmContext.Cpsr, "fpscr", context.ArmContext.Fpscr); + ExtOut(outputFormat3.c_str(), "r0", context.ArmContext.R0, "r1", context.ArmContext.R1, "r2", context.ArmContext.R2); + ExtOut(outputFormat3.c_str(), "r3", context.ArmContext.R3, "r4", context.ArmContext.R4, "r5", context.ArmContext.R5); + ExtOut(outputFormat3.c_str(), "r6", context.ArmContext.R6, "r7", context.ArmContext.R7, "r8", context.ArmContext.R8); + ExtOut(outputFormat3.c_str(), "r9", context.ArmContext.R9, "r10", context.ArmContext.R10, "r11", context.ArmContext.R11); + ExtOut(outputFormat1.c_str(), "r12", context.ArmContext.R12); + ExtOut(outputFormat3.c_str(), "sp", context.ArmContext.Sp, "lr", context.ArmContext.Lr, "pc", context.ArmContext.Pc); + ExtOut(outputFormat2.c_str(), "cpsr", context.ArmContext.Cpsr, "fpscr", context.ArmContext.Fpscr); } #endif #if defined(SOS_TARGET_ARM64) @@ -11109,17 +11109,17 @@ class ClrStackImpl { foundPlatform = true; String outputFormat3 = " %3s=%016llx %3s=%016llx %3s=%016llx\n"; - ExtOut(outputFormat3, "r0", context.RiscV64Context.R0, "ra", context.RiscV64Context.Ra, "sp", context.RiscV64Context.Sp); - ExtOut(outputFormat3, "gp", context.RiscV64Context.Gp, "tp", context.RiscV64Context.Tp, "t0", context.RiscV64Context.T0); - ExtOut(outputFormat3, "t1", context.RiscV64Context.T1, "t2", context.RiscV64Context.T2, "fp", context.RiscV64Context.Fp); - ExtOut(outputFormat3, "s1", context.RiscV64Context.S1, "a0", context.RiscV64Context.A0, "a1", context.RiscV64Context.A1); - ExtOut(outputFormat3, "a2", context.RiscV64Context.A2, "a3", context.RiscV64Context.A3, "a4", context.RiscV64Context.A4); - ExtOut(outputFormat3, "a5", context.RiscV64Context.A5, "a6", context.RiscV64Context.A6, "a7", context.RiscV64Context.A7); - ExtOut(outputFormat3, "s2", context.RiscV64Context.S2, "s3", context.RiscV64Context.S3, "s4", context.RiscV64Context.S4); - ExtOut(outputFormat3, "s5", context.RiscV64Context.S5, "s6", context.RiscV64Context.S6, "s7", context.RiscV64Context.S7); - ExtOut(outputFormat3, "s8", context.RiscV64Context.S8, "s9", context.RiscV64Context.S9, "s10", context.RiscV64Context.S10); - ExtOut(outputFormat3, "s11", context.RiscV64Context.S11, "t3", context.RiscV64Context.T3, "t4", context.RiscV64Context.T4); - ExtOut(outputFormat3, "t5", context.RiscV64Context.T5, "t6", context.RiscV64Context.T6, "pc", context.RiscV64Context.Pc); + ExtOut(outputFormat3.c_str(), "r0", context.RiscV64Context.R0, "ra", context.RiscV64Context.Ra, "sp", context.RiscV64Context.Sp); + ExtOut(outputFormat3.c_str(), "gp", context.RiscV64Context.Gp, "tp", context.RiscV64Context.Tp, "t0", context.RiscV64Context.T0); + ExtOut(outputFormat3.c_str(), "t1", context.RiscV64Context.T1, "t2", context.RiscV64Context.T2, "fp", context.RiscV64Context.Fp); + ExtOut(outputFormat3.c_str(), "s1", context.RiscV64Context.S1, "a0", context.RiscV64Context.A0, "a1", context.RiscV64Context.A1); + ExtOut(outputFormat3.c_str(), "a2", context.RiscV64Context.A2, "a3", context.RiscV64Context.A3, "a4", context.RiscV64Context.A4); + ExtOut(outputFormat3.c_str(), "a5", context.RiscV64Context.A5, "a6", context.RiscV64Context.A6, "a7", context.RiscV64Context.A7); + ExtOut(outputFormat3.c_str(), "s2", context.RiscV64Context.S2, "s3", context.RiscV64Context.S3, "s4", context.RiscV64Context.S4); + ExtOut(outputFormat3.c_str(), "s5", context.RiscV64Context.S5, "s6", context.RiscV64Context.S6, "s7", context.RiscV64Context.S7); + ExtOut(outputFormat3.c_str(), "s8", context.RiscV64Context.S8, "s9", context.RiscV64Context.S9, "s10", context.RiscV64Context.S10); + ExtOut(outputFormat3.c_str(), "s11", context.RiscV64Context.S11, "t3", context.RiscV64Context.T3, "t4", context.RiscV64Context.T4); + ExtOut(outputFormat3.c_str(), "t5", context.RiscV64Context.T5, "t6", context.RiscV64Context.T6, "pc", context.RiscV64Context.Pc); } #endif #if defined(SOS_TARGET_LOONGARCH64) @@ -11127,17 +11127,17 @@ class ClrStackImpl { foundPlatform = true; String outputFormat3 = " %3s=%016llx %3s=%016llx %3s=%016llx\n"; - ExtOut(outputFormat3, "r0", context.LoongArch64Context.R0, "ra", context.LoongArch64Context.Ra, "tp", context.LoongArch64Context.Tp); - ExtOut(outputFormat3, "sp", context.LoongArch64Context.Sp, "a0", context.LoongArch64Context.A0, "a1", context.LoongArch64Context.A1); - ExtOut(outputFormat3, "a2", context.LoongArch64Context.A2, "a3", context.LoongArch64Context.A3, "a4", context.LoongArch64Context.A4); - ExtOut(outputFormat3, "a5", context.LoongArch64Context.A5, "a6", context.LoongArch64Context.A6, "a7", context.LoongArch64Context.A7); - ExtOut(outputFormat3, "t0", context.LoongArch64Context.T0, "t1", context.LoongArch64Context.T1, "t2", context.LoongArch64Context.T2); - ExtOut(outputFormat3, "t3", context.LoongArch64Context.T3, "t4", context.LoongArch64Context.T4, "t5", context.LoongArch64Context.T5); - ExtOut(outputFormat3, "t6", context.LoongArch64Context.T6, "t7", context.LoongArch64Context.T7, "t8", context.LoongArch64Context.T8); - ExtOut(outputFormat3, "x0", context.LoongArch64Context.X0, "fp", context.LoongArch64Context.Fp, "s0", context.LoongArch64Context.S0); - ExtOut(outputFormat3, "s1", context.LoongArch64Context.S1, "s2", context.LoongArch64Context.S2, "s3", context.LoongArch64Context.S3); - ExtOut(outputFormat3, "s4", context.LoongArch64Context.S4, "s5", context.LoongArch64Context.S5, "s6", context.LoongArch64Context.S6); - ExtOut(outputFormat3, "s7", context.LoongArch64Context.S7, "s8", context.LoongArch64Context.S8, "pc", context.LoongArch64Context.Pc); + ExtOut(outputFormat3.c_str(), "r0", context.LoongArch64Context.R0, "ra", context.LoongArch64Context.Ra, "tp", context.LoongArch64Context.Tp); + ExtOut(outputFormat3.c_str(), "sp", context.LoongArch64Context.Sp, "a0", context.LoongArch64Context.A0, "a1", context.LoongArch64Context.A1); + ExtOut(outputFormat3.c_str(), "a2", context.LoongArch64Context.A2, "a3", context.LoongArch64Context.A3, "a4", context.LoongArch64Context.A4); + ExtOut(outputFormat3.c_str(), "a5", context.LoongArch64Context.A5, "a6", context.LoongArch64Context.A6, "a7", context.LoongArch64Context.A7); + ExtOut(outputFormat3.c_str(), "t0", context.LoongArch64Context.T0, "t1", context.LoongArch64Context.T1, "t2", context.LoongArch64Context.T2); + ExtOut(outputFormat3.c_str(), "t3", context.LoongArch64Context.T3, "t4", context.LoongArch64Context.T4, "t5", context.LoongArch64Context.T5); + ExtOut(outputFormat3.c_str(), "t6", context.LoongArch64Context.T6, "t7", context.LoongArch64Context.T7, "t8", context.LoongArch64Context.T8); + ExtOut(outputFormat3.c_str(), "x0", context.LoongArch64Context.X0, "fp", context.LoongArch64Context.Fp, "s0", context.LoongArch64Context.S0); + ExtOut(outputFormat3.c_str(), "s1", context.LoongArch64Context.S1, "s2", context.LoongArch64Context.S2, "s3", context.LoongArch64Context.S3); + ExtOut(outputFormat3.c_str(), "s4", context.LoongArch64Context.S4, "s5", context.LoongArch64Context.S5, "s6", context.LoongArch64Context.S6); + ExtOut(outputFormat3.c_str(), "s7", context.LoongArch64Context.S7, "s8", context.LoongArch64Context.S8, "pc", context.LoongArch64Context.Pc); } #endif From e1ca94a3b8d62ddfbce063656e25329828f80a30 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:54:44 +0000 Subject: [PATCH 10/10] Update Format conversion operator comments to reflect std::string requirements Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> --- src/SOS/Strike/util.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index 8ae309735c..f778ca3446 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -621,8 +621,9 @@ namespace Output } /* Converts this object into a Wide char string. This allows you to write the following code: - * WString foo = L"bar " + ObjectPtr(obj); + * WString foo = L"bar " + WString(ObjectPtr(obj)); * Where ObjectPtr is a subclass/typedef of this Format class. + * Note: With std::basic_string, explicit WString() wrapping is required for concatenation. */ operator WString() const { @@ -638,8 +639,9 @@ namespace Output } /* Converts this object into a String object. This allows you to write the following code: - * String foo = "bar " + ObjectPtr(obj); + * String foo = "bar " + String(ObjectPtr(obj)); * Where ObjectPtr is a subclass/typedef of this Format class. + * Note: With std::string, explicit String() wrapping is required for concatenation. */ operator String() const {