how to use conditional breakpoints for matching Unreal FString or FName?
I am having a hard time trying to put a conditional breakpoint to get a match for an Unreal String or Name. Is this broken or is there a proper way to do it?
Please sign in to leave a comment.
Hello Dhanesh Bavot,
Thank you for contacting us.
This is an issue in Rider's debugger, regrettably, conditional breakpoints do not work as expected for these types. This issue is reproducible in testing environment and I'm afraid I cannot suggest any workarounds.
Please follow RIDER-96699 to monitor progress. Apologies for the inconvenience.
Let me know if you have any questions.
Hello,
I saw in the linked Rider issue that a fix have been issued on ea release. But What about FName? FName itself contains no string data, its an integer. Without calling .GetName() you cant get the string value to compare. And afaik, you can not call methods in the conditional query. Any suggestions?
Hello Roze,
You can use ToString() on FName variable, so that you can compare FString. See the example.
If I misunderstood your question, please tell me.
Have a nice day!
Dmitry Kazantsev What am I doing wrong ?
- DebugGame Editor, editor with debug symbols installed from EGS, some c++ game project
- passed module as stated in: https://youtrack.jetbrains.com/issue/RIDER-99947/Rider-Debug-Never-worked-UE5-error-no-member-named-use-of-undeclared-identifier
- passed `L` since TEXT macro is not working: https://youtrack.jetbrains.com/issue/RIDER-96699/Rider-triggers-conditional-BPs-for-strings-regardless-of-evaluation-result
with TEXT macro:
ALSO: ❓ how one finds out which .dll is needed to be passed in ?
Hello Piotr,
We delivered several improvements to the native debugger in 2024.2, including an ability to compare strings:
Does it solve your problem, by chance?
Note: You might find this blogpost interesting: Unreal Debugging Improvements in Rider 2024.2.
Have a nice day!
Dmitry Kazantsev thanks for answer!
(I saw the blog post) but still got this result:
Key is struct FKey from InputCoreTypes.h
Hello Piotr,
When you are on that row (that you shown) during debug. The error message says “possibly due to compiler optimizations”. Do you debug the “Development” configuration?
Would you mind trying the “DebugGame | Editor” to see if that helps?
Please try the same as you shown, and additionally, please try just `Params.Key.ToString() == L"asdf"` (without specifying .dll), just step to the same line and try as I mentioned.
If that doesn't help, would you mind telling me if you have Editor Symbols for Debugging installed? What the UE version do you use?
Have a nice day!
As mentioned in first post:
ue 5.4.3
Removing .dll does not solve issue
Thank you for the clarification.
I see Params.Key.ToString() doesn't evaluate with the same error, but I see this works: Params.Key.KeyName.ToString().
Please try this: Params.Key.KeyName.ToString()==L"asdf", hope that helps.
Have a nice day!
but `KeyName` is private so shouldn't this be disallowed anyway ? can You please show me screen of this working for You?
and as mentioned before Params.Key.ToString whicha are publicly accessible are NOT working:
You are right, I verified this and see it doesn't work. I am checking it and will respond as soon as I have any update.
Have a nice day!
There is a comparison of evaluating same expressions:
One is from MacOS (where it evaluates), and another is from Windows:
Hello Piotr,
Please, try this for comparison during debug:
{,,UnrealEditor-InputCore.dll} Params.Key.ToString() == L"E"
.Unfortunately, it doesn't work for conditional breakpoints. We have already fixed this in the development branch. The fix will be available in 2024.3: RIDER-114815 Rider C++/LLDB: Conditional breakpoints don't work with the context operator.
Evaluation on windows depends on the context - frame, module (dll). Different dll have different available symbols for evaluation. Windows may lookup symbols only in current dll. If you want to lookup in another, you may use the context operator. VS has the same behavior. MacOS lldb lookups symbols everywhere. Therefore, it may find more symbols in any context.
That is why previous expressions evaluates on MacOS, but not in Windows.
Have a nice day!
Amazing, can't wait for the update to support easy comparisons, thanks so much for working on this!
I couldn't get this to work with
-InputCore.dll
but-Core.dll
seemed to do the trick:{,,UnrealEditor-Core.dll} MyName.ToString()
The comparison however still failed in my case of trying to check an object's name using{,,UnrealEditor-Core.dll} Obj->NamePrivate.ToString() == L"MyObject"
. The result ofToString()
seems to be empty?, and then I also get a warning when doing the string comparison. I'm in Rider 2024.2.3 on Windows.Edit: just realized you were using
FKey::ToString
henceInputCore
, notFName::ToString
, guessing the name-to-string conversion is the problem?Ah nevermind! I didn't realize FName comparison was also added, all that was needed was the .dll to be explicitly included. This works (but not in breakpoints):
{,,UnrealEditor-Core.dll} Obj->NamePrivate == L"MyObject"
Hello Bohdon,
I am glad to know comparison works. For the conditional breakpoints it is a known issue that is fixed in the upcoming 2024.3 (RIDER-114815 Rider C++/LLDB: Conditional breakpoints don't work with the context operator)
Have a nice day!