-
Notifications
You must be signed in to change notification settings - Fork 35
Add XBOX support. #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add XBOX support. #183
Conversation
| if (showNativeCrashesSettings) | ||
| { | ||
| #if UNITY_STANDALONE_WIN | ||
| #if UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you use it anywhere?
| #elif UNITY_STANDALONE_OSX | ||
| string.Format("~/Library/Logs/{0}/{1}/Player.log", Application.companyName, Application.productName); | ||
| #elif UNITY_STANDALONE_WIN | ||
| #elif UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure Unity logs are available in this path on Xbox?
Runtime/Native/XBOX/NativeClient.cs
Outdated
|
|
||
| internal class NativeClient : NativeClientBase, INativeClient | ||
| { | ||
| [DllImport("breakpad_xbox_simplified_abi_mt.dll")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure breakpad_xbox_simplified name is a good idea for a library that our users will add to the code? Wouldn't it be better if we name it backtrace-xbox or backtrace-unity-xbox?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not. It's "simplified ABI" since the dll only exposes a few basic functions, C-style (undecorated ABI), which is different from the full Breakpad library.
I am open to changing the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can hide what is this because I'm not sure if this is important to share that this is c-style library. I think it's not from the end user perspective. How about: backtrace-unity-xbox ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This library could be used from other game engines as well. I would rather not package the same library several times just by changing the name.
| internal class NativeClient : NativeClientBase, INativeClient | ||
| { | ||
| [DllImport("breakpad_xbox_simplified_abi_mt.dll")] | ||
| private static extern bool BacktraceCrash(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to start every method in "Backtrace" library with prefix "Backtrace"? I think it is obvious enough if we call it "Crash"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DLL exposes undecorated symbols, C-style. It's idiomatic to namespace them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah but the dll is alerady backtrace dll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not the issue. C does not have namespaces. If we have a method Initialize() in our DLL, and another DLL exposes the same method, they will clash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but you call the dll directly based on the dll name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's a hard requirement for you, I can do it. But IMO it's better to offer one generic library that we could reuse in other projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's still can be generic, right? We can share the library with a note it's an abi_mt library. We don't need to show in our code we use breakpad or this is the "simplify" the library. If we switch to other crash reporter for any reason someone will have more manual work to do. Can we just rename it to backtrace-xbox?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm of two minds here. We actually offer multiple versions of Breakpad because some customers use mt/md libraries.
Runtime/Native/XBOX/NativeClient.cs
Outdated
| ); | ||
|
|
||
| [DllImport("breakpad_xbox_simplified_abi_mt.dll")] | ||
| private static extern bool BacktraceBreakpadInitialized(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you use it anywhere?
Runtime/Native/XBOX/NativeClient.cs
Outdated
|
|
||
| if (!CaptureNativeCrashes) | ||
| { | ||
| Debug.LogWarning("Backtrace native integration status: Cannot initialize Crashpad client"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crashpad client is not a good name - can we rename it to xbox native integration or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-paste error, absolutely
Runtime/Native/XBOX/NativeClient.cs
Outdated
|
|
||
| public void HandleAnr() | ||
| { | ||
| throw new NotImplementedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support ANR for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we don't - why do we respect ANR behavior in the constructor by filtering error types? We need to be sure the use cannot setup it.
Runtime/Native/XBOX/NativeClient.cs
Outdated
|
|
||
| public void GetAttributes(IDictionary<string, string> attributes) | ||
| { | ||
| throw new NotImplementedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the value in implementing this method, but can do so. But it'll require additional implementation on the C-side and the hassle of marshalling the data through C-strings, for very dubious (IMO) gain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah but leaving not implemented exception is not something that our users want to see
Runtime/Native/XBOX/NativeClient.cs
Outdated
|
|
||
| public bool OnOOM() | ||
| { | ||
| throw new NotImplementedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support OOM for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but not implemented exception is not something that our users want to see - they expect to have the same behavior like in any other our integration
| } | ||
|
|
||
| #if UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN | ||
| #if UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove it?
| } | ||
|
|
||
| #if UNITY_STANDALONE_WIN | ||
| #if UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove it?
| get | ||
| { | ||
| #if UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN | ||
| #if UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove it?
| { | ||
|
|
||
| #if UNITY_STANDALONE_WIN | ||
| #if UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove it?
Please note: the proprietary XBOX dll is not included in this commit and is only available to verified customers.