Commit c6a812f7 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Handle Windows paths for v8 debug info for builtins

If __FILE__ contained a backslash (which happened in jumbo builds on
Windows), then the generated embedded.S could contain broken strings.

This replaces backslashes with forward slashes before writing the
paths to embedded.S.

Bug: v8:8418,chromium:924454
Change-Id: I32134e9cd8acd2437f61a8f74c14583fa87a4bdf
Reviewed-on: https://chromium-review.googlesource.com/c/1430699Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#59053}
parent 32a92cf5
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "src/snapshot/embedded-file-writer.h" #include "src/snapshot/embedded-file-writer.h"
#include <algorithm>
#include <cinttypes> #include <cinttypes>
#include "src/objects/code-inl.h" #include "src/objects/code-inl.h"
...@@ -613,7 +614,11 @@ void PlatformDependentEmbeddedFileWriter::FilePrologue() {} ...@@ -613,7 +614,11 @@ void PlatformDependentEmbeddedFileWriter::FilePrologue() {}
void PlatformDependentEmbeddedFileWriter::DeclareExternalFilename( void PlatformDependentEmbeddedFileWriter::DeclareExternalFilename(
int fileid, const char* filename) { int fileid, const char* filename) {
fprintf(fp_, ".file %d \"%s\"\n", fileid, filename); // Replace any Windows style paths (backslashes) with forward
// slashes.
std::string fixed_filename(filename);
std::replace(fixed_filename.begin(), fixed_filename.end(), '\\', '/');
fprintf(fp_, ".file %d \"%s\"\n", fileid, fixed_filename.c_str());
} }
void PlatformDependentEmbeddedFileWriter::FileEpilogue() {} void PlatformDependentEmbeddedFileWriter::FileEpilogue() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment