Skip to content

Commit

Permalink
Merge pull request #129 from chaoticgd/refactor
Browse files Browse the repository at this point in the history
Do a big refactor
  • Loading branch information
chaoticgd authored Oct 27, 2023
2 parents 628938f + 02e6aff commit 66c12ce
Show file tree
Hide file tree
Showing 34 changed files with 1,792 additions and 1,169 deletions.
55 changes: 42 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,66 @@ endif()

include(cmake/version_finder.cmake)

add_executable(demangle demangle.cpp)
target_link_libraries(demangle ccc demanglegnu versioninfo)

add_executable(objdump objdump.cpp)
target_link_libraries(objdump ccc versioninfo)

add_executable(stdump stdump.cpp)
target_link_libraries(stdump ccc versioninfo)
add_test(NAME stdump_test COMMAND stdump test ${CMAKE_SOURCE_DIR}/test)

add_executable(uncc uncc.cpp)
target_link_libraries(uncc ccc demanglegnu versioninfo)

add_library(ccc STATIC
ccc/analysis.cpp
ccc/analysis.h
ccc/ast.cpp
ccc/ast.h
ccc/data_refinement.cpp
ccc/data_refinement.h
ccc/dependency.cpp
ccc/dependency.h
ccc/elf.cpp
ccc/elf.h
ccc/insn.cpp
ccc/insn.h
ccc/mdebug.cpp
ccc/mdebug.h
ccc/module.cpp
ccc/module.h
ccc/print_cpp.cpp
ccc/print_cpp.h
ccc/print_json.cpp
ccc/print_json.h
ccc/registers.cpp
ccc/registers.h
ccc/stabs.cpp
ccc/stabs.h
ccc/stabs_to_ast.cpp
ccc/stabs_to_ast.h
ccc/symbols.cpp
ccc/symbols.h
ccc/tables.cpp
ccc/tables.h
ccc/util.cpp
ccc/util.h
)

add_library(ccc_platform STATIC
platform/file.cpp
platform/file.h
)

add_executable(demangle demangle.cpp)
target_link_libraries(demangle ccc demanglegnu versioninfo)

add_executable(objdump objdump.cpp)
target_link_libraries(objdump ccc ccc_platform versioninfo)

add_executable(stdump stdump.cpp)
target_link_libraries(stdump ccc ccc_platform versioninfo)
add_test(NAME stdump_test COMMAND stdump test ${CMAKE_SOURCE_DIR}/test)

add_executable(uncc uncc.cpp)
target_link_libraries(uncc ccc ccc_platform demanglegnu versioninfo)

if(WIN32)
target_sources(demangle PUBLIC ccc.manifest)
target_sources(objdump PUBLIC ccc.manifest)
target_sources(stdump PUBLIC ccc.manifest)
target_sources(uncc PUBLIC ccc.manifest)
endif()

add_subdirectory(demanglegnu)

# All the files to be included in a release.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Use of a code formatter such as `clang-format` or `astyle` on the output is reco
stdump.cpp: See above.
uncc.cpp: See above.
ccc/analysis.cpp: Runs all the different analysis passes.
ccc/ast.cpp: Converts parsed STABS types to a C++ AST structure.
ccc/ast.cpp: Defines a C++ AST structure.
ccc/data_refinement.cpp: Convert global variable data into a structured AST.
ccc/dependency.cpp: Try to infer information about which types belong to which files.
ccc/elf.cpp: Parses ELF files.
Expand All @@ -63,10 +63,12 @@ Use of a code formatter such as `clang-format` or `astyle` on the output is reco
ccc/print_json.cpp: Prints out AST nodes as JSON.
ccc/registers.cpp: Enums for EE core MIPS registers.
ccc/stabs.cpp: Parses STABS types.
ccc/stabs_to_ast.cpp: Converts parsed STABS types into an AST.
ccc/symbols.cpp: Parses the STABS and non-STABS symbols.
ccc/tables.cpp: Table of EE core MIPS instructions.
ccc/util.cpp: Miscellaneous utilities.

platform/file.cpp: Utility functions for reading files.

## Resources

- [Third Eye Software and the MIPS symbol table (Peter Rowell)](http://datahedron.com/mips.html) / [in-repo mirror](docs/ThirdEyeSoftwareAndTheMIPSSymbolTable.html) / [archive.org mirror](https://web.archive.org/web/20230605005654/http://datahedron.com/mips.html)
Expand Down
9 changes: 9 additions & 0 deletions ccc.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity type="win32" name="CCC" version="6.0.0.0"/>
<application>
<windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>
</assembly>
Loading

0 comments on commit 66c12ce

Please sign in to comment.