Sysprogs forums › Forums › VisualGDB › Per-project host aliases?
- This topic has 7 replies, 2 voices, and was last updated 8 years, 2 months ago by BitFlipper.
-
AuthorPosts
-
August 25, 2016 at 18:26 #8920BitFlipperParticipant
I’m using host aliases, but this is per user. I need this to be per-project. I have a large number of custom shortcuts and various custom debug steps etc that rely on host aliases. However I have multiple instances of VS studio running from multiple different source code trees. I copy/paste the *.vgdbsettings file between these VS projects. If I need to customize the steps for each project individually, it would be quite time consuming since I then can’t use host aliases. Is there a way to define per-project host aliases?
Thanks for your help in advance.
August 26, 2016 at 05:48 #8924supportKeymasterHi,
You can try using the per-user variables (or environment variables). Simply replace the host name and user name in .vgdbsettings files with something like $(VariableName) or do the same via GUI. Let us know if you need more details.
September 5, 2016 at 20:03 #8977BitFlipperParticipantOK I’m not sure how I should do this. Say I have a custom shortcut that performs a lot different actions, with a typical action looking like this as displayed in its summary:
Run "some command" in directory "/bin" on MyDebugHost (alias)
So MyDebugHost is a global alias that is configured for a specific host. Now let’s say I have a second VS instance that has the same *.vgdbsettings file, with a few user variables changed between the different VS projects to customize for that specific instance. But all the actions in its custom shortcut are still the same. So if I run that custom shortcut on the 2nd VS instance, it will use the same target host, with no way to have each VS instance using a different target host (AFAICT).
The only way I can see is to create a second global host alias (say MyDebugHost2), and change all the actions in the 2nd VS instance’s VGDB settings to use MyDebugHost2. So this is the part that would be very time consuming.
Ideally, for each VC instance, I should just need to set one user variable like:
For VC instance 1:
DebugHostAlias=DebugHost1
…and for VC instance 2:
DebugHostAlias=DebugHost2
…where DebugHost1/2 etc are actual global host aliases. Then in the custom shortcut actions, I set DebugHostAlias as the host’s alias. However I can’t select DebugHostAlias as the target host in the actions since it isn’t really a global alias and hence doesn’t show up in the list of aliases.
So one way to make it work would be to allow typing of a host or user defined variable (that itself has a host alias for instance) name into the target computer field, as opposed to only allow selecting from the list only.
Let me know if there is a way to make it work.
Maybe one way to get close to what I need would be to just do a find/replace in each instance of the *.vgdbsettings files and set all aliases in each one to a different alias that way. Not as nice but at least that should work.
Thanks in advance for your help!
September 6, 2016 at 04:08 #8981supportKeymasterHi,
You can do this with environment variables as shown below:
September 6, 2016 at 07:56 #8984BitFlipperParticipantAh excellent, I’ll give that a try! Somehow I missed that.
September 10, 2016 at 19:19 #9029BitFlipperParticipantI finally got a chance to look into this issue again… It seems to work in most cases, for instance I can select “Main build machine” in custom actions for debug steps etc. This will then use the host I specified in the above dialog you show. However AFAICT, there is no way to select “Main build machine” in the actions for custom shortcuts. In order to do one time setup of the debug host, I created a custom shortcut that runs a bunch of custom actions. So I need to be able to select “Main build machine” in custom shortcut actions too.
The solution I came up with of doing a find/replace of the host alias to use in each *.vgdbsettings file seems to work OK for now so this isn’t a big issue anymore, but it would be nice if a custom shortcut action can also select the “Main build machine” in its list of host options.
September 11, 2016 at 18:47 #9034supportKeymasterHi,
That sounds easy to add. We should be able to add this to the upcoming v5.2 beta.
September 11, 2016 at 18:54 #9037BitFlipperParticipantExcellent, thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.