diff options
author | Doug Evans <dje@google.com> | 2015-10-26 14:33:19 -0700 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2015-10-26 14:33:19 -0700 |
commit | 1a70ae976b673f7762f14734785b34fc5ba92eae (patch) | |
tree | a534938a791fec38364ed434f09d2833b07ff714 /gdb/testsuite/gdb.python | |
parent | 372405a5e8adbe5affce56410b6d6048c63cac3f (diff) | |
download | gdb-1a70ae976b673f7762f14734785b34fc5ba92eae.zip gdb-1a70ae976b673f7762f14734785b34fc5ba92eae.tar.gz gdb-1a70ae976b673f7762f14734785b34fc5ba92eae.tar.bz2 |
PR python/18938: source -s foo.py with foo.py a symlink to foo.notpy fails
gdb/ChangeLog:
PR python/18938
* cli/cli-cmds (source_script_fron_sctream): New arg file_to_open.
All callers updated.
gdb/testsuite/ChangeLog:
* gdb.python/python.exp: Add test for symlink from .py file to .notpy
file.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r-- | gdb/testsuite/gdb.python/python.exp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index a0b80e0..19b8322 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -96,6 +96,19 @@ gdb_test "source $remote_source2_py" "yes" "source source2.py" gdb_test "source -s source2.py" "yes" "source -s source2.py" +set remote_source2_symlink_notpy \ + [gdb_remote_download host ${srcdir}/${subdir}/source2.py \ + [standard_output_file "source2-symlink.notpy"]] +set remote_source2_symlink_py [standard_output_file "source2-symlink.py"] +remote_file host delete $remote_source2_symlink_py +set status [remote_exec host "ln -sf $remote_source2_symlink_notpy $remote_source2_symlink_py"] +set test "source -s source2-symlink.py" +if {[lindex $status 0] == 0} { + gdb_test "source -s $remote_source2_symlink_py" "yes" $test +} else { + unsupported "$test (host does not support symbolic links)" +} + gdb_test "python print (gdb.current_objfile())" "None" gdb_test "python print (gdb.objfiles())" "\\\[\\\]" |