Implement show | set may-call-functions [on|off]
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 23 Apr 2019 21:43:24 +0000 (23:43 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 27 Apr 2019 11:12:42 +0000 (13:12 +0200)
commit136afab8c7d8a8a91dbf38e79be4f9dc4125d552
tree2d6f40d947a3fa3a627cf6b7d0b360f4174d10de
parenta45328b93bdd5399da8a9e56817e445cc2068edd
Implement show | set may-call-functions [on|off]

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

2019-04-26  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

gdb/ChangeLog
* NEWS: Mention the new set|show may-call-functions.
* infcall.c (may_call_functions_p): New variable.
(show_may_call_functions_p): New function.
(call_function_by_hand_dummy): Throws an error if not
may-call-functions.
(_initialize_infcall): Call add_setshow_boolean_cmd for
may-call-functions.

gdb/testsuite/ChangeLog
* gdb.base/callexit.exp: Test may-call-functions off.

gdb/doc/ChangeLog
* gdb.texinfo (Calling): Document the new
set|show may-call-functions.
gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/infcall.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/callexit.exp