Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono][debugger] Implementing mscordbi to support iCorDebug on mono runtime #47639

Merged
merged 67 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
46acad4
Implementing mscordbi on mono to support icordebug
thaystg Jan 27, 2021
086f051
Fix eval, fix step and cancel step, remove suspend status on mscordbi
thaystg Jan 28, 2021
7baa9d3
Using log from coreclr as mscordbi does
thaystg Jan 29, 2021
c6cd6e8
Missing files
thaystg Feb 2, 2021
c5ce818
Removing eglib from implementation
thaystg Feb 3, 2021
b3629ff
Compiling on Mac
thaystg Feb 5, 2021
d78b7a2
Compiling and Working on windows.
thaystg Feb 5, 2021
130866a
Generating libmscordbi on mac
thaystg Feb 5, 2021
759501d
Fix socket on mac
thaystg Feb 12, 2021
74524ab
Counting references, deleting objects, removing unecessary properties,
thaystg Feb 19, 2021
2dcaeb4
Merge branch 'thays_icordbg_pr2' of github.com:thaystg/runtime into t…
thaystg Feb 19, 2021
12127b9
Checking error when get reply from debugger
thaystg Feb 19, 2021
45dce7b
Merge branch 'master' into thays_icordbg_pr2
thaystg Feb 19, 2021
217dc72
Fix format, reuse regmeta from coreclr and try to fix compilation on
thaystg Feb 22, 2021
91e7497
Dont build when target is android or ios or wasm
thaystg Feb 22, 2021
d01a9ed
Fix error unused variable
thaystg Feb 22, 2021
be8f56d
Fixing error: 'CFUserNotificationDisplayAlert' is unavailable: not
thaystg Feb 22, 2021
11a62cb
Fix compilation error on Linux
thaystg Feb 22, 2021
ac1735f
Fix function not found in maccatalyst
thaystg Feb 22, 2021
d3cc3b4
Dont compile mscordbi on maccatalyst
thaystg Feb 22, 2021
2ff0e68
Fix compilation on linux
thaystg Feb 22, 2021
a1cb8e6
Fix compilation on android, ios and browser
thaystg Feb 22, 2021
9a98304
Fix compilation on linux
thaystg Feb 22, 2021
e3b74f4
Fix cross compiling
thaystg Feb 22, 2021
b7de3c8
Fix compilation x86 windows
thaystg Feb 23, 2021
6c3c0a2
Merge branch 'thays_icordbg_pr2' of github.com:thaystg/runtime into t…
thaystg Feb 23, 2021
8e54659
Fix x86 compilation
thaystg Feb 23, 2021
cc38142
Fix compilation on windows
thaystg Feb 23, 2021
9fdaaa2
Fix cmake error
thaystg Feb 23, 2021
6e53c1a
Fix cmake
thaystg Feb 23, 2021
a9d86ef
Fix arm64 mac
thaystg Feb 23, 2021
785d53c
Fix windows compilation
thaystg Feb 23, 2021
f1de772
Fix memory leak
thaystg Feb 23, 2021
5939ca5
Returning E_NOTIMPL where it was possible and it's not implemented as
thaystg Feb 23, 2021
8a6f3e9
Fix what @cshung
thaystg Feb 23, 2021
768b5e9
Use only one ref count
thaystg Feb 23, 2021
cdcbe2d
Adding ex_try everywhere that we could have an allocation failure.
thaystg Feb 23, 2021
7cc409c
Implementing get class
thaystg Feb 23, 2021
abc2aa3
Apply suggestions from code review
thaystg Feb 24, 2021
208d222
Fix what @noahfalk suggested in his review.
thaystg Feb 24, 2021
5363bce
Fixing what was suggested by @viniciusjarina
thaystg Feb 24, 2021
24bccdb
Fix what was suggested by @viniciusjarina
thaystg Feb 24, 2021
bafe8ee
Changing what @noahfalk suggested
thaystg Feb 25, 2021
5682529
Accept more than 1 stepper per thread
thaystg Mar 1, 2021
8627c1a
Changing what was suggested by @noahfalk
thaystg Mar 2, 2021
0248812
Using CORDB_ADDRESS to return addresses from debugged process
thaystg Mar 4, 2021
10389fd
Fix eval
thaystg Mar 4, 2021
3ebfdd8
Update src/mono/mono/mini/debugger-agent.c
thaystg Mar 4, 2021
c5b4d4c
Using 1:1 with runtime for cordbtype and cordbclass
thaystg Mar 5, 2021
02349c3
Rnaming methods as suggested by @lambdageek
thaystg Mar 5, 2021
c02a256
Update src/mono/dbi/cordb-process.h
thaystg Mar 8, 2021
a16ce8e
Update CMakeLists.txt
thaystg Mar 8, 2021
94d957c
Fix arm64 compilation
thaystg Mar 9, 2021
ae5f701
Fix arm64 compilation
thaystg Mar 9, 2021
2aae463
Fix error cmake
thaystg Mar 9, 2021
b5de06d
fix arm64 compilation
thaystg Mar 9, 2021
a8f0318
Fix arm64 compilation
thaystg Mar 9, 2021
25f24bc
Fix arm64 compilation
thaystg Mar 10, 2021
6032aa3
Fix arm64 compilation
thaystg Mar 10, 2021
8be3bfd
Revert "Fix arm64 compilation"
thaystg Mar 11, 2021
946f27a
Revert "Fix arm64 compilation"
thaystg Mar 11, 2021
df1ac59
Revert "fix arm64 compilation"
thaystg Mar 11, 2021
1886964
Revert "Fix error cmake"
thaystg Mar 11, 2021
5082ae4
Revert "Fix arm64 compilation"
thaystg Mar 11, 2021
eb47443
Revert "Fix arm64 compilation"
thaystg Mar 11, 2021
88f5021
Removing arm64 compilation
thaystg Mar 11, 2021
8278121
Remove arm64 compilation
thaystg Mar 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ endif()
### End of OS specific checks

add_subdirectory(mono)
add_subdirectory(dbi)

configure_file(cmake/config.h.in config.h)
configure_file(cmake/eglib-config.h.cmake.in mono/eglib/eglib-config.h) # TODO: eglib-config.h is not needed, we're using hardcoded eglib-config.hw
216 changes: 216 additions & 0 deletions src/mono/dbi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
project(mscordbi)


include_directories(
${PROJECT_BINARY_DIR}/
${PROJECT_BINARY_DIR}/../..
${CMAKE_CURRENT_SOURCE_DIR}/../..
${CMAKE_CURRENT_BINARY_DIR}/../
${PROJECT_SOURCE_DIR}/../mono/mini/
${PROJECT_SOURCE_DIR}/../
${PROJECT_SOURCE_DIR}/../dbi
${PROJECT_SOURCE_DIR}/../../coreclr/md/enc
${PROJECT_SOURCE_DIR}/../../coreclr/inc
${PROJECT_SOURCE_DIR}/../../coreclr/pal/prebuilt/inc
${PROJECT_SOURCE_DIR}/../../coreclr/md/inc
${PROJECT_SOURCE_DIR}/../../coreclr/md/compiler)


set(UTILCODE_COMMON_SOURCES_BASE
clrhost_nodependencies.cpp
ccomprc.cpp
ex.cpp
sbuffer.cpp
sstring_com.cpp
fstring.cpp
namespaceutil.cpp
makepath.cpp
splitpath.cpp
clrconfig.cpp
configuration.cpp
collections.cpp
posterror.cpp
fstream.cpp
clrhelpers.cpp
stgpool.cpp
stgpooli.cpp
stgpoolreadonly.cpp
utsem.cpp
peinformation.cpp
check.cpp
log.cpp
arraylist.cpp
bitvector.cpp
comex.cpp
guidfromname.cpp
memorypool.cpp
iallocator.cpp
loaderheap.cpp
outstring.cpp
ilformatter.cpp
opinfo.cpp
corimage.cpp
format1.cpp
prettyprintsig.cpp
regutil.cpp
sha1.cpp
sigbuilder.cpp
sigparser.cpp
sstring.cpp
util_nodependencies.cpp
utilmessagebox.cpp
safewrap.cpp
clrhost.cpp
cycletimer.cpp
md5.cpp
util.cpp
stresslog.cpp
debug.cpp
pedecoder.cpp
winfix.cpp
longfilepathwrappers.cpp
yieldprocessornormalized.cpp
hostimpl.cpp
)

set(MDRUNTIMERW_SOURCES_BASE
md/enc/liteweightstgdbrw.cpp
md/enc/metamodelenc.cpp
md/enc/metamodelrw.cpp
md/enc/peparse.cpp
md/enc/rwutil.cpp
md/enc/stgio.cpp
md/enc/stgtiggerstorage.cpp
md/enc/stgtiggerstream.cpp
md/enc/mdinternalrw.cpp
md/enc/pdbheap.cpp
md/compiler/importhelper.cpp
md/runtime/metamodel.cpp
md/runtime/mdcolumndescriptors.cpp
md/runtime/recordpool.cpp
md/runtime/mdfileformat.cpp
)

set(MDRUNTIMERW_HEADERS_BASE
inc/corhdr.h
inc/metadata.h
inc/mdfileformat.h
inc/pedecoder.h
inc/pedecoder.inl
inc/posterror.h
inc/sstring.h
inc/sstring.inl
md/compiler/importhelper.h
md/compiler/regmeta.h
md/hotdata/hotdataformat.h
md/inc/liteweightstgdb.h
md/inc/mdinternalrw.h
md/inc/mdlog.h
md/inc/metadatahash.h
md/inc/metamodel.h
md/inc/metamodelro.h
md/inc/metamodelrw.h
md/inc/pdbheap.h
md/inc/portablepdbmdds.h
md/inc/portablepdbmdi.h
md/inc/rwutil.h
md/inc/stgio.h
md/inc/stgtiggerstorage.h
md/inc/stgtiggerstream.h
md/inc/streamutil.h
md/runtime/mdinternalro.h
inc/debugmacros.h
)

set(mscorbi_sources_base
cordb.cpp
cordb.h
cordb-appdomain.cpp
cordb-appdomain.h
cordb-assembly.cpp
cordb-assembly.h
cordb-blocking-obj.cpp
cordb-blocking-obj.h
cordb-breakpoint.cpp
cordb-breakpoint.h
cordb-chain.cpp
cordb-chain.h
cordb-class.cpp
cordb-class.h
cordb-code.cpp
cordb-code.h
cordb-eval.cpp
cordb-eval.h
cordb-frame.cpp
cordb-frame.h
cordb-function.cpp
cordb-function.h
cordb-process.cpp
cordb-process.h
cordb-register.cpp
cordb-register.h
cordb-stepper.cpp
cordb-stepper.h
cordb-symbol.cpp
cordb-symbol.h
cordb-thread.cpp
cordb-thread.h
cordb-type.cpp
cordb-type.h
cordb-value.cpp
cordb-value.h
)

if(HOST_WIN32)
set(OS_LIBS bcrypt.lib Mswsock.lib ws2_32.lib psapi.lib version.lib advapi32.lib winmm.lib kernel32.lib)
endif()


if(HOST_WIN32)
list(APPEND UTILCODE_COMMON_SOURCES_BASE
dacutil.cpp
dlwrap.cpp
securitywrapper.cpp
securityutil.cpp
stacktrace.cpp
)
endif(HOST_WIN32)

addprefix(mscorbi_sources ../dbi/ "${mscorbi_sources_base}")
addprefix(UTILCODE_COMMON_SOURCES ${PROJECT_SOURCE_DIR}/../../coreclr/utilcode/ "${UTILCODE_COMMON_SOURCES_BASE}")
addprefix(MDRUNTIMERW_SOURCES ${PROJECT_SOURCE_DIR}/../../coreclr/ "${MDRUNTIMERW_SOURCES_BASE}")
addprefix(MDRUNTIMERW_HEADERS ${PROJECT_SOURCE_DIR}/../../coreclr/ "${MDRUNTIMERW_HEADERS_BASE}")
addprefix(eglib_sources ../mono/eglib/ "${eglib_sources}")

add_library(mscordbi SHARED "${eglib_sources};${mscorbi_sources};${PROJECT_SOURCE_DIR}/../mono/mini/debugger-protocol.c;${PROJECT_SOURCE_DIR}/../../coreclr/pal/prebuilt/idl/xcordebug_i.cpp;${PROJECT_SOURCE_DIR}/../../coreclr/pal/prebuilt/idl/cordebug_i.cpp")
add_library(mdruntimerw-dbi STATIC "${MDRUNTIMERW_SOURCES};${MDRUNTIMERW_HEADERS}")
add_library(utilcode STATIC "${UTILCODE_COMMON_SOURCES}")


target_link_libraries(mscordbi mdruntimerw-dbi utilcode ${OS_LIBS})
target_precompile_headers(mdruntimerw-dbi PRIVATE ${PROJECT_SOURCE_DIR}/../../coreclr/md/enc/stdafx.h)
target_precompile_headers(utilcode PRIVATE ${PROJECT_SOURCE_DIR}/../../coreclr/utilcode/stdafx.h)
target_precompile_headers(mscordbi PRIVATE ${PROJECT_SOURCE_DIR}/../../coreclr/utilcode/stdafx.h)

if(HOST_AMD64)
add_compile_definitions(TARGET_AMD64)
add_compile_definitions(HOST_64BIT)
endif(HOST_AMD64)

if(HOST_WIN32)
add_compile_definitions(HOST_WINDOWS)
target_compile_definitions(utilcode PRIVATE _CRTIMP=)
endif(HOST_WIN32)

add_compile_definitions(DBI_COMPONENT)
add_compile_definitions(FEATURE_COMINTEROP)
add_compile_definitions(SELF_NO_HOST)


SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
SET_TARGET_PROPERTIES(mdruntimerw-dbi PROPERTIES LINKER_LANGUAGE CXX)
SET_TARGET_PROPERTIES(utilcode PROPERTIES LINKER_LANGUAGE CXX)

set_target_properties(mdruntimerw-dbi PROPERTIES DBI_COMPONENT TRUE)

set_source_files_properties(${PROJECT_SOURCE_DIR}/../mono/mini/debugger-protocol.c PROPERTIES LANGUAGE CXX)
Loading