Skip to content

Commit

Permalink
Update stable to Ghidra v11.0 (#230)
Browse files Browse the repository at this point in the history
* Fix a few more sleigh_RELEASE_IS_HEAD checks

* Update stable sleighspec file list

---------

Co-authored-by: Eric Kilmer <[email protected]>
  • Loading branch information
tetsuo-cpp and ekilmer authored Jan 2, 2024
1 parent a0345f9 commit 81a04f2
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 28 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ set(public_include_header_list
"${library_root}/xml_arch.hh"
"${library_root}/unionresolve.hh"
"${library_root}/marshal.hh"
"${library_root}/analyzesigs.hh"
"${library_root}/modelrules.hh"
"${library_root}/signature.hh"
"${library_root}/signature_ghidra.hh"
)
if(sleigh_RELEASE_IS_HEAD)
list(APPEND public_include_header_list
"${library_root}/analyzesigs.hh"
"${library_root}/modelrules.hh"
"${library_root}/signature.hh"
"${library_root}/signature_ghidra.hh"
)
endif()
# if(sleigh_RELEASE_IS_HEAD)
# list(APPEND public_include_header_list
# )
# endif()
# Create custom target so that IDEs know these files are part of the sources
add_custom_target(sleigh_all_headers SOURCES ${public_include_header_list})
set(public_headers_dir ${CMAKE_CURRENT_BINARY_DIR}/include)
Expand Down
24 changes: 12 additions & 12 deletions src/setup-ghidra-source.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set_property(CACHE sleigh_RELEASE_TYPE PROPERTY STRINGS "stable" "HEAD")
find_package(Git REQUIRED)

# Ghidra pinned stable version commit
set(ghidra_version "10.4")
set(ghidra_version "11.0")
set(ghidra_git_tag "Ghidra_${ghidra_version}_build")
set(ghidra_shallow TRUE)

Expand Down Expand Up @@ -162,13 +162,13 @@ set(sleigh_deccore_source_list
"${library_root}/opbehavior.cc"
"${library_root}/paramid.cc"
"${library_root}/unionresolve.cc"
"${library_root}/modelrules.cc"
"${library_root}/signature.cc"
)
if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
list(APPEND sleigh_deccore_source_list
"${library_root}/modelrules.cc"
"${library_root}/signature.cc"
)
endif()
# if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
# list(APPEND sleigh_deccore_source_list
# )
# endif()

set(sleigh_extra_source_list
"${library_root}/callgraph.cc"
Expand Down Expand Up @@ -211,12 +211,12 @@ set(sleigh_ghidra_source_list
"${library_root}/ghidra_process.cc"
"${library_root}/comment_ghidra.cc"
"${library_root}/string_ghidra.cc"
"${library_root}/signature_ghidra.cc"
)
if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
list(APPEND sleigh_ghidra_source_list
"${library_root}/signature_ghidra.cc"
)
endif()
# if("${sleigh_RELEASE_TYPE}" STREQUAL "HEAD")
# list(APPEND sleigh_ghidra_source_list
# )
# endif()

set(sleigh_slacomp_source_list
"${library_root}/slgh_compile.cc"
Expand Down
8 changes: 8 additions & 0 deletions src/spec_files_stable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS12/data/languages/HCS12.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/HCS12/data/languages/HCS12X.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/JVM/data/languages/JVM.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch32_f32.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch32_f64.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch64_f32.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Loongarch/data/languages/loongarch64_f64.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/M8C/data/languages/m8c.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MC6800/data/languages/6805.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/MC6800/data/languages/6809.slaspec"
Expand Down Expand Up @@ -87,6 +91,8 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_e500mc_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_quicciii_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/PowerPC/data/languages/ppc_32_quicciii_le.slaspec"
Expand Down Expand Up @@ -122,6 +128,8 @@ set(spec_file_list
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_wsz_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Toy/data/languages/toy_wsz_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/V850/data/languages/V850.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Xtensa/data/languages/xtensa_be.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Xtensa/data/languages/xtensa_le.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Z80/data/languages/z180.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/Z80/data/languages/z80.slaspec"
"${ghidrasource_SOURCE_DIR}/Ghidra/Processors/eBPF/data/languages/eBPF_le.slaspec"
Expand Down
6 changes: 3 additions & 3 deletions support/include/sleigh/libsleigh.hh
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ namespace ghidra {
#include <ghidra/xml_arch.hh>
#include <ghidra/unionresolve.hh>
#include <ghidra/marshal.hh>

#ifdef sleigh_RELEASE_IS_HEAD
#include <ghidra/analyzesigs.hh>
#include <ghidra/modelrules.hh>
#include <ghidra/signature.hh>
#include <ghidra/signature_ghidra.hh>
#endif

// #ifdef sleigh_RELEASE_IS_HEAD
// #endif

#ifndef _MSC_VER
#pragma GCC diagnostic pop
Expand Down
10 changes: 5 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ add_executable(sleigh_ghidra_test
"${library_root}/../unittests/testfuncproto.cc"
"${library_root}/../unittests/testtypes.cc"
"${library_root}/../unittests/testmarshal.cc"
"${library_root}/../unittests/testparamstore.cc"
)

if(sleigh_RELEASE_IS_HEAD)
target_sources(sleigh_ghidra_test PRIVATE
"${library_root}/../unittests/testparamstore.cc"
)
endif()
# if(sleigh_RELEASE_IS_HEAD)
# target_sources(sleigh_ghidra_test PRIVATE
# )
# endif()

target_compile_features(sleigh_ghidra_test PRIVATE cxx_std_11)
target_include_directories(sleigh_ghidra_test PRIVATE "${library_root}")
Expand Down

0 comments on commit 81a04f2

Please sign in to comment.