2

Does anybody know how so start gdb in emacs when the program requires command line arguments?

I am using this command to create my program

/home/cdim/Local/gcc-4.9.2/bin/gfortran -ffree-form -g ./utests/test_gdb.f -o test_gdb

1 Answer 1

3

Either start gdb (When M-x gdb prompts you for the debugger) with --args or just use the set args command of gdb in the *gud* emacs window (the GDB command window under Emacs).

6
  • I am going to Tools then Debugger (GDB). Let's start without arguments. Without arguments my program displays help information. I click on the run button and nothing happens. I get Undefined command: "-exec-run". Try "help".
    – Zeus
    Commented Dec 28, 2014 at 22:15
  • You have a GDB command window under Emacs. Find it, and type commands there. Commented Dec 28, 2014 at 22:16
  • I have a window gud-test_meidum.x
    – Zeus
    Commented Dec 28, 2014 at 22:19
  • I type run gdb test_meidum.x, then get the window, I type run and I get Undefined command: "-exec-run". Try "help".
    – Zeus
    Commented Dec 28, 2014 at 22:30
  • 1
    I was not using -i=mi. Putting it before the executable gets me to gdb and I can run the program using run in the window.
    – Zeus
    Commented Dec 28, 2014 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.