summaryrefslogtreecommitdiff
path: root/src/utilcode
AgeCommit message (Collapse)AuthorFilesLines
2015-12-03Refactoring resource stringKyungwoo Lee5-52/+19
This pulls out resource string handling out of mscorrc into top level. The scripts (awk) are now parameterized to generate a unique string table for the given name. Added resourcestring.cpp to create an API "LoadResourceString". Added a few macros into resourcestring.h, which are used for definition/uses of the string table.
2015-12-02Implement an allocator for executable (JIT) memory in PALSergiy Kuryata1-0/+7
This change improves performance of CoreCLR with Server GC enabled by about 30% according to ASP.NET benchmarks on Linux. The table below shows number of requests per second that an ASP.NET benchmark could handle on my machine before and after the change. Pipeline Before After Improvement 16 230K Req/sec 305K Req/sec 33% 256 240K Req/sec 340K Req/sec 42% The problem was that with Server GC enabled, the GC initialization code was reserving a large chunck (about 18GB on my machine) of virtual address space during runtime initialization. Unfortunately, due to implementation details of MM on Linux, GC memory was located next to the location of libcoreclr. As a result, the runtime could not allocate memory for JIT'ed code close to the coreclr library. Because of that the JIT'ed code had to use jump stubs to call functions from the runtime (which can become very expensive, for example, for write barriers). This change fixes this issue by implementing a simple allocator that tries to reserve (during process startup) a chuck of virtual memory that is located near the coreclr library (within 2GB range) that can be later used for JIT'ed code.
2015-11-23Delete code under !NO_CRT defineJan Kotas4-83/+2
It is always defined - even in internal builds
2015-11-17Enable CLANG sanitizers for native debug buildsSteve Harter1-2/+35
2015-11-11Use volatile store for g_hrFatalErrorJan Kotas1-1/+2
2015-10-29Merge pull request #1875 from adityamandaleeka/remove_suspensionAditya Mandaleeka1-0/+3
Initial removal of thread suspension code from PAL
2015-10-26Disable apithreadstress when STRESS_THREAD is not enabledAditya Mandaleeka1-0/+3
2015-10-26Fix a CrossGen assert on LinuxJohn Chen1-1/+1
Resource string loading during CrossGen doesn't work on Linux. Disable it for now. In many cases the loaded string isn't even used.
2015-10-20Correct attribution for UUIDs and GUIDsRichard Lander1-38/+65
2015-10-07correct word spellingあまみや ゆうこ2-3/+3
2015-09-28Merge pull request #1628 from kouvel/CppCheckFixesKoundinya Veluri1-0/+3
Fix a few issues reported by cppcheck
2015-09-25Fix for 134453: fix prefast warningsRahul Kumar10-6/+14
[tfs-changeset: 1529946]
2015-09-25Fix a few issues reported by cppcheckKoundinya Veluri1-0/+3
2015-09-08Replace MAX_PATH with new defines, rest of coreclr.Lakshmi Priya Sekar7-24/+24
2015-08-25Replace MAX_PATH with new defines in vm.Lakshmi Priya Sekar1-1/+1
2015-08-10Fix build break on desktopJan Kotas1-2/+1
[tfs-changeset: 1512590]
2015-08-05Fix build breaks on VS2015 RTMJan Kotas2-2/+3
Most of the changes are about mismatches between printf formatting strings and argument types. Fix #1294.
2015-07-24Merge pull request #1283 from dotnet-bot/from-tfsJan Kotas1-2/+1
Merge changes from TFS
2015-07-24Add ARM target for CoreCLR on Linux.Ben Pye3-1/+10
c_runtime/vprintf/test1 is disabled as casting NULL to va_list is against the C specification. Fix SetFilePointer tests on 32 bit platforms. Define _FILE_OFFSET_BITS=64 so that we have long file support on 32 bit platforms. Implement context capture/restore for ARM. Link libgcc_s before libunwind on ARM so C++ exceptions work. Translate armasm to gas syntax. Specify Thumb, VFPv3, ARMv7 for the ARM target. Add ARM configuration to mscorlib build Implement GetLogicalProcessorCacheSizeFromOS in PAL. Set UNWIND_CONTEXT_IS_UCONTEXT_T from configure check.
2015-07-22Fix recursive assert in utilcode/debug.cpp when VM code, etc. hits an assert.Mike McLaughlin1-2/+1
The fix was to rearrange the code so the assert isn't necessary and removed it. Fixes TFS bug 1199569. [tfs-changeset: 1504713]
2015-07-16Declare locals in correct order.David Mitchell1-1/+1
The order of declaration doesn't matter when the call to CreateInstance succeeds because the call to unload the DLL is suppressed. However, if CreateInstance fails, we do unload the DLL, and this needs to happen after the call to Release on the class factory.
2015-07-08CR feedback.Mike McLaughlin1-4/+4
2015-07-08Fix recursive asserts in coreclr.Mike McLaughlin1-35/+54
Remove assert in VM break handler to prevent recursive asserts. Fixed problem where the DebugBreak wasn't terminating the app on an assert causing double assert messages. Restoring the SIGTRAP handler and returning was continuing the DebugBreak not terminating. Replaced this with an abort(). Cleanup the assert message formatting.
2015-05-26Fix the implicit-exception-spec-mismatch warningJan Vorlicek1-2/+2
Fix the warning. Since VC++ until VS2015 doesn't support the noexcept keyword, define a NOEXCEPT macro as empty for VC++ older than VS2015 and as noexcept for others.
2015-05-18Ensure fallback to English resources on non-Windows platformsAditya Mandaleeka1-7/+48
Take the resources in RC files and build a static library that contains the ID->English string mappings. Use those strings as the key to gettext so that when gettext is not able to find a suitable string in the desired language, it falls back on returning the English string.
2015-05-11Update assertion failure messageJan Kotas1-3/+4
2015-05-07Changes for building using VS2015Jan Kotas1-0/+1
2015-05-06Hide the visibility of the C++ operators by default.Geoff Norton1-1/+18
Currently the export of the C++ operators can cause issues when interoping with native code on (at least) OSX, since it will hook the delete from native libraries. This should be fixed long term by #247 when proper library exports are figured out but for now we can just hide these on llvm. Fixes #943
2015-05-01Fix loading mscorlib.ni.dll on LinuxJohn Chen (CLR)1-33/+37
- HelloWorld.exe now works with mscorlib.ni.dll on Linux. - Generating or using native images for other assemblies not yet supported.
2015-04-28Build crossgen for LinuxJohn Chen (JOCHEN7)1-3/+1
- Crossgen is now built as part of coreclr - Crossgen successfully compiles mscorlib.dll - Resulting mscorlib.ni.dll not yet usable
2015-04-20Enable build crossgen.exe from build.cmd.John Chen2-0/+11
Adds and modifies CMakeLists.txt files to enable building of crossgen.exe from build.cmd for x64 processor on Windows. Also adds a step in build.cmd to generate native image for mscorlib. [tfs-changeset: 1456454]
2015-04-14Rename "CoreClrPal" to "coreclrpal"Matt Ellis2-2/+2
Simply change the case of the library the PAL lives in so that is all lowercase.
2015-04-07Improve comments and fix Realloc in executable debugger heapEugene Zemtsov1-2/+2
2015-04-02Make managed debugging on Linux possible (attach, load, bp, exceptions, ↵Eugene Zemtsov1-1/+1
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.
2015-04-01Fix next round of warning typesJan Vorlicek4-10/+14
This change fixes the following warnings: 1) Assignment in a condition should be wrapped in () 2) Priority of && / || should be indicated by parentheses. 3) Unknown #pragma optimize ifdefed out for non MSVC 4) Unused functions deleted or put under #ifdef 5) Extra tokens warning disabling moved to the CMakeLists.txt in the src/inc 6) Self assignment of a member or local variable 7) Assigning ~0 to a bitfield member that was just 8 bit wide It also fixes a bug in the STRESS_LOGxx macro invocation in exceptionhandling.cpp and stackwalk.cpp related to recent adding the DBG_ADDR macro usage. This macro expanded a single parameter into two expressions to extract high / low 32 bits separately. But the STRESS_LOGxx parameters are passed to the StressLog::LogMsg method as follows: (void*)(size_t)(data1) That means that the expanded pair x, y would be inserted as data 1 and that leads to ignoring the x due to the comma operator.
2015-03-26Make it possible to write stress log from a module that doesn't have ↵Eugene Zemtsov1-1/+1
statically liked PAL
2015-03-26Fix about 12 kinds of warnings over the codebaseJan Vorlicek6-11/+11
This change fixes: 1) Member initiazalization order in class constructor didn't correspond to the member order in some classes 2) Objects with vtables were copied via memcpy. While this is intentional, cast of the pointers to void* is required to silence clang warning 3) Switch case statements containing values of different enums 4) Casting int to pointer 5) Missing return value in methods with _ASSERTE 6) Class name classifier on methods in the .h 7) Invalid position of the DECLSPEC_ALIGN at few places - it had no effect 8) Invalid position of the 'used' attribute 9) Issue with comparing holders to NULL 10) Operator 'new' returning NULL without being marked with throw() or noexcept 11) Variables marked as 'extern' at the declaration / initialization place 12) Data structure declared as struct at one place and forward declared as class at another Some disabled warnings were no longer happening, so options to disable them were removed too
2015-03-25Merge pull request #543 from janvorli/native-resourcesJan Vorlicek1-2/+29
Add native resources compilation on Linux
2015-03-25Propagate bindtextdomain status to the callerJan Vorlicek1-1/+5
The bindtextdomain can fail due to OOM. Propagate the status out of the PAL_BindResources.
2015-03-24Add native resources compilation on LinuxJan Vorlicek1-2/+25
This change adds compilation of native resources into a gettext binary format and loading of string resources in coreclr on Linux. On OSX, the resource string still contains just a formatted resource id.
2015-03-22Make stresslog work for libraries other than CoreClr (I need it for DBI)Eugene Zemtsov1-1/+1
Introducing of PAL_GetPalModuleBase removes dependency on CoreCLR name for stress log module address.
2015-03-17Fix some of the issues found by Viva64 static analyserJan Kotas1-102/+0
2015-03-12Merge pull request #436 from janvorli/resource-loading-workaroundJan Vorlicek1-1/+12
Workaround native resource string loading temporarily
2015-03-12Workaround native resource string loading temporarilyJan Vorlicek1-1/+12
This change is a temporary workaround for native resource string loading until we have the resource string support implemented. Instead of asserting in the resource loading methods, return a string representing the id for the requested resource. The change implements a similar workaround for the FMTMSG_GetMessageString which now returns a string containing "Error errorCode" where the errorCode is the error code passed to the method. This way, exceptions that use those two functions can be raised without asserting.
2015-03-10Fix error handling in REGUTIL::EnvGetStringJan Kotas1-14/+27
2015-03-08Make assertion failures to break into debuggerJan Kotas1-18/+19
2015-03-03Pipe based communication between debugee and managed debugger on LinuxEugene Zemtsov3-54/+62
Goal of this change is to make managed debugging on Linux possible. (It is not fully achieved, but we're getting there) So far our provision for debugging on Linux is somewhat different from debugging on Windows. Instead of using WaitForDebugEvent and RaiseException as means of communication between debugger and debuggee, we're gonna use pipes. Thankfully from old times of Silverlight Mac debugging we had debugging via network sockets under ifdefs FEATURE_DBGIPC_TRANSPORT_DI and FEATURE_DBGIPC_TRANSPORT_VM. So this change is taking that old way of debugging, changing sockets for network pipes, removes lots of unused stuff and implements whatever is missing on Linux. Testing: Due to infrastructural issues I wasn't able to test debugging on Linux yet. So my testing consistent of 1. End to end net pipe debugging on Windows 2. Testing of twowaypipe implementation on Linux 3. Testing of search for loaded CoreCLR module on Linux.
2015-02-15More DAC build fixes. Always enable SELF_NO_HOST defined.Mike McLaughlin2-2/+15
2015-02-12Merge branch 'master' into soscommand1mikem83611-7/+2
2015-02-12These changes are the beginning of the SOS for coreclr under lldb. It isn't ↵mikem83611-1/+1
finished or working yet. The sos plug in is broken into two modules: 1) The lldb plugin (sosplugin) module that is built with the lldb h and lib files. This module dynamically loads the sos module and finds the subcommand argument as a symbol export like windbg does for it's extensions. So "sos IP2MD 0x100000" loads sos, finds the export "IP2MD" and calls it with the rest of the command and a "IDebugClient" instance. This instance is a small subset of the the various dbgeng's API's implemented under lldb without any COM to keep things simple. OPEN ISSUE: This module's build depends on the lldb API includes and the lldb library. Need to figure out the best way to deal with the dependency on the lldb source. 2) The sos module (sos) module that is the strike source built under linux. Currently only the IP2MD command is built and the support/utility functions it needs. It dynamically loads the DAC (libmscordaccore.so) and queries the IXCLRDataProcess interface via the DAC's CLRDataCreateInstance export. OPEN ISSUE: Where and how to search for the sos/dac modules. Currently have a hard coded path to the binaries. It probably should be the directory the plug in (sosplugin) is loaded.