Closed bruno-garcia closed 4 years ago
No, that's weird because the code doing this should go through that:
I see. It might be due to my setup. The repro is here: https://github.com/getsentry/symbol-collector/pull/7
Basically it's an Xamarin Android app which I expect to run on devices as low as Android 5 (API 21).
But to use your library I need to target API 29 (Android 10 aka Q).
I'm running this on an Android 5 emulator, although Xamarin Android 10 support netstandard2.1
maybe that's the reason.
I don't know, have you tried on desktop already? PR welcome!
If I'm able to use netstandard2.1
I plan to move from ELFSharp
over which means writing Mach-O support and a less hacky impl for Fat Mach-O which I hacked in-repo so far to get things moving.
Closing as TryRead doesn't throw an exception when an invalid file is passed (as per commit dc6a604)
Just to update you on this one.
I've copied the file out the Android (emulator) ran the same code against the same file on a .NET Core 3.1 console app and it works as expected.
So as suspected, the problem only happens when running on an Xamarin.Android 10 (API 29).
It's supposed to support netstandard2.1
though so maybe I'll investigate further and perhaps raise this to the Xamarin team.
@bruno-garcia It would make sense to test it on regular Mono on desktop since that's easier to debug than Xamarin and it uses the same code base for class libraries.
~I have mono but it won't help Tests do process.start on stuff I don't have on a Mac.~
Sorry I thought it was about another issue. I believe the problem is other. Didn't finish investigating but there's a PR #8
Firstly let me thank you for deciding to open source this.
Is it intentionally that
ElfObjectFile.TryRead
throws? I'm enumerating a whole directory and calling that hoping that it'll just returnfalse
to non ELF files. But instead I got:Is this the expected behavior?