GNU Binutils with patches for OS216
Revision | 13265fa94289f4276e1011903b6d88003669bd6b (tree) |
---|---|
Time | 2015-12-11 05:00:34 |
Author | Doug Evans <dje@goog...> |
Commiter | Doug Evans |
patch ../103142573.patch
@@ -468,3 +468,16 @@ they are an ongoing maintenance burden. | ||
468 | 468 | + testsuite/ |
469 | 469 | + * gdb.base/gcore-build-id-pie.c: New file. |
470 | 470 | + * 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. |
@@ -537,10 +537,16 @@ find_and_open_script (const char *script_file, int search_path, | ||
537 | 537 | return 1; |
538 | 538 | } |
539 | 539 | |
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. */ | |
541 | 546 | |
542 | 547 | 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) | |
544 | 550 | { |
545 | 551 | if (script_ext_mode != script_ext_off) |
546 | 552 | { |
@@ -555,7 +561,7 @@ source_script_from_stream (FILE *stream, const char *file) | ||
555 | 561 | = ext_lang_script_sourcer (extlang); |
556 | 562 | |
557 | 563 | gdb_assert (sourcer != NULL); |
558 | - sourcer (extlang, stream, file); | |
564 | + sourcer (extlang, stream, file_to_open); | |
559 | 565 | return; |
560 | 566 | } |
561 | 567 | 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) | ||
608 | 614 | anyway so that error messages show the actual file used. But only do |
609 | 615 | this if we (may have) used search_path, as printing the full path in |
610 | 616 | 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); | |
612 | 618 | do_cleanups (old_cleanups); |
613 | 619 | } |
614 | 620 |
@@ -96,6 +96,19 @@ gdb_test "source $remote_source2_py" "yes" "source source2.py" | ||
96 | 96 | |
97 | 97 | gdb_test "source -s source2.py" "yes" "source -s source2.py" |
98 | 98 | |
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 | + | |
99 | 112 | gdb_test "python print (gdb.current_objfile())" "None" |
100 | 113 | gdb_test "python print (gdb.objfiles())" "\\\[\\\]" |
101 | 114 |