This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: what is the "-ex" command option?


On Saturday 11 August 2012 03:33:26 Smith John wrote:
>     when debugging using gdb , what  is  the   use  of   "-ex"  command
> option?

$ gdb --help | grep -e--eval-command -A 3
  --eval-command=COMMAND, -ex
                     Execute a single GDB command.
                     May be used multiple times and in conjunction
                     with --command.

$ echo 'main(){}' | gcc -x c - -g -o a.out

$ gdb -ex 'break main' -ex run ./a.out
Reading symbols from /home/vapier/a.out...done.
Breakpoint 1 at 0x4004c8: file <stdin>, line 1.
Starting program: /home/vapier/a.out 

Breakpoint 1, main () at <stdin>:1
1       <stdin>: No such file or directory.
(gdb) 
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]