Skip to content

Commit

Permalink
[debugger]Componentize debugger (dotnet#54887)
Browse files Browse the repository at this point in the history
* First version of componentize debugger

* Trying to save history of debugger-agent.h

* adding debugger-agent.h as a new file

* Fixing compilation

* Fixing wasm compilation

* Fixing wasm compilation.

* Running wasm app.

* Unrelated change.

* Fixing debugging console app

* Fixing compilation on linux

* Fixing wasm debugger.

* Remove unused callbacks

* Moving mini-wasm-debugger to component folder.

* Fixing wasm debugger.

* Fix non wasm compilation

* Fixing compilation on other platforms.

* Removing more code from component callback.

* Transforming more functions into static.

* Fix compilation.

* Moving more files to component folder.

* moving files.

* Fix android compilation.

* Fix wasm compilation.

* Try to fix windows compilation.

* Changing what @lambdageek suggested.

* Changing what @lamdbageek suggested.

* Not used anymore.

* Using the same function to initialize wasm and non-wasm debugger.

* Rollback exported function name.

* Changing where components are initialized.
Saving debugger transport information outside the component.

* set sdb options before component startup.

* Fixing console debug.

* Fix ios compilation.

* Fix calling parse_options without parameters.

* Last @lambdageek suggestions.
  • Loading branch information
thaystg authored Jul 1, 2021
1 parent 8dad364 commit 08a7b23
Show file tree
Hide file tree
Showing 83 changed files with 1,146 additions and 874 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@
<PlatformManifestFileEntry Include="libmono-component-hot_reload-stub-static.a" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-hot_reload-static.lib" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-hot_reload-stub-static.lib" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-debugger.dll" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-debugger.so" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-debugger.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-debugger-static.a" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-debugger-stub-static.a" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-debugger-static.lib" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-component-debugger-stub-static.lib" IsNative="true" />
<!-- Mono WASM-specific files -->
<PlatformManifestFileEntry Include="libmono-ee-interp.a" IsNative="true" />
<PlatformManifestFileEntry Include="libmono-icall-table.a" IsNative="true" />
Expand Down
4 changes: 2 additions & 2 deletions src/mono/dlls/mscordbi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ if (CLR_CMAKE_HOST_UNIX)
append("-Wno-strict-prototypes -Wno-deprecated -Wno-pointer-arith" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif (CLR_CMAKE_HOST_UNIX)

add_library(mscordbi SHARED "${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(mscordbi SHARED "${mscorbi_sources};${PROJECT_SOURCE_DIR}/../../mono/component/debugger-protocol.c;${PROJECT_SOURCE_DIR}/../../../coreclr/pal/prebuilt/idl/xcordebug_i.cpp;${PROJECT_SOURCE_DIR}/../../../coreclr/pal/prebuilt/idl/cordebug_i.cpp")

#SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})

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

set(COREDBI_LIBRARIES
utilcodestaticnohost
Expand Down
2 changes: 1 addition & 1 deletion src/mono/dlls/mscordbi/cordb.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "corhdr.h"
#include "xcordebug.h"

#include <mono/mini/debugger-protocol.h>
#include <mono/component/debugger-protocol.h>
#include <mono/utils/mono-publib.h>

#include "arraylist.h"
Expand Down
22 changes: 22 additions & 0 deletions src/mono/mono/component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(MONO_EVENTPIPE_GEN_INCLUDE_PATH "${CMAKE_CURRENT_BINARY_DIR}/eventpipe")

set(MONO_HOT_RELOAD_COMPONENT_NAME "hot_reload")
set(MONO_DIAGNOSTICS_TRACING_COMPONENT_NAME "diagnostics_tracing")
set(MONO_DEBUGGER_COMPONENT_NAME "debugger")

# a list of every component.
set(components "")
Expand All @@ -14,6 +15,27 @@ set(components "")
# component_name-sources list for each component, and a
# component_name-stub-sources list for the component stub.

# debugger
list(APPEND components
${MONO_DEBUGGER_COMPONENT_NAME}
)
set(${MONO_DEBUGGER_COMPONENT_NAME}-sources
${MONO_COMPONENT_PATH}/debugger.c
${MONO_COMPONENT_PATH}/debugger.h
${MONO_COMPONENT_PATH}/debugger-agent.c
${MONO_COMPONENT_PATH}/debugger-agent.h
${MONO_COMPONENT_PATH}/debugger-engine.c
${MONO_COMPONENT_PATH}/debugger-engine.h
${MONO_COMPONENT_PATH}/debugger-state-machine.h
${MONO_COMPONENT_PATH}/debugger-state-machine.c
${MONO_COMPONENT_PATH}/mini-wasm-debugger.c
${MONO_COMPONENT_PATH}/debugger-protocol.h
${MONO_COMPONENT_PATH}/debugger-protocol.c
)
set(${MONO_DEBUGGER_COMPONENT_NAME}-stub-sources
${MONO_COMPONENT_PATH}/debugger-stub.c
)

# hot_reload
list(APPEND components
${MONO_HOT_RELOAD_COMPONENT_NAME}
Expand Down
Loading

0 comments on commit 08a7b23

Please sign in to comment.