diff options
author | Eugene Zemtsov <e.zemtsov@gmail.com> | 2015-03-28 04:42:11 -0700 |
---|---|---|
committer | Eugene Zemtsov <Eugene.Zemtsov@microsoft.com> | 2015-04-02 14:55:16 -0700 |
commit | 697fd3992f4e113bd9d63d2ac6605cf67356c54d (patch) | |
tree | d28dac13216f53e52d4d8d18ff6ee793bbc52d17 /src/debug/di | |
parent | cf104b93a168f7aaff7c14113b2f80106bbcc405 (diff) | |
download | coreclr-697fd3992f4e113bd9d63d2ac6605cf67356c54d.tar.gz coreclr-697fd3992f4e113bd9d63d2ac6605cf67356c54d.tar.bz2 coreclr-697fd3992f4e113bd9d63d2ac6605cf67356c54d.zip |
Make managed debugging on Linux possible (attach, load, bp, exceptions, stacktrace)
Fixes that were required to achieve that
1. Funnel SIGTRAP into EE debugger.
2. Making that memory allocated by EE debugger is executable.
3. Disable metadata reading optimizations which are not working on Linux.
4. Workaround RtlRestoreContext not properly working with EFlags.
5. Avoid calls to ShimRemoteDataTarget.GetContext on Linux, it is not
implemented and not needed for pure managed debugging.
6. Adjust IP value after breakpoint SIGTRAP to meet debuggers expectations.
Diffstat (limited to 'src/debug/di')
-rw-r--r-- | src/debug/di/module.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/debug/di/module.cpp b/src/debug/di/module.cpp index f7eda088c6..d88b789080 100644 --- a/src/debug/di/module.cpp +++ b/src/debug/di/module.cpp @@ -814,11 +814,12 @@ HRESULT CordbModule::InitPublicMetaDataFromFile() // Its possible that the debugger would still load the NGEN image sometime in the future and we will miss a sharing // opportunity. Its an acceptable loss from an imperfect heuristic. if (NULL == WszGetModuleHandle(szFullPathName)) +#endif { szFullPathName = NULL; fDebuggerLoadingNgen = false; } -#endif + } // If we don't have or decided not to load the NGEN image, check to see if IL image is available @@ -880,6 +881,11 @@ HRESULT CordbModule::InitPublicMetaDataFromFile(const WCHAR * pszFullPathName, DWORD dwOpenFlags, bool validateFileInfo) { +#ifdef FEATURE_PAL + // TODO: Some intricate details of file mapping don't work on Linux as on Windows. + // We have to revisit this and try to fix it for POSIX system. + return E_FAIL; +#else if (validateFileInfo) { // Check that we've got the right file to target. @@ -988,6 +994,7 @@ HRESULT CordbModule::InitPublicMetaDataFromFile(const WCHAR * pszFullPathName, } return hr; +#endif // FEATURE_PAL } //--------------------------------------------------------------------------------------- @@ -2550,6 +2557,7 @@ HRESULT CordbModule::CreateReaderForInMemorySymbols(REFIID riid, void** ppObj) ReleaseHolder<ISymUnmanagedBinder> pBinder; if (symFormat == IDacDbiInterface::kSymbolFormatPDB) { +#ifndef FEATURE_PAL // PDB format - use diasymreader.dll with COM activation InlineSString<_MAX_PATH> ssBuf; IfFailThrow(FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS, @@ -2557,6 +2565,11 @@ HRESULT CordbModule::CreateReaderForInMemorySymbols(REFIID riid, void** ppObj) IID_ISymUnmanagedBinder, (void**)&pBinder, NULL)); +#else + IfFailThrow(FakeCoCreateInstance(CLSID_CorSymBinder_SxS, + IID_ISymUnmanagedBinder, + (void**)&pBinder)); +#endif } else if (symFormat == IDacDbiInterface::kSymbolFormatILDB) { |