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
cli-decode.c gdb: add lookup_cmd_exact to simplify a common pattern 2021-05-07 15:43:30 +01:00
cli-decode.h
cli-dump.c
cli-interp.c
cli-interp.h
cli-logging.c
cli-option.c
cli-option.h
cli-script.c gdb: add lookup_cmd_exact to simplify a common pattern 2021-05-07 15:43:30 +01:00
cli-script.h
cli-setshow.c
cli-setshow.h
cli-style.c
cli-style.h
cli-utils.c
cli-utils.h