public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb@sourceware.org
Cc: Smith John <horserivers@gmail.com>
Subject: Re: what is the "-ex" command option?
Date: Sat, 11 Aug 2012 15:59:00 -0000	[thread overview]
Message-ID: <201208111159.16332.vapier@gentoo.org> (raw)
In-Reply-To: <CAJR88piaQxZMhz6KD-eBh50sQpA39w0wZxyByhz34eXnsKYgBg@mail.gmail.com>

[-- Attachment #1: Type: Text/Plain, Size: 698 bytes --]

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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-08-11 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-11  7:33 Smith John
2012-08-11 15:59 ` Mike Frysinger [this message]
2012-08-11 16:20   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201208111159.16332.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb@sourceware.org \
    --cc=horserivers@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).