From 90e870294f9eb8d1624e75910e09a5c9c6b55a37 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Fri, 17 Jan 2003 15:12:05 +0000 Subject: [PATCH] Get the cwd and gdbinit location. --- .../org/eclipse/cdt/debug/mi/core/GDBDebugger.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java index 95e6484594d..15b4b5a1d98 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java @@ -38,7 +38,9 @@ public class GDBDebugger implements ICDebugger { public ICDISession createLaunchSession(ILaunchConfiguration config, IFile exe) throws CDIException { try { String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); - CSession session = (CSession)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toOSString()); + String cwd = exe.getProject().getLocation().toOSString(); + String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); + CSession session = (CSession)MIPlugin.getDefault().createCSession(cwd, gdbinit, gdb, exe.getLocation().toOSString()); initializeLibraries(config, session); return session; } catch (IOException e) { @@ -53,7 +55,9 @@ public class GDBDebugger implements ICDebugger { public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException { try { String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); - CSession session = (CSession)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toOSString(), pid, null); + String cwd = exe.getProject().getLocation().toOSString(); + String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); + CSession session = (CSession)MIPlugin.getDefault().createCSession(cwd, gdbinit, gdb, exe.getLocation().toOSString(), pid, null); initializeLibraries(config, session); return session; } catch (IOException e) { @@ -69,7 +73,9 @@ public class GDBDebugger implements ICDebugger { public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile) throws CDIException { try { String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); - CSession session = (CSession)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toOSString(), corefile.toOSString()); + String cwd = exe.getProject().getLocation().toOSString(); + String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); + CSession session = (CSession)MIPlugin.getDefault().createCSession(cwd, gdbinit, gdb, exe.getLocation().toOSString(), corefile.toOSString()); initializeLibraries(config, session); return session; } catch (IOException e) {