Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 308516

Summary: The gdb directory argument (--cd) is always the project path
Product: [Tools] CDT Reporter: Marc-André Laperle <malaperle>
Component: cdt-debug-cdi-gdbAssignee: Marc-André Laperle <malaperle>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: pawel.1.piech
Version: 7.0Flags: malaperle: review? (elaskavaia.cdt)
Target Milestone: 8.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Get the working dir from the LaunchConfiguration malaperle: iplog-

Description Marc-André Laperle CLA 2010-04-08 12:31:17 EDT
CDI specifies the gdb directory at the command line (--cd) but the directory is always the project path. Here's an example:

Working directory in Debug configuration: /Users/xyz/project/Debug

gdb starts with the command:

/usr/xyz/gdb -q -nw -i mi2 -tty /dev/ttyp0 --cd="/Users/xyz/project"
--command=.gdbinit /Users/xyz/project/Debug/executable

Once started, the directory is changed correctly using the CLI command "cd" or the MI command "-environment-cd". 

This is redundant and can cause problems. On Mac, the library symbols are loaded at the same time of the executable so if a library has an install name using a relative path, the library will not be found since the correct directory will not be set yet.
Comment 1 Marc-André Laperle CLA 2010-04-09 00:10:09 EDT
Created attachment 164335 [details]
Get the working dir from the LaunchConfiguration
Comment 2 Marc-André Laperle CLA 2010-07-09 12:51:28 EDT
Can someone take a look? It's a pretty simple patch. Thanks!
Comment 3 Marc-André Laperle CLA 2011-03-07 22:16:15 EST
Fixed in HEAD.
Comment 4 CDT Genie CLA 2011-03-07 22:23:27 EST
*** cdt cvs genie on behalf of mlaperle ***
Bug 308516 - The gdb directory argument (--cd) is always the project path. Get attribute from launch configuration instead.

[*] GDBCDIDebugger2.java 1.17 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBCDIDebugger2.java?root=Tools_Project&r1=1.16&r2=1.17
Comment 5 Marc-André Laperle CLA 2011-03-07 22:26:23 EST
Alena, I believe you have some experience with cdi-gdb. Could you review the
change? It is not a lot of code.