binutils-gdb/gdb/cli
Andrew Burgess 1845e25464 gdb/guile: perform tilde expansion when sourcing guile scripts
Before this patch:

  (gdb) source ~/script.scm
  ERROR: In procedure apply-smob/1:
  ERROR: In procedure primitive-load-path: Unable to find file "~/script.scm" in load path
  Error while executing Scheme code.
  (gdb)

This is because the path is not tilde expanded.  In contrast, when
sourcing a .py or .gdb script the path is tilde expanded.

This commit fixes this oversight, and allows the above source command
to work as expected.

The tilde expansion is done in the generic GDB code before we call the
sourcer function for any particular extension language.

gdb/ChangeLog:

	* cli/cli-cmds.c: Add 'gdbsupport/gdb_tilde_expand.h'
	include.
	(source_script_with_search): Perform tilde expansion.

gdb/testsuite/ChangeLog:

	* gdb.guile/guile.exp: Add an extra test.
2021-05-07 22:20:47 +01:00
..
cli-cmds.c gdb/guile: perform tilde expansion when sourcing guile scripts 2021-05-07 22:20:47 +01:00
cli-cmds.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-decode.c gdb: add lookup_cmd_exact to simplify a common pattern 2021-05-07 15:43:30 +01:00
cli-decode.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-dump.c gdb: check result of gdb_fopen_cloexec in dump_binary_file 2021-04-26 11:27:07 -04:00
cli-interp.c gdbsupport, gdb: give names to observers 2021-04-24 19:26:41 -04:00
cli-interp.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-logging.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-option.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-option.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-script.c gdb: add lookup_cmd_exact to simplify a common pattern 2021-05-07 15:43:30 +01:00
cli-script.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-setshow.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-setshow.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-style.c gdb: add new version style 2021-01-22 19:09:31 +00:00
cli-style.h gdb: add new version style 2021-01-22 19:09:31 +00:00
cli-utils.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
cli-utils.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00