public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Edgar Mobile <heideggm@hotmail.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Problem setting a breakpoint with command in gdbinit
Date: Wed, 2 Feb 2022 16:01:11 +0000	[thread overview]
Message-ID: <DM8PR16MB4357DF0A8678CD04B01BD323C7279@DM8PR16MB4357.namprd16.prod.outlook.com> (raw)

Greetings,

I try to set a silent breakpoint with commands via .gdbinit like this:


define breakXOpenDisplayRun
set pagination off
break XOpenDisplay
commands
  silent
  info locals
  bt full
  cont
end
run
end

Then I call my application like this:


gdb -q -ex breakXOpenDisplayRun ./myapp

The breakpoint is set and the application starts. However, when it encounters the breakpoint the first time it doesn't execute the command silently but stops there. Entering "continue" will continue with debugging and after that point it works.
If I start up GDB manually, then execute breakXOpenDisplayRun and run manually everything works fine.

What can I do?

GDB Version is 8.1.0.20180409-git for Ubuntu Linux 18.04   AMD64.

Regards

             reply	other threads:[~2022-02-02 16:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 16:01 Edgar Mobile [this message]
2022-02-02 17:51 ` Andrew Burgess

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=DM8PR16MB4357DF0A8678CD04B01BD323C7279@DM8PR16MB4357.namprd16.prod.outlook.com \
    --to=heideggm@hotmail.com \
    --cc=gdb@sourceware.org \
    /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).