-
Notifications
You must be signed in to change notification settings - Fork 31
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
Smoother debug program default for Windows OS #152
Smoother debug program default for Windows OS #152
Conversation
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 copyright part needs to be fixed before I can merge.
Other comments are optional and not blockers.
@@ -0,0 +1,43 @@ | |||
/********************************************************************* | |||
* Copyright (c) 2018 Red Hat Inc. and others. |
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.
As far as know, you're not working for Red Hat, so the copyright here is invalid.
I guess it should mention Fraunhofer (if you do it in the scope of your employment) or your name (if you do it on your own and your work contract allows you to keep IP on this).
*/ | ||
class DebugUtil { | ||
|
||
public static final boolean IS_WINDOWS = Platform.getOS().equals(Platform.OS_WIN32); |
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 it used any place else, so it should be private.
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.
Also, there is only one occurence of this, so it doesn't seem profitable to declare it and it could as well be directly inlined on line 40.
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.
Yes it should be private, but inlining would cause the evaluation on every call which seems to be unnecessary, especially since the OS won't change between calls.
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.
On the other hand, it retains the memory size of a boolean permanently for an operation that user runs not so frequently. So it's a matter of preference. Given that memory consumption is more visible than an extra string comparison on every run (not perceivable by end-user as cost of UI rendering >>> cost of a string compare), I'd favor the re-evaluation over the storage.
But that's nitpicking ;)
* Computing the default executable path on Windows now returns a path with the ".exe" suffix. This heuristic approach falls short when a rust toolchain for a different platform is selected (for cross- compilation). In future the location could be determined by the currently selected rust toolchain. * Added a null-check to prevent a NullPointerException on non-existent workspace resources. This exception would silently be swallowed without feedback to the user. Signed-off-by: Max Bureck <[email protected]>
520a7f7
to
a3e1f40
Compare
Thank you! |
Unfortunately this does not fix the Problem that rust does not ship a working version of the rust-gdb wrapper for Windows, but this is a more difficult issue and I am not convinced a workaround should be put into Corrosion.
Computing the default executable path on Windows now returns a path
with the ".exe" suffix. This heuristic approach falls short when a
rust toolchain for a different platform is selected (for cross-
compilation). In future the location could be determined by the
currently selected rust toolchain.
Added a null-check to prevent a NullPointerException on non-existent
workspace resources. This exception would silently be swallowed
without feedback to the user.
Signed-off-by: Max Bureck [email protected]