0

I am writing a batch file for the gdb debugger. I run the gdb process but I want to know how to pass the parameters to the gdb process from the batch file. Here is my sample batch file:

@echo off        
cd /d "c:\MinGW\bin\"
set PATH=c:\MinGW\bin\
echo %PATH%
gcc -g start.c -o start.exe

gdb start.exe
gdb > set logging file output.txt
gdb > b 1
pause

As shown above when I start gdb for start.exe, I need to pass the set logging file and breakpoint parameters to it via the batch file. But above code is not working. Please help me on this.

nerd
  • 339
  • 1
  • 5
  • 16
  • possible duplicate of [How do I run a program with commandline args using gdb within a bash script?](http://stackoverflow.com/questions/6121094/how-do-i-run-a-program-with-commandline-args-using-gdb-within-a-bash-script) – josh poley Jun 04 '14 at 18:56
  • @joshpoley that seems to be for bash script. I needed a method for batch script. – nerd Jun 04 '14 at 20:22
  • Linked page shows how to pass multiple commands via a file on the command line, it should work the same from a Windows batch file vs a bash script. – josh poley Jun 04 '14 at 22:16

0 Answers0