From: Philippe Waroquiers via Gdb-patches <gdb-patches@sourceware.org>
To: "周春明(日月)" <riyue.zcm@alibaba-inc.com>,
"Simon Marchi" <simon.marchi@polymtl.ca>,
Gdb-patches
<gdb-patches-bounces+riyue.zcm=alibaba-inc.com@sourceware.org>,
gdb-patches <gdb-patches@sourceware.org>
Subject: Re: How to combine two GDB commands into one
Date: Tue, 28 Sep 2021 23:18:55 +0200 [thread overview]
Message-ID: <08e408898e2d476ec4d185e0bc112c1faa10e3a6.camel@skynet.be> (raw)
In-Reply-To: <9bd8f786-daaa-47d5-a4a1-926fdd3f7137.riyue.zcm@alibaba-inc.com>
On Tue, 2021-09-28 at 18:24 +0800, 周春明(日月) via Gdb-patches wrote:
> Dear GDB experts,
>
> I have a request, in some scene, I want to "set scheduler-locking on", then "next", then "scheduler-locking off",
> Can I combine the three commands into one?
>
> Thanks,
> -Riyue
In your .gdbinit, something like:
define schedlock-next
set scheduler-locking on
next
set scheduler-locking off
end
and then the newly defined schedlock-next command should do what you want.
See e.g. https://sourceware.org/gdb/current/onlinedocs/gdb/Sequences.html#Sequences
for more details.
You can also extend GDB using python or guile.
Philippe
next prev parent reply other threads:[~2021-09-28 21:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 10:24 周春明(日月) via Gdb-patches
2021-09-28 21:18 ` Philippe Waroquiers via Gdb-patches [this message]
2021-09-28 21:34 ` Simon Marchi via Gdb-patches
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=08e408898e2d476ec4d185e0bc112c1faa10e3a6.camel@skynet.be \
--to=gdb-patches@sourceware.org \
--cc=gdb-patches-bounces+riyue.zcm=alibaba-inc.com@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
--cc=riyue.zcm@alibaba-inc.com \
--cc=simon.marchi@polymtl.ca \
/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