• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision13265fa94289f4276e1011903b6d88003669bd6b (tree)
Time2015-12-11 05:00:34
AuthorDoug Evans <dje@goog...>
CommiterDoug Evans

Log Message

patch ../103142573.patch

Change Summary

Incremental Difference

--- a/README.google
+++ b/README.google
@@ -468,3 +468,16 @@ they are an ongoing maintenance burden.
468468 + testsuite/
469469 + * gdb.base/gcore-build-id-pie.c: New file.
470470 + * gdb.base/gcore-build-id-pie.exp: New file.
471+--- README.google 2015-09-11 16:22:06.000000000 -0700
472++++ README.google 2015-09-15 16:23:33.000000000 -0700
473++
474++2015-09-15 Doug Evans <dje@google.com>
475++
476++ Submitted upstream, not committed there yet.
477++ PR python/18938
478++ * cli/cli-cmds (source_script_fron_sctream): New arg file_to_open.
479++ All callers updated.
480++
481++ testsuite/
482++ * gdb.python/python.exp: Add test for symlink from .py file to .notpy
483++ file.
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -537,10 +537,16 @@ find_and_open_script (const char *script_file, int search_path,
537537 return 1;
538538 }
539539
540-/* Load script FILE, which has already been opened as STREAM. */
540+/* Load script FILE, which has already been opened as STREAM.
541+ FILE_TO_OPEN is the form of FILE to use if one needs to open the file.
542+ This is provided as FILE may have been found via the source search path.
543+ An important thing to note here is that FILE may be a symlink to a file
544+ with a different or non-existing suffix, and thus one cannot infer the
545+ extension language from FILE_TO_OPEN. */
541546
542547 static void
543-source_script_from_stream (FILE *stream, const char *file)
548+source_script_from_stream (FILE *stream, const char *file,
549+ const char *file_to_open)
544550 {
545551 if (script_ext_mode != script_ext_off)
546552 {
@@ -555,7 +561,7 @@ source_script_from_stream (FILE *stream, const char *file)
555561 = ext_lang_script_sourcer (extlang);
556562
557563 gdb_assert (sourcer != NULL);
558- sourcer (extlang, stream, file);
564+ sourcer (extlang, stream, file_to_open);
559565 return;
560566 }
561567 else if (script_ext_mode == script_ext_soft)
@@ -608,7 +614,7 @@ source_script_with_search (const char *file, int from_tty, int search_path)
608614 anyway so that error messages show the actual file used. But only do
609615 this if we (may have) used search_path, as printing the full path in
610616 errors for the non-search case can be more noise than signal. */
611- source_script_from_stream (stream, search_path ? full_path : file);
617+ source_script_from_stream (stream, file, search_path ? full_path : file);
612618 do_cleanups (old_cleanups);
613619 }
614620
--- 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"
9696
9797 gdb_test "source -s source2.py" "yes" "source -s source2.py"
9898
99+set remote_source2_symlink_notpy \
100+ [gdb_remote_download host ${srcdir}/${subdir}/source2.py \
101+ [standard_output_file "source2-symlink.notpy"]]
102+set remote_source2_symlink_py [standard_output_file "source2-symlink.py"]
103+remote_file host delete $remote_source2_symlink_py
104+set status [remote_exec host "ln -sf $remote_source2_symlink_notpy $remote_source2_symlink_py"]
105+set test "source -s source2-symlink.py"
106+if {[lindex $status 0] == 0} {
107+ gdb_test "source -s $remote_source2_symlink_py" "yes" $test
108+} else {
109+ unsupported "$test (host does not support symbolic links)"
110+}
111+
99112 gdb_test "python print (gdb.current_objfile())" "None"
100113 gdb_test "python print (gdb.objfiles())" "\\\[\\\]"
101114