@@ -142,19 +142,17 @@ private void LaunchInGdbDebugger(string file)
142142 // this affects the number of bytes the engine reads when disassembling commands,
143143 // x64 has the largest maximum command size, so it should be safe to use for x86 as well
144144 writer . WriteAttributeString ( "TargetArchitecture" , "x64" ) ;
145-
146- // GDB engine expects to find a shell on the other end of the pipe, so the first thing it sends over is "gdb --interpreter=mi",
147- // (which GDB complains about, since this isn't a valid command).
148- // Since we are launching GDB directly, here we create a noop alias for "gdb" to make the error message go away.
149- writer . WriteElementString ( "Command" , "alias -a gdb=echo" ) ;
145+
146+ writer . WriteStartElement ( "SetupCommands" ) ;
150147 // launch debuggee in a new console window
151- writer . WriteElementString ( "Command" , "set new-console on" ) ;
148+ writer . WriteElementString ( "Command" , "-gdb- set new-console on" ) ;
152149 if ( ! string . IsNullOrEmpty ( debugConfig . DebuggerScript ) )
153150 {
154151 foreach ( string cmd in debugConfig . DebuggerScript . Split ( '\r ' , '\n ' ) )
155152 if ( ! string . IsNullOrEmpty ( cmd ) )
156153 writer . WriteElementString ( "Command" , cmd ) ;
157154 }
155+ writer . WriteEndElement ( ) ;
158156
159157 writer . WriteEndElement ( ) ;
160158 }
@@ -163,7 +161,9 @@ private void LaunchInGdbDebugger(string file)
163161 VsDebugTargetProcessInfo [ ] results = new VsDebugTargetProcessInfo [ targets . Length ] ;
164162
165163 IVsDebugger4 vsDebugger = ( IVsDebugger4 ) project . GetService ( typeof ( SVsShellDebugger ) ) ;
166- vsDebugger . LaunchDebugTargets4 ( ( uint ) targets . Length , targets , results ) ;
164+ vsDebugger . LaunchDebugTargets4 ( ( uint ) targets . Length , targets , results ) ;
165+ var commandWnd = ( IVsCommandWindow ) project . GetService ( typeof ( SVsCommandWindow ) ) ;
166+ commandWnd . ExecuteCommand ( "alias gdb Debug.VRDebugExec" ) ;
167167 }
168168
169169 private string GuessArchitecture ( )
0 commit comments