mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
trace RCC execution
This commit is contained in:
parent
4c19560e34
commit
c668d6c4ec
5 changed files with 22 additions and 13 deletions
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
|
@ -33,7 +33,7 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -qq libpcre3-dev libssl-dev zlib1g-dev libzstd-dev libc6-dev libpng-dev libjpeg-dev libtiff-dev libcups2-dev libfreetype6-dev libfontconfig1-dev libdbus-1-dev libicu-dev unixodbc-dev libpq-dev libpqtypes-dev libmysqld-dev libaio-dev libwrap0-dev liblz4-dev libsqlite3-dev libunwind-dev xorg-dev
|
||||
sudo apt-get install -qq ltrace libpcre3-dev libssl-dev zlib1g-dev libzstd-dev libc6-dev libpng-dev libjpeg-dev libtiff-dev libcups2-dev libfreetype6-dev libfontconfig1-dev libdbus-1-dev libicu-dev unixodbc-dev libpq-dev libpqtypes-dev libmysqld-dev libaio-dev libwrap0-dev liblz4-dev libsqlite3-dev libunwind-dev xorg-dev
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
|
|
|
@ -67,7 +67,7 @@ elseif(CMAKE_HOST_SYSTEM_PROCESSOR)
|
|||
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" KATIE_PROCESSOR)
|
||||
endif()
|
||||
|
||||
# used as shebang for profile, exec and dbg scripts
|
||||
# used as shebang for profile, exec, dbg and trace scripts
|
||||
find_program(KATIE_SHELL NAMES sh dash mksh ksh ash)
|
||||
if(NOT KATIE_SHELL)
|
||||
message(FATAL_ERROR "Could not detect shell, supported are: sh, dash, mksh, ksh and ash")
|
||||
|
@ -428,7 +428,7 @@ if(KATIE_TESTS OR KATIE_BENCHMARKS)
|
|||
add_definitions(-DQT_BUILD_INTERNAL)
|
||||
endif()
|
||||
|
||||
foreach(script exec dbg)
|
||||
foreach(script exec dbg trace)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/${script}.sh.cmake
|
||||
${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${script}.sh
|
||||
|
|
|
@ -235,7 +235,7 @@ function(KATIE_SETUP_TARGET FORTARGET)
|
|||
set(targetresources ${targetresources} "${rscout}")
|
||||
make_directory("${rscpath}")
|
||||
add_custom_command(
|
||||
COMMAND "${CMAKE_BINARY_DIR}/exec.sh" "${CMAKE_BINARY_DIR}/bin/${KATIE_RCC}${KATIE_TOOLS_SUFFIX}" "${resource}" -o "${rscout}" -name "${rscname}"
|
||||
COMMAND "${CMAKE_BINARY_DIR}/trace.sh" "${CMAKE_BINARY_DIR}/bin/${KATIE_RCC}${KATIE_TOOLS_SUFFIX}" "${resource}" -o "${rscout}" -name "${rscname}"
|
||||
DEPENDS "${KATIE_RCC}"
|
||||
OUTPUT "${rscout}"
|
||||
)
|
||||
|
|
18
cmake/trace.sh.cmake
Normal file
18
cmake/trace.sh.cmake
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!@KATIE_SHELL@
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$LD_LIBRARY_PATH" ];then
|
||||
export LD_LIBRARY_PATH="@CMAKE_BINARY_DIR@/lib"
|
||||
else
|
||||
export LD_LIBRARY_PATH="@CMAKE_BINARY_DIR@/lib:$LD_LIBRARY_PATH"
|
||||
fi
|
||||
export QTDIR="@CMAKE_SOURCE_DIR@"
|
||||
export QT_PLUGIN_PATH="@CMAKE_BINARY_DIR@/plugins"
|
||||
export QML_IMPORT_PATH="@CMAKE_BINARY_DIR@/imports"
|
||||
|
||||
bin="$1"
|
||||
shift
|
||||
|
||||
cd "$(dirname "$bin")"
|
||||
exec ltrace @KATIE_CROSS_EXEC@ "./$(basename "$bin")" $@
|
|
@ -133,16 +133,13 @@ int runRcc(int argc, char *argv[])
|
|||
bool projectRequested = false;
|
||||
QStringList filenamesIn;
|
||||
|
||||
printf("args");
|
||||
QStringList args;
|
||||
for (int i = 0; i != argc; ++i)
|
||||
args += QString::fromLocal8Bit(argv[i]);
|
||||
|
||||
printf("lib");
|
||||
RCCResourceLibrary library;
|
||||
|
||||
// parse options
|
||||
printf("parse options");
|
||||
QString errorMsg;
|
||||
for (int i = 1; i < args.count() && errorMsg.isEmpty(); i++) {
|
||||
if (args[i].isEmpty())
|
||||
|
@ -220,23 +217,18 @@ int runRcc(int argc, char *argv[])
|
|||
showHelp(errorMsg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("errorDevice");
|
||||
QFile errorDevice;
|
||||
errorDevice.open(stderr, QIODevice::WriteOnly|QIODevice::Text);
|
||||
|
||||
if (library.verbose())
|
||||
errorDevice.write("Katie resource compiler\n");
|
||||
|
||||
printf("setInputFiles");
|
||||
library.setInputFiles(filenamesIn);
|
||||
|
||||
printf("readFiles");
|
||||
if (!library.readFiles(list, errorDevice))
|
||||
return 1;
|
||||
|
||||
// open output
|
||||
printf("open output");
|
||||
QFile out;
|
||||
QIODevice::OpenMode mode = QIODevice::WriteOnly;
|
||||
if (library.format() == RCCResourceLibrary::C_Code)
|
||||
|
@ -263,7 +255,6 @@ int runRcc(int argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
printf("library output");
|
||||
return library.output(out, errorDevice) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue