mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Merge pull request #811 from davidebeatrici/build-release-debug-info
Merge PR #811: Build debug info in release builds, provide PDB files on AppVeyor
This commit is contained in:
commit
1c89bf7ede
@ -24,9 +24,16 @@ for:
|
|||||||
build_script:
|
build_script:
|
||||||
- src\BuildAll.cmd
|
- src\BuildAll.cmd
|
||||||
- exit %errorlevel%
|
- exit %errorlevel%
|
||||||
|
after_build:
|
||||||
|
- 7z a "%APPVEYOR_BUILD_FOLDER%\src\bin\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x86_%CONFIGURATION%_PDBs.zip" "%APPVEYOR_BUILD_FOLDER%\src\DebugFiles\pdb\Win32_Release\*.pdb"
|
||||||
|
- 7z a "%APPVEYOR_BUILD_FOLDER%\src\bin\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%_PDBs.zip" "%APPVEYOR_BUILD_FOLDER%\src\DebugFiles\pdb\x64_Release\*.pdb"
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: output\pkg\*\*
|
- path: output\pkg\*\*
|
||||||
name: Windows
|
name: Release
|
||||||
|
- path: src\bin\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x86_%CONFIGURATION%_PDBs.zip
|
||||||
|
name: PDBs (x86)
|
||||||
|
- path: src\bin\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%_PDBs.zip
|
||||||
|
name: PDBs (x64)
|
||||||
-
|
-
|
||||||
matrix:
|
matrix:
|
||||||
only:
|
only:
|
||||||
@ -40,9 +47,12 @@ for:
|
|||||||
after_build:
|
after_build:
|
||||||
- 7z a "%APPVEYOR_BUILD_FOLDER%\build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip" "%APPVEYOR_BUILD_FOLDER%\build\*.exe"
|
- 7z a "%APPVEYOR_BUILD_FOLDER%\build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip" "%APPVEYOR_BUILD_FOLDER%\build\*.exe"
|
||||||
- 7z a "%APPVEYOR_BUILD_FOLDER%\build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip" "%APPVEYOR_BUILD_FOLDER%\build\hamcore.se2"
|
- 7z a "%APPVEYOR_BUILD_FOLDER%\build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip" "%APPVEYOR_BUILD_FOLDER%\build\hamcore.se2"
|
||||||
|
- 7z a "%APPVEYOR_BUILD_FOLDER%\build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%_PDBs.zip" "%APPVEYOR_BUILD_FOLDER%\build\*.pdb"
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip
|
- path: build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip
|
||||||
name: Windows
|
name: Release
|
||||||
|
- path: build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%_PDBs.zip
|
||||||
|
name: PDBs
|
||||||
-
|
-
|
||||||
matrix:
|
matrix:
|
||||||
only:
|
only:
|
||||||
|
@ -5,7 +5,13 @@ project(SoftEtherVPN
|
|||||||
LANGUAGES C
|
LANGUAGES C
|
||||||
)
|
)
|
||||||
|
|
||||||
set(default_build_type "Release")
|
# We define a dedicated variable because CMAKE_BUILD_TYPE can have different
|
||||||
|
# configurations than "Debug" and "Release", such as "RelWithDebInfo".
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(BUILD_TYPE "Debug")
|
||||||
|
else()
|
||||||
|
set(BUILD_TYPE "Release")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Check that submodules are present only if source was downloaded with git
|
# Check that submodules are present only if source was downloaded with git
|
||||||
if(EXISTS "${SoftEtherVPN_SOURCE_DIR}/.git" AND NOT EXISTS "${SoftEtherVPN_SOURCE_DIR}/src/Mayaqua/3rdparty/cpu_features/CMakeLists.txt")
|
if(EXISTS "${SoftEtherVPN_SOURCE_DIR}/.git" AND NOT EXISTS "${SoftEtherVPN_SOURCE_DIR}/src/Mayaqua/3rdparty/cpu_features/CMakeLists.txt")
|
||||||
|
2
configure
vendored
2
configure
vendored
@ -45,7 +45,7 @@ fi
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
(cd tmp && cmake ${CMAKE_FLAGS} .. || exit 1)
|
(cd tmp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_FLAGS} .. || exit 1)
|
||||||
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -23,7 +23,7 @@ if not exist "tmp" (
|
|||||||
|
|
||||||
cd tmp
|
cd tmp
|
||||||
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" ..
|
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles" ..
|
||||||
|
|
||||||
if %errorlevel% == 0 (
|
if %errorlevel% == 0 (
|
||||||
echo.
|
echo.
|
||||||
|
@ -16,11 +16,9 @@ if(UNIX)
|
|||||||
endmacro(install_wrapper_script)
|
endmacro(install_wrapper_script)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(BUILD_TYPE STREQUAL "Debug")
|
||||||
add_definitions(-D_DEBUG -DDEBUG)
|
add_definitions(-D_DEBUG -DDEBUG)
|
||||||
endif()
|
else()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
||||||
add_definitions(-DNDEBUG -DVPN_SPEED)
|
add_definitions(-DNDEBUG -DVPN_SPEED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -20,6 +20,12 @@ set_target_properties(cedar
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
set_target_properties(cedar
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_PDB_NAME "cedar"
|
||||||
|
COMPILE_PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
)
|
||||||
|
|
||||||
target_include_directories(cedar PRIVATE winpcap)
|
target_include_directories(cedar PRIVATE winpcap)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -17,6 +17,12 @@ set_target_properties(mayaqua
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
set_target_properties(mayaqua
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_PDB_NAME "mayaqua"
|
||||||
|
COMPILE_PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
)
|
||||||
|
|
||||||
add_subdirectory(3rdparty/zlib)
|
add_subdirectory(3rdparty/zlib)
|
||||||
|
|
||||||
target_include_directories(mayaqua PRIVATE win32_inc)
|
target_include_directories(mayaqua PRIVATE win32_inc)
|
||||||
@ -25,22 +31,22 @@ if(WIN32)
|
|||||||
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
||||||
find_library(LIB_SSL
|
find_library(LIB_SSL
|
||||||
NAMES libssl ssleay32
|
NAMES libssl ssleay32
|
||||||
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/x64_${CMAKE_BUILD_TYPE}"
|
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/x64_${BUILD_TYPE}"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(LIB_CRYPTO
|
find_library(LIB_CRYPTO
|
||||||
NAMES libcrypto libeay32
|
NAMES libcrypto libeay32
|
||||||
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/x64_${CMAKE_BUILD_TYPE}"
|
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/x64_${BUILD_TYPE}"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
find_library(LIB_SSL
|
find_library(LIB_SSL
|
||||||
NAMES libssl ssleay32
|
NAMES libssl ssleay32
|
||||||
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/Win32_${CMAKE_BUILD_TYPE}"
|
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/Win32_${BUILD_TYPE}"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(LIB_CRYPTO
|
find_library(LIB_CRYPTO
|
||||||
NAMES libcrypto libeay32
|
NAMES libcrypto libeay32
|
||||||
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/Win32_${CMAKE_BUILD_TYPE}"
|
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/Win32_${BUILD_TYPE}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -552,8 +552,11 @@ void InitMayaqua(bool memcheck, bool debug, int argc, char **argv)
|
|||||||
// Initialize the Kernel status
|
// Initialize the Kernel status
|
||||||
InitKernelStatus();
|
InitKernelStatus();
|
||||||
|
|
||||||
// Initialize the tracking
|
if (IsTrackingEnabled())
|
||||||
InitTracking();
|
{
|
||||||
|
// Initialize the tracking
|
||||||
|
InitTracking();
|
||||||
|
}
|
||||||
|
|
||||||
// Initialization of thread pool
|
// Initialization of thread pool
|
||||||
InitThreading();
|
InitThreading();
|
||||||
@ -696,22 +699,23 @@ void FreeMayaqua()
|
|||||||
// Release of thread pool
|
// Release of thread pool
|
||||||
FreeThreading();
|
FreeThreading();
|
||||||
|
|
||||||
#ifndef VPN_SPEED
|
if (IsTrackingEnabled())
|
||||||
// Show the kernel status
|
|
||||||
if (g_debug)
|
|
||||||
{
|
{
|
||||||
PrintKernelStatus();
|
// Show the kernel status
|
||||||
}
|
if (g_debug)
|
||||||
|
{
|
||||||
|
PrintKernelStatus();
|
||||||
|
}
|
||||||
|
|
||||||
// Display the debug information
|
// Display the debug information
|
||||||
if (g_memcheck)
|
if (g_memcheck)
|
||||||
{
|
{
|
||||||
PrintDebugInformation();
|
PrintDebugInformation();
|
||||||
}
|
}
|
||||||
#endif // VPN_SPEED
|
|
||||||
|
|
||||||
// Release the tracking
|
// Release the tracking
|
||||||
FreeTracking();
|
FreeTracking();
|
||||||
|
}
|
||||||
|
|
||||||
// Release of the kernel status
|
// Release of the kernel status
|
||||||
FreeKernelStatus();
|
FreeKernelStatus();
|
||||||
|
@ -125,10 +125,8 @@
|
|||||||
// Macro for the release flag
|
// Macro for the release flag
|
||||||
#ifdef VPN_SPEED
|
#ifdef VPN_SPEED
|
||||||
|
|
||||||
#define DONT_USE_KERNEL_STATUS // Do not update the kernel status
|
|
||||||
#define WIN32_USE_HEAP_API_FOR_MEMORY // Use the heap API to allocate memory
|
#define WIN32_USE_HEAP_API_FOR_MEMORY // Use the heap API to allocate memory
|
||||||
#define WIN32_NO_DEBUG_HELP_DLL // Do not call the DLL for debugging
|
#define WIN32_NO_DEBUG_HELP_DLL // Do not call the DLL for debugging
|
||||||
#define DONT_CHECK_HEAP // Do not check the status of the heap
|
|
||||||
#define DONT_ALLOW_RUN_ON_DEBUGGER // Do not allow running on the debugger
|
#define DONT_ALLOW_RUN_ON_DEBUGGER // Do not allow running on the debugger
|
||||||
|
|
||||||
#endif // VPN_SPEED
|
#endif // VPN_SPEED
|
||||||
@ -412,43 +410,35 @@ extern BOOL kernel_status_inited;
|
|||||||
#define KS_GETMAX64(id) (kernel_status_max[id])
|
#define KS_GETMAX64(id) (kernel_status_max[id])
|
||||||
#define KS_GETMAX(id) ((UINT)KS_GETMAX64(id))
|
#define KS_GETMAX(id) ((UINT)KS_GETMAX64(id))
|
||||||
|
|
||||||
#ifdef DONT_USE_KERNEL_STATUS
|
// Operations of the kernel status
|
||||||
// Disable operations of the kernel status
|
#define KS_INC(id) \
|
||||||
#define KS_INC(id)
|
if (IsTrackingEnabled()) { \
|
||||||
#define KS_DEC(id)
|
KS_LOCK(id); \
|
||||||
#define KS_ADD(id, n)
|
kernel_status[id]++; \
|
||||||
#define KS_SUB(id, n)
|
|
||||||
#else // DONT_USE_KERNEL_STATUS
|
|
||||||
// Enable operations of the kernel status
|
|
||||||
#define KS_INC(id) \
|
|
||||||
if (kernel_status_inited) { \
|
|
||||||
KS_LOCK(id); \
|
|
||||||
kernel_status[id]++; \
|
|
||||||
kernel_status_max[id] = MAX(kernel_status_max[id], kernel_status[id]); \
|
kernel_status_max[id] = MAX(kernel_status_max[id], kernel_status[id]); \
|
||||||
KS_UNLOCK(id); \
|
KS_UNLOCK(id); \
|
||||||
}
|
}
|
||||||
#define KS_DEC(id) \
|
#define KS_DEC(id) \
|
||||||
if (kernel_status_inited) { \
|
if (IsTrackingEnabled()) { \
|
||||||
KS_LOCK(id); \
|
KS_LOCK(id); \
|
||||||
kernel_status[id]--; \
|
kernel_status[id]--; \
|
||||||
kernel_status_max[id] = MAX(kernel_status_max[id], kernel_status[id]); \
|
kernel_status_max[id] = MAX(kernel_status_max[id], kernel_status[id]); \
|
||||||
KS_UNLOCK(id); \
|
KS_UNLOCK(id); \
|
||||||
}
|
}
|
||||||
#define KS_ADD(id, n) \
|
#define KS_ADD(id, n) \
|
||||||
if (kernel_status_inited) { \
|
if (IsTrackingEnabled()) { \
|
||||||
KS_LOCK(id); \
|
KS_LOCK(id); \
|
||||||
kernel_status[id] += n; \
|
kernel_status[id] += n; \
|
||||||
kernel_status_max[id] = MAX(kernel_status_max[id], kernel_status[id]); \
|
kernel_status_max[id] = MAX(kernel_status_max[id], kernel_status[id]); \
|
||||||
KS_UNLOCK(id); \
|
KS_UNLOCK(id); \
|
||||||
}
|
}
|
||||||
#define KS_SUB(id, n) \
|
#define KS_SUB(id, n) \
|
||||||
if (kernel_status_inited) { \
|
if (IsTrackingEnabled()) { \
|
||||||
KS_LOCK(id); \
|
KS_LOCK(id); \
|
||||||
kernel_status[id] -= n; \
|
kernel_status[id] -= n; \
|
||||||
kernel_status_max[id] = MAX(kernel_status_max[id], kernel_status[id]); \
|
kernel_status_max[id] = MAX(kernel_status_max[id], kernel_status[id]); \
|
||||||
KS_UNLOCK(id); \
|
KS_UNLOCK(id); \
|
||||||
}
|
}
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// Kernel status
|
// Kernel status
|
||||||
// String related
|
// String related
|
||||||
|
@ -972,10 +972,6 @@ SK *NewSkEx(bool no_compact)
|
|||||||
s->p = Malloc(sizeof(void *) * s->num_reserved);
|
s->p = Malloc(sizeof(void *) * s->num_reserved);
|
||||||
s->no_compact = no_compact;
|
s->no_compact = no_compact;
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackNewObj(POINTER_TO_UINT64(s), "SK", 0);
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_NEWSK_COUNT);
|
KS_INC(KS_NEWSK_COUNT);
|
||||||
|
|
||||||
@ -1011,10 +1007,6 @@ void CleanupSk(SK *s)
|
|||||||
DeleteLock(s->lock);
|
DeleteLock(s->lock);
|
||||||
Free(s);
|
Free(s);
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackDeleteObj(POINTER_TO_UINT64(s));
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_FREESK_COUNT);
|
KS_INC(KS_FREESK_COUNT);
|
||||||
}
|
}
|
||||||
@ -1278,10 +1270,6 @@ void CleanupQueue(QUEUE *q)
|
|||||||
DeleteLock(q->lock);
|
DeleteLock(q->lock);
|
||||||
Free(q);
|
Free(q);
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackDeleteObj(POINTER_TO_UINT64(q));
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_FREEQUEUE_COUNT);
|
KS_INC(KS_FREEQUEUE_COUNT);
|
||||||
}
|
}
|
||||||
@ -1297,10 +1285,6 @@ QUEUE *NewQueue()
|
|||||||
q->num_item = 0;
|
q->num_item = 0;
|
||||||
q->fifo = NewFifo();
|
q->fifo = NewFifo();
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackNewObj(POINTER_TO_UINT64(q), "QUEUE", 0);
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_NEWQUEUE_COUNT);
|
KS_INC(KS_NEWQUEUE_COUNT);
|
||||||
|
|
||||||
@ -1316,10 +1300,6 @@ QUEUE *NewQueueFast()
|
|||||||
q->num_item = 0;
|
q->num_item = 0;
|
||||||
q->fifo = NewFifoFast();
|
q->fifo = NewFifoFast();
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackNewObj(POINTER_TO_UINT64(q), "QUEUE", 0);
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_NEWQUEUE_COUNT);
|
KS_INC(KS_NEWQUEUE_COUNT);
|
||||||
|
|
||||||
@ -1783,10 +1763,6 @@ void CleanupList(LIST *o)
|
|||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_FREELIST_COUNT);
|
KS_INC(KS_FREELIST_COUNT);
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackDeleteObj(POINTER_TO_UINT64(o));
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the specified number is already in the list
|
// Check whether the specified number is already in the list
|
||||||
@ -2145,10 +2121,6 @@ LIST *NewListEx2(COMPARE *cmp, bool fast, bool fast_malloc)
|
|||||||
o->cmp = cmp;
|
o->cmp = cmp;
|
||||||
o->sorted = true;
|
o->sorted = true;
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackNewObj(POINTER_TO_UINT64(o), "LIST", 0);
|
|
||||||
#endif //DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_NEWLIST_COUNT);
|
KS_INC(KS_NEWLIST_COUNT);
|
||||||
|
|
||||||
@ -2422,10 +2394,6 @@ void CleanupFifo(FIFO *f)
|
|||||||
Free(f->p);
|
Free(f->p);
|
||||||
Free(f);
|
Free(f);
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackDeleteObj(POINTER_TO_UINT64(f));
|
|
||||||
#endif //DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_FREEFIFO_COUNT);
|
KS_INC(KS_FREEFIFO_COUNT);
|
||||||
}
|
}
|
||||||
@ -2472,10 +2440,6 @@ FIFO *NewFifoEx2(bool fast, bool fixed)
|
|||||||
f->p = Malloc(FIFO_INIT_MEM_SIZE);
|
f->p = Malloc(FIFO_INIT_MEM_SIZE);
|
||||||
f->fixed = false;
|
f->fixed = false;
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackNewObj(POINTER_TO_UINT64(f), "FIFO", 0);
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_NEWFIFO_COUNT);
|
KS_INC(KS_NEWFIFO_COUNT);
|
||||||
|
|
||||||
@ -2793,10 +2757,6 @@ BUF *NewBuf()
|
|||||||
b->Current = 0;
|
b->Current = 0;
|
||||||
b->SizeReserved = INIT_BUF_SIZE;
|
b->SizeReserved = INIT_BUF_SIZE;
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackNewObj(POINTER_TO_UINT64(b), "BUF", 0);
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// KS
|
// KS
|
||||||
KS_INC(KS_NEWBUF_COUNT);
|
KS_INC(KS_NEWBUF_COUNT);
|
||||||
KS_INC(KS_CURRENT_BUF_COUNT);
|
KS_INC(KS_CURRENT_BUF_COUNT);
|
||||||
@ -3241,10 +3201,6 @@ void FreeBuf(BUF *b)
|
|||||||
// KS
|
// KS
|
||||||
KS_INC(KS_FREEBUF_COUNT);
|
KS_INC(KS_FREEBUF_COUNT);
|
||||||
KS_DEC(KS_CURRENT_BUF_COUNT);
|
KS_DEC(KS_CURRENT_BUF_COUNT);
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
// TrackDeleteObj(POINTER_TO_UINT64(b));
|
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compare BUFs whether two are identical
|
// Compare BUFs whether two are identical
|
||||||
@ -3802,7 +3758,11 @@ void Free(void *addr)
|
|||||||
// Check the memtag
|
// Check the memtag
|
||||||
void CheckMemTag(MEMTAG *tag)
|
void CheckMemTag(MEMTAG *tag)
|
||||||
{
|
{
|
||||||
#ifndef DONT_CHECK_HEAP
|
if (IsTrackingEnabled() == false)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (tag == NULL)
|
if (tag == NULL)
|
||||||
{
|
{
|
||||||
@ -3815,7 +3775,6 @@ void CheckMemTag(MEMTAG *tag)
|
|||||||
AbortExitEx("CheckMemTag: tag->Magic != MEMTAG_MAGIC");
|
AbortExitEx("CheckMemTag: tag->Magic != MEMTAG_MAGIC");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // DONT_CHECK_HEAP
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZeroMalloc
|
// ZeroMalloc
|
||||||
@ -3859,9 +3818,7 @@ void *InternalMalloc(UINT size)
|
|||||||
OSSleep(MEMORY_SLEEP_TIME);
|
OSSleep(MEMORY_SLEEP_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
TrackNewObj(POINTER_TO_UINT64(addr), "MEM", size);
|
TrackNewObj(POINTER_TO_UINT64(addr), "MEM", size);
|
||||||
#endif //DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
@ -3879,9 +3836,7 @@ void InternalFree(void *addr)
|
|||||||
KS_DEC(KS_CURRENT_MEM_COUNT);
|
KS_DEC(KS_CURRENT_MEM_COUNT);
|
||||||
KS_INC(KS_FREE_COUNT);
|
KS_INC(KS_FREE_COUNT);
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
TrackDeleteObj(POINTER_TO_UINT64(addr));
|
TrackDeleteObj(POINTER_TO_UINT64(addr));
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
// Memory release
|
// Memory release
|
||||||
OSMemoryFree(addr);
|
OSMemoryFree(addr);
|
||||||
@ -3914,9 +3869,7 @@ void *InternalReAlloc(void *addr, UINT size)
|
|||||||
OSSleep(MEMORY_SLEEP_TIME);
|
OSSleep(MEMORY_SLEEP_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DONT_USE_KERNEL_STATUS
|
|
||||||
TrackChangeObjSize(POINTER_TO_UINT64(addr), size, POINTER_TO_UINT64(new_addr));
|
TrackChangeObjSize(POINTER_TO_UINT64(addr), size, POINTER_TO_UINT64(new_addr));
|
||||||
#endif // DONT_USE_KERNEL_STATUS
|
|
||||||
|
|
||||||
return new_addr;
|
return new_addr;
|
||||||
}
|
}
|
||||||
|
@ -1071,8 +1071,6 @@ void FreeTable()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackingDisable();
|
|
||||||
|
|
||||||
num = LIST_NUM(TableList);
|
num = LIST_NUM(TableList);
|
||||||
tables = ToArray(TableList);
|
tables = ToArray(TableList);
|
||||||
for (i = 0;i < num;i++)
|
for (i = 0;i < num;i++)
|
||||||
@ -1088,8 +1086,6 @@ void FreeTable()
|
|||||||
Free(tables);
|
Free(tables);
|
||||||
|
|
||||||
Zero(old_table_name, sizeof(old_table_name));
|
Zero(old_table_name, sizeof(old_table_name));
|
||||||
|
|
||||||
TrackingEnable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read a string table from the buffer
|
// Read a string table from the buffer
|
||||||
@ -1479,8 +1475,6 @@ bool LoadTableW(wchar_t *filename)
|
|||||||
|
|
||||||
Zero(replace_name, sizeof(replace_name));
|
Zero(replace_name, sizeof(replace_name));
|
||||||
|
|
||||||
TrackingDisable();
|
|
||||||
|
|
||||||
b = ReadDump("@table_name.txt");
|
b = ReadDump("@table_name.txt");
|
||||||
if (b != NULL)
|
if (b != NULL)
|
||||||
{
|
{
|
||||||
@ -1500,9 +1494,5 @@ bool LoadTableW(wchar_t *filename)
|
|||||||
|
|
||||||
ret = LoadTableMain(filename);
|
ret = LoadTableMain(filename);
|
||||||
|
|
||||||
TrackingEnable();
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,27 +127,14 @@ static LOCK *obj_lock;
|
|||||||
static LOCK *obj_id_lock;
|
static LOCK *obj_id_lock;
|
||||||
static UINT obj_id;
|
static UINT obj_id;
|
||||||
static LOCK *cs_lock;
|
static LOCK *cs_lock;
|
||||||
static bool disable_tracking = false;
|
|
||||||
static TRACKING_LIST **hashlist;
|
static TRACKING_LIST **hashlist;
|
||||||
|
|
||||||
static bool do_not_get_callstack;
|
static bool do_not_get_callstack;
|
||||||
|
|
||||||
// Enable the tracking
|
|
||||||
void TrackingEnable()
|
|
||||||
{
|
|
||||||
disable_tracking = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable the tracking
|
|
||||||
void TrackingDisable()
|
|
||||||
{
|
|
||||||
disable_tracking = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get whether the tracking is enabled
|
// Get whether the tracking is enabled
|
||||||
bool IsTrackingEnabled()
|
bool IsTrackingEnabled()
|
||||||
{
|
{
|
||||||
return !disable_tracking;
|
return (IsDebug() || IsMemCheck()) && kernel_status_inited;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Memory debug menu
|
// Memory debug menu
|
||||||
@ -482,14 +469,9 @@ void TrackNewObj(UINT64 addr, char *name, UINT size)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsMemCheck() == false)
|
if ((IsTrackingEnabled() && IsMemCheck()) == false)
|
||||||
{
|
|
||||||
// Don't track in the release mode
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disable_tracking)
|
|
||||||
{
|
{
|
||||||
|
// Don't track in detail if the memory check option is not specified
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,14 +510,9 @@ void TrackDeleteObj(UINT64 addr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsMemCheck() == false)
|
if ((IsTrackingEnabled() && IsMemCheck()) == false)
|
||||||
{
|
|
||||||
// Don't track in the release mode
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disable_tracking)
|
|
||||||
{
|
{
|
||||||
|
// Don't track in detail if the memory check option is not specified
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,11 +522,7 @@ void TrackDeleteObj(UINT64 addr)
|
|||||||
if (o == NULL)
|
if (o == NULL)
|
||||||
{
|
{
|
||||||
UnlockTrackingList();
|
UnlockTrackingList();
|
||||||
|
Debug("TrackDeleteObj(): 0x%x not found in tracking list!\n", addr);
|
||||||
if (IsDebug())
|
|
||||||
{
|
|
||||||
printf("TrackDeleteObj: 0x%x is not Object!!\n", (void *)addr);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DeleteTrackingList(o, true);
|
DeleteTrackingList(o, true);
|
||||||
@ -567,14 +540,9 @@ void TrackChangeObjSize(UINT64 addr, UINT size, UINT64 new_addr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsMemCheck() == false)
|
if ((IsTrackingEnabled() && IsMemCheck()) == false)
|
||||||
{
|
|
||||||
// Don't track in the release mode
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disable_tracking)
|
|
||||||
{
|
{
|
||||||
|
// Don't track in detail if the memory check option is not specified
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,10 +188,6 @@ void PrintObjectList(TRACKING_OBJECT *o);
|
|||||||
void PrintObjectInfo(TRACKING_OBJECT *o);
|
void PrintObjectInfo(TRACKING_OBJECT *o);
|
||||||
void DebugPrintObjectInfo(UINT id);
|
void DebugPrintObjectInfo(UINT id);
|
||||||
|
|
||||||
void TrackingEnable();
|
|
||||||
void TrackingDisable();
|
|
||||||
bool IsTrackingEnabled();
|
bool IsTrackingEnabled();
|
||||||
|
|
||||||
#endif // TRACKING_H
|
#endif // TRACKING_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ set_target_properties(PenCore
|
|||||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
||||||
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(PenCore cedar mayaqua)
|
target_link_libraries(PenCore cedar mayaqua)
|
||||||
|
@ -7,4 +7,11 @@ set_target_properties(hamcorebuilder
|
|||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(hamcorebuilder
|
||||||
|
PROPERTIES
|
||||||
|
PDB_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(hamcorebuilder cedar mayaqua)
|
target_link_libraries(hamcorebuilder cedar mayaqua)
|
||||||
|
@ -13,6 +13,13 @@ set_target_properties(vpnbridge
|
|||||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(vpnbridge
|
||||||
|
PROPERTIES
|
||||||
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpnbridge cedar mayaqua)
|
target_link_libraries(vpnbridge cedar mayaqua)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
@ -13,6 +13,13 @@ set_target_properties(vpnclient
|
|||||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(vpnclient
|
||||||
|
PROPERTIES
|
||||||
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpnclient cedar mayaqua)
|
target_link_libraries(vpnclient cedar mayaqua)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
@ -13,6 +13,13 @@ set_target_properties(vpncmd
|
|||||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(vpncmd
|
||||||
|
PROPERTIES
|
||||||
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpncmd cedar mayaqua)
|
target_link_libraries(vpncmd cedar mayaqua)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
@ -17,6 +17,7 @@ set_target_properties(vpncmgr
|
|||||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(vpncmgr cedar mayaqua)
|
target_link_libraries(vpncmgr cedar mayaqua)
|
||||||
|
@ -13,6 +13,13 @@ set_target_properties(vpnserver
|
|||||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(vpnserver
|
||||||
|
PROPERTIES
|
||||||
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpnserver cedar mayaqua)
|
target_link_libraries(vpnserver cedar mayaqua)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
|
@ -17,6 +17,7 @@ set_target_properties(vpnsmgr
|
|||||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(vpnsmgr cedar mayaqua)
|
target_link_libraries(vpnsmgr cedar mayaqua)
|
||||||
|
@ -17,4 +17,11 @@ set_target_properties(vpntest
|
|||||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(vpntest
|
||||||
|
PROPERTIES
|
||||||
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(vpntest cedar mayaqua)
|
target_link_libraries(vpntest cedar mayaqua)
|
||||||
|
Loading…
Reference in New Issue
Block a user