Skip to content

swift-reflection-dump: Virtualize logical-to-physical address mapping. #27388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 27, 2019

Conversation

jckarter
Copy link
Contributor

Instead of copying the entire object file and moving around its sections to make an approximate
representation of its mapped state, use the memory-mapped buffer from llvm::ObjectFile, and
deal with non-contiguous logical mappings entirely in readBytes.

We now get the local/remote mapping from RemoteRef when we need it.
If `char` is signed, then `c >> 4` produces a signed negative number when `c` has the high bit
set, and `Hexdigit[c >> 4]` reads junk out of the memory right before `Hexdigit`. Change the code
here to use `unsigned char`.
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test Windows

Instead of copying the entire object file and moving around its sections to make an approximate
representation of its mapped state, use the memory-mapped buffer from `llvm::ObjectFile`, and
deal with non-contiguous logical mappings entirely in readBytes.
@jckarter jckarter force-pushed the reflection-remove-start-addresses branch from 0038437 to 11b2c29 Compare September 26, 2019 21:29
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test Windows

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0038437cedfcc7dcacf967809da7edfce63684a3

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0038437cedfcc7dcacf967809da7edfce63684a3

@jckarter
Copy link
Contributor Author

@swift-ci Please test Windows

@alexander-shaposhnikov
Copy link

@jckarter, many thanks for these improvements, just one request - let me test / finish #26419 - I have already rebased multiple times, but CI is kinda slow in my experience, so every rebase introduces more waiting time

@jckarter
Copy link
Contributor Author

@swift-ci Please test Windows

@jckarter
Copy link
Contributor Author

@alexshap This should be the last of the big changes in this area I need to make for the time being.

@alexander-shaposhnikov
Copy link

@jckarter - maybe I can commit that PR first (when CI finishes successfully) ?

@jckarter
Copy link
Contributor Author

@alexshap OK.

@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test Windows

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 11b2c29

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 11b2c29

@jckarter
Copy link
Contributor Author

@swift-ci Please test Windows

1 similar comment
@jckarter
Copy link
Contributor Author

@swift-ci Please test Windows

@jckarter
Copy link
Contributor Author

@compnerd Hm, I'm getting this on the Windows bot:

FAILED: libdispatch-prefix/src/libdispatch-stamp/libdispatch-configure 
cmd.exe /C "cd /D S:\swift\libdispatch-prefix\src\libdispatch-build && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DCMAKE_AR= -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=S:/llvm/bin/clang-cl.exe "-DCMAKE_C_FLAGS=/DWIN32 /D_WINDOWS /Zc:inline /Zc:strictStrings /Oi /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238" -DCMAKE_CXX_COMPILER=S:/llvm/bin/clang-cl.exe "-DCMAKE_CXX_FLAGS=/GS- /Oy /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /we4062 /wd4068 /permissive- -DOBJC_OLD_DISPATCH_PROTOTYPES=0" -DCMAKE_MAKE_PROGRAM=C:/PROGRA~2/MICROS~1/2017/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -DCMAKE_INSTALL_PREFIX=S:/swift/libdispatch-prefix "-DCMAKE_LINKER=C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/link.exe" -DCMAKE_RANLIB= -DCMAKE_TOOLCHAIN_FILE= -DBUILD_SHARED_LIBS=YES -DENABLE_SWIFT=NO -DENABLE_TESTING=NO -GNinja c:\jenkins\workspace\swift-PR-windows\swift-corelibs-libdispatch && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch S:/swift/libdispatch-prefix/src/libdispatch-stamp/libdispatch-configure"
CMake Error at CMakeLists.txt:2 (cmake_minimum_required):
  CMake 3.15.1 or higher is required.  You are running version
  3.12.18081601-MSVC_2


-- Configuring incomplete, errors occurred!

@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@jckarter
Copy link
Contributor Author

@swift-ci Please test Windows

@jckarter
Copy link
Contributor Author

Looks like I got past the CMake issue this time. Now I'm seeing the same Driver failures on Windows as before.

@jckarter jckarter merged commit 12bf25e into swiftlang:master Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants