summaryrefslogtreecommitdiff
path: root/src/coreclr/hosts/unixcorerun
diff options
context:
space:
mode:
authorMike McLaughlin <mikem@microsoft.com>2015-04-21 15:25:24 -0700
committerMike McLaughlin <mikem@microsoft.com>2015-04-24 19:09:33 -0700
commitfa416704b3de7c57589284d6f20b59cee4908d83 (patch)
tree9a1c6176417c9caa33d5e6f4b8978fed56a66d07 /src/coreclr/hosts/unixcorerun
parent6f92fc4a8691a82423e7a8e9550a30712ca413f7 (diff)
downloadcoreclr-fa416704b3de7c57589284d6f20b59cee4908d83.tar.gz
coreclr-fa416704b3de7c57589284d6f20b59cee4908d83.tar.bz2
coreclr-fa416704b3de7c57589284d6f20b59cee4908d83.zip
Implemented hardware exception chaining.
Test CLR hosting under a debugger (lldb). In order to test the debugger modules and coreclr running together in the same process, add the test command "corerun" to the lldb plugin that uses the CLR hosting apis to run managed code in the lldb process. Fixed a problem where the dac module was picking up an constructor in the coreclr module instead of using the dac version. This is because the corerun code was dlopen'ing coreclr with RTLD_GLOBAL which exposed all the symbols to the reset of the dynamic modules loaded. Changing it to RTLD_LOCAL (the default) fixes this problem. Changed from an ASSERT to an ERROR in the hardware exception handler because ASSERT does an SIGTRAP (DebugBreak) that keeps recursively being hit. Removed all signals that installed a fatal_signal_handler especially SIGINT which was interfering with lldb's. The rest of the signals, the default action should be good enough. Checked if the EE was started in the VM's hardware exception handler just to make sure everything is ready before the managed exception chain is called. Cleanup signal thread masking. Only wait for SIGINT/SIGQUIT explicitly instead of trying to mask all the signals we don't want to wait on.
Diffstat (limited to 'src/coreclr/hosts/unixcorerun')
-rw-r--r--src/coreclr/hosts/unixcorerun/corerun.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/coreclr/hosts/unixcorerun/corerun.cpp b/src/coreclr/hosts/unixcorerun/corerun.cpp
index 5f7bb6525b..8308e39f6b 100644
--- a/src/coreclr/hosts/unixcorerun/corerun.cpp
+++ b/src/coreclr/hosts/unixcorerun/corerun.cpp
@@ -321,7 +321,7 @@ int ExecuteManagedAssembly(
return -1;
}
- void* coreclrLib = dlopen(coreClrDllPath.c_str(), RTLD_NOW | RTLD_GLOBAL);
+ void* coreclrLib = dlopen(coreClrDllPath.c_str(), RTLD_NOW | RTLD_LOCAL);
if (coreclrLib != nullptr)
{
ExecuteAssemblyFunction executeAssembly = (ExecuteAssemblyFunction)dlsym(coreclrLib, "ExecuteAssembly");
@@ -402,7 +402,7 @@ int ExecuteManagedAssembly(
return exitCode;
}
-int main(const int argc, const char* argv[])
+int corerun(const int argc, const char* argv[])
{
const char* clrFilesPath;
const char* managedAssemblyPath;
@@ -484,3 +484,8 @@ int main(const int argc, const char* argv[])
managedAssemblyArgv);
return exitCode;
}
+
+int main(const int argc, const char* argv[])
+{
+ return corerun(argc, argv);
+}