Community
Participate
Working Groups
With DSF-GDB, GDB starts off by using the directory in which you started eclipse. This is where gdb will expect to find the .gdbinit file. Right after, we change the working directory, using -environment-cd, based on what is specified in the launch Environment tab. CDI does it a little bit differently and (using --cd and --command) effectively sets the working directory first, then reads .gdbinit. My first thought is that being dependent on where eclipse was started to find the .gdbinit file is a bad thing. We should first do -environment-cd then source .gdbinit. This will require a small re-ordering of steps in the FinalLaunchSequence
Created attachment 175520 [details] Proposed fix Here is the fix which does the -environment-cd first then source .gdbinit.
Committed to HEAD and 7_0 branch.
Elena, since you are knee deep in the FinalLaunchSequence, can you review this simple change?
CCing Elena for review
*** cdt cvs genie on behalf of mkhouzam *** Bug 321259: Need to set environment dir before sourcing init file, so that we look for the init file in the right place [*] FinalLaunchSequence.java 1.12 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java?root=Tools_Project&r1=1.11&r2=1.12 [*] FinalLaunchSequence.java 1.11.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java?root=Tools_Project&r1=1.11&r2=1.11.2.1
Created attachment 175525 [details] Fix for GDBJtagDSFFinalLaunchSequence This is the same fix but for GDBJtagDSFFinalLaunchSequence, which has copied FinalLaunchSequence. I've committed it to HEAD only since I can't test it myself and I don't feel safe putting it in 7_0
*** cdt cvs genie on behalf of mkhouzam *** Bug 321259: Need to set environment dir before sourcing init file, so that we look for the init file in the right place [*] GDBJtagDSFFinalLaunchSequence.java 1.11 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java?root=Tools_Project&r1=1.10&r2=1.11
reviewed - you just swapped two steps. Good catch about JTag I would have forgot about it. If fix FLS it would be change only in one place next time hopefully.
I think it is safe to put on 7.0
(In reply to comment #9) > I think it is safe to put on 7.0 I got a mid-air collision asking if you though it was safe for 7_0 :-) Committed to 7_0.
*** cdt cvs genie on behalf of mkhouzam *** Bug 321259: Need to set environment dir before sourcing init file to make sure we look for the init file in the right place. [*] GDBJtagDSFFinalLaunchSequence.java 1.10.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java?root=Tools_Project&r1=1.10&r2=1.10.2.1