From: Pedro Alves <palves@redhat.com>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
gdb-patches@sourceware.org
Subject: Re: [RFAv2] Implement show | set may-call-functions [on|off]
Date: Sat, 27 Apr 2019 10:40:00 -0000 [thread overview]
Message-ID: <2c5a4158-8e42-8e01-82d0-7ea3b5f732f1@redhat.com> (raw)
In-Reply-To: <20190426213450.22345-1-philippe.waroquiers@skynet.be>
On 4/26/19 10:34 PM, Philippe Waroquiers wrote:
> Inferior function calls are powerful but might lead to undesired
> results such as crashes when calling nested functions (frequently
> used in particular in Ada).
>
> This implements a GDB setting to disable calling inferior functions.
>
> Note: the idea is that if/when the 'slash command' patch is pushed,
> that this setting can be changed e.g. by using the shortcut /c.
>
> This is version 2 of the patch. It handles all the received comments,
> mostly replace 'can-call' by 'may-call', and avoid using
> 'inferior function call' in factor of 'calling function in the program'.
>
Thanks. I like this version a lot better.
Some nits below. LGTM with those fixed.
>
> +* New commands
> +
> +set may-call-functions [on|off]
> +show may-call-functions
> + This controls whether GDB will attempt to call functions in
> + the program, such as with expressions in print command. It
"in print command" doesn't sound right to me.
Either "in print", or "in THE print command" would be good, I think.
> + defaults to on. Calling functions in the program being debugged
> + can have undesired side effects. It is now possible to forbid
> + such function calls. If function calls are forbidden, GDB will throw
> + an error when a command (such as print an expression) calls a function
"such as printING an expression" ? or (such as print EXPRESSION) if you
want to keep it short.
> + in the program.
> +
> *** Changes in GDB 8.3
>
> * GDB and GDBserver now support access to additional registers on
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 0733e1acfd..2e4affd6c4 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -18693,6 +18693,28 @@ the default C@t{++} exception handler and the inferior terminated.
> Show the current setting of stack unwinding in the functions called by
> @value{GDBN}.
>
> +@item set may-call-functions
> +@kindex set may-call-functions
> +@cindex disabling calling functions in the program
> +@cindex calling functions in the program, disabling
> +Set permission to call functions in the program.
> +This controls whether @value{GDBN} will attempt to call functions in
> +the program, such as with expressions in @code{print}. It
in the @code{print} command.
> +defaults to @code{on}.
> +
> +To call a function in the program, @value{GDBN} has to temporarily
> +modify the state of the inferior. This has potentially undesired side
> +effects. Also, having @value{GDBN} call nested functions is likely to
> +be erroneous and may even crash the program being debugged. You can
> +avoid such hazards by forbidding @value{GDBN} from calling functions
> +in the program being debugged. If calling functions in the program
> +are forbidden,
s/are forbidden/is forbidden/
(calling functions ... is forbidden)
> GDB will throw an error when a command (such as print
> +an expression) starts a function call in the program.
"such as printING an expression" ?
Or:
"such as print @var{expression}"
Thanks,
Pedro Alves
next prev parent reply other threads:[~2019-04-27 10:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 21:35 Philippe Waroquiers
2019-04-27 7:17 ` Eli Zaretskii
2019-04-27 10:40 ` Pedro Alves [this message]
2019-04-27 11:38 ` Philippe Waroquiers
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=2c5a4158-8e42-8e01-82d0-7ea3b5f732f1@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/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