Community
Participate
Working Groups
Build Identifier: I20100608-0911 This problem was in the CDI debugger also, but was fixed by https://bugs.eclipse.org/bugs/show_bug.cgi?id=244193 There is no variable substitution performed on the gdb command given by the user. When sharing launch configurations, it would be useful to be able to give the gdb command as .e.g ${GDB_PATH}/gdb so that different users can have gdb installed in different locations, without relying on the gdb executable being on the system PATH. A patch is attached that calls the VariableManager to perform variable substitution on the command. This works for eclipse dynamic variables but not for environment variables. Reproducible: Always
Created attachment 177287 [details] Patch to perform variable substitution
Looks good. Wouldn't we want it to work with environment variables as well, or is it not the way Eclipse usually does things?
(In reply to comment #2) > Wouldn't we want it to work with environment variables as well, or is it not > the way Eclipse usually does things? That would probably be a good thing, but I did not have time to look into how to resolve environment variables.
FYI, you can use the dynamic variable "env_var" to resolve environment variables, e.g.: ${env_var:HOME} I am not sure, though, if this takes into account any custom environment of a launch config.
(In reply to comment #4) > FYI, you can use the dynamic variable "env_var" to resolve environment > variables, e.g.: ${env_var:HOME} > I am not sure, though, if this takes into account any custom environment of a > launch config. Nice trick! But it does not seem to work on Windows. I tried ${env_var:win_dir}\gdb and got the error of not being able to launch \gdb. I'll have to try it on Linux.
(In reply to comment #5) > (In reply to comment #4) > > FYI, you can use the dynamic variable "env_var" to resolve environment > > variables, e.g.: ${env_var:HOME} > > I am not sure, though, if this takes into account any custom environment of a > > launch config. > > Nice trick! But it does not seem to work on Windows. I tried > ${env_var:win_dir}\gdb and got the error of not being able to launch \gdb. > I'll have to try it on Linux. Sorry, it _does_ work on windows (the env var is $windir instead of $win_dir) I think this is a good enough solution. Thanks!
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > FYI, you can use the dynamic variable "env_var" to resolve environment > > > variables, e.g.: ${env_var:HOME} > > > I am not sure, though, if this takes into account any custom environment of a launch config. Oh, and no, it does not take the custom environment of a launch config, which makes sense since it is the actual launch code that has to push this updated environment to the debug session. I committed the patch to HEAD. Thanks Hans-Erik.
Fixed
*** cdt cvs genie on behalf of mkhouzam *** Bug 323466: Allow for dynamic variables in gdb patch within the launch. [*] LaunchUtils.java 1.15 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java?root=Tools_Project&r1=1.14&r2=1.15