Skip to content
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 support for VcxprojUserFile.LocalDebuggerAttach #164

Merged
merged 3 commits into from
Jan 20, 2022
Merged

Conversation

firesgc
Copy link
Contributor

@firesgc firesgc commented Jan 18, 2022

In my project I hot reload DLL plugins, and for this reason I want to attach my debugger to a running executable instead of launching it.

The regression tests succeeded, I don't know if I have to provide anything else.
Thank you!

In my project I hot reload DLL plugins, and for this reason I want to attach my debugger to a running executable instead of launching it
@belkiss
Copy link
Contributor

belkiss commented Jan 18, 2022

Heya!

Thanks for the PR!

From a quick look it seems that this property expects a boolean, right?
If so, could the type in Project.Configuration be changed to bool instead of string?

@firesgc
Copy link
Contributor Author

firesgc commented Jan 19, 2022

Hey.

Thanks for the feedback and yes, you are right, it is a bool.

The reason I decided to treat it like a string is that the line is optional and I couldn't find anything "similar" to the RemoveLineTag for strings, but for bools.
I wanted to keep the change as small and simple as possible, but I could always write the line in the vcxproj.user file or I can implement a new system to handle this case.

What do you think about this?

@belkiss
Copy link
Contributor

belkiss commented Jan 20, 2022

I couldn't find anything "similar" to the RemoveLineTag for strings, but for bools.

I don't think we have anything of the sort, but I think you could make a getter that would return the bool as the string we want and use that from the template, something like

public bool LocalDebuggerAttach = false;
internal string LocalDebuggerAttachToString => LocalDebuggerAttach ? "true" : RemoveLineTag;

And in the template use [conf.VcxprojUserFile.LocalDebuggerAttachString].

Worth a shot :)

@firesgc
Copy link
Contributor Author

firesgc commented Jan 20, 2022

That looks like a good approach!

One small thing:
If "LocalDebuggerAttachString" is internal, I need to change the resolver.cs at Ln571, because right now it only looks for "BindingFlags.Instance | BindingFlags.Public" properties (via type.GetProperty(name) in Ln571).

Personally, I would prefer to just make "LocalDebuggerAttachString" public so I don't have to change the resolver (it doesn't have a setter, so there is no risk).

@belkiss
Copy link
Contributor

belkiss commented Jan 20, 2022

Personally, I would prefer to just make "LocalDebuggerAttachString" public so I don't have to change the resolver (it doesn't have a setter, so there is no risk).

Sounds good, I didn't remember what was browsed by the resolver ;)

@belkiss belkiss merged commit b061d7e into ubisoft:dev Jan 20, 2022
@belkiss
Copy link
Contributor

belkiss commented Jan 20, 2022

Merged, thanks!

@firesgc
Copy link
Contributor Author

firesgc commented Jan 20, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants