| Summary: | [launch][cdi]Can not use dynamic variables in DSF/GDB command | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Hans-Erik Floryd <hef-cdt> | ||||
| Component: | cdt-debug-dsf-gdb | Assignee: | Marc Khouzam <marc.khouzam> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Marc Khouzam <marc.khouzam> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | aleherb+eclipse, pawel.1.piech | ||||
| Version: | 7.0 | ||||||
| Target Milestone: | 8.0 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Hans-Erik Floryd
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 |