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?

0
17 comments

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.

0

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?

0

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!

0

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 ?

0

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!

0

Dmitry Kazantsev  thanks for answer!
(I saw the blog post) but still got this result:

Key is struct FKey from InputCoreTypes.h

 

 

0

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!

0

As mentioned in first post: 
 

ue 5.4.3

Removing .dll does not solve issue

0
Hello Piotr,

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!
0

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:
 

0
Hello Piotr,

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!
0
Additional note: earlier I was checking on MacOS, where Params.Key.KeyName.ToString() does evaluate. However, it doesn't evaluate on Windows, neither in Rider nor in Visual Studio (with 5.4.4 installed via launcher)
0

There is a comparison of evaluating same expressions:
One is from MacOS (where it evaluates), and another is from Windows:

0

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!

1

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 of ToString() 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 hence InputCore, not FName::ToString, guessing the name-to-string conversion is the problem?
 

0

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"

 

0

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!

0

Please sign in to leave a comment.