Skip to content

Commit

Permalink
Fix build error on OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaurtaev authored and Alexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics committed Dec 16, 2021
1 parent ba00521 commit 32698c7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
7 changes: 5 additions & 2 deletions compileoptions.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
if (CLR_CMAKE_PLATFORM_UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

if(CLR_CMAKE_PLATFORM_DARWIN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -force_flat_namespace -std=c++14")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(CLR_CMAKE_PLATFORM_DARWIN)
# this allows pretty-printers in gdb to work with clang
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")

Expand Down
2 changes: 1 addition & 1 deletion src/debugger/waitpid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ hook::waitpid_t &GetWaitpid()
}

// Note, we guaranty waitpid hook works only during debuggee process execution, it aimed to work only for PAL's waitpid calls interception.
extern "C" pid_t waitpid(pid_t pid, int *status, int options) noexcept
extern "C" pid_t waitpid(pid_t pid, int *status, int options)
{
pid_t pidWaitRetval = netcoredbg::hook::waitpid(pid, status, options);

Expand Down
2 changes: 1 addition & 1 deletion src/managed/interop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ constexpr char UtilsClassName[] = "NetCoreDbg.Utils";

// Pass to managed helper code to read in-memory PEs/PDBs
// Returns the number of bytes read.
int ReadMemoryForSymbols(ULONG64 address, char *buffer, int cb)
int ReadMemoryForSymbols(uint64_t address, char *buffer, int cb)
{
// TODO: In-memory PDB?
// OSPageSize() for Linux/Windows already implemented in code.
Expand Down
6 changes: 5 additions & 1 deletion test-suite/MITestExitCode/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ static int Main(string[] args)
//Console.WriteLine("Test SIGABRT, process Id = " + PID);
//kill(PID, 6); // SIGABRT
}

else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Console.WriteLine("Test _exit()");
_exit(3);
}
//Console.WriteLine("Test return 3");
//return 3;

Expand Down
6 changes: 5 additions & 1 deletion test-suite/VSCodeTestExitCode/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ static void Main(string[] args)
//Console.WriteLine("Test SIGABRT, process Id = " + PID);
//kill(PID, 6); // SIGABRT
}

else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Console.WriteLine("Test _exit()");
_exit(3);
}
//Console.WriteLine("Test return 3");
//return 3;

Expand Down

0 comments on commit 32698c7

Please sign in to comment.