* source.c: #include gdb_assert.h.
(substitute_path_rule): New struct.
(substitute_path_rules): New static global variable.
(substitute_path_rule_matches): New function.
(get_substitute_path_rule): New function.
(rewrite_source_path): New function.
(find_and_open_source): Add source path rewriting support.
(strip_trailing_directory_separator): New function.
(find_substitute_path_rule): New function.
(add_substitute_path_rule): New function.
(delete_substitute_path_rule): New function.
(show_substitute_path_command): New function.
(unset_substitute_path_command): New function.
(set_substitute_path_command): New function.
(_initialize_source): Add new substitute-path commands.
* Makefile.in (source.o): Add dependency on gdb_assert.h.