Adds ability to control block and stack debug output via CMake

Also updates README to detail how to enable various debug options.

A typo related to running tests has also been fixed.
This commit is contained in:
John Richards
2020-10-19 20:55:20 -04:00
parent 9407b29451
commit 05c373b07a
2 changed files with 21 additions and 1 deletions

View File

@@ -4,6 +4,18 @@ cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Debug options.
option(USE_BLOCK_DEBUG "Enable block debugging" OFF)
option(USE_STACK_DEBUG "Enable stack debugging" OFF)
# Turn debug defs on if they're enabled.
if (USE_BLOCK_DEBUG)
add_definitions(-DBLOCK_DEBUG)
endif()
if (USE_STACK_DEBUG)
add_definitions(-DSTACK_DEBUG)
endif()
# For generating the bytes tables
find_package(PythonInterp REQUIRED)

View File

@@ -15,10 +15,18 @@ https://github.com/zrax/pycdc
## Building Decompyle++
* Generate a project or makefile with [CMake](http://www.cmake.org) (See CMake's documentation for details)
* The following options can be passed to CMake to control debug features:
| Option | Description |
| --- | --- |
| `-DCMAKE_BUILD_TYPE=Debug` | Produce debugging symbols |
| `-DUSE_BLOCK_DEBUG=ON` | Enable block debugging output |
| `-DUSE_STACK_DEBUG=ON` | Enable stack debugging output |
* Build the generated project or makefile
* For projects (e.g. MSVC), open the generated project file and build it
* For makefiles, just run `make`
* To run tests (on \*nix or MSYS), run `make test`
* To run tests (on \*nix or MSYS), run `make check`
## Usage
**To run pycdas**, the PYC Disassembler: