public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Problem setting a breakpoint with command in gdbinit
@ 2022-02-02 16:01 Edgar Mobile
  2022-02-02 17:51 ` Andrew Burgess
  0 siblings, 1 reply; 2+ messages in thread
From: Edgar Mobile @ 2022-02-02 16:01 UTC (permalink / raw)
  To: gdb

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-02 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 16:01 Problem setting a breakpoint with command in gdbinit Edgar Mobile
2022-02-02 17:51 ` Andrew Burgess

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).