mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
Revert "change(windows): include map2pdb generation for relevant Delphi projects"
This commit is contained in:
parent
10ce06790a
commit
6c99f33bcc
42 changed files with 6888 additions and 146 deletions
|
|
@ -8,7 +8,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|||
builder_describe \
|
||||
"Keyman common third party Delphi components" \
|
||||
clean configure build test reset \
|
||||
:cef4delphi :dcpcrypt :jwa :sentry
|
||||
:cef4delphi :dcpcrypt :jwa :sentry :tds2dbg
|
||||
|
||||
builder_parse "$@"
|
||||
builder_run_child_actions clean configure build test
|
||||
|
|
|
|||
|
|
@ -24,8 +24,10 @@ function do_test() {
|
|||
delphi_msbuild SentryClientTest.dproj "//p:Platform=Win32"
|
||||
delphi_msbuild SentryClientVclTest.dproj "//p:Platform=Win32"
|
||||
|
||||
do_map2pdb "$WIN32_TARGET_PATH/SentryClientTest.map" "$WIN32_TARGET"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/SentryClientVclTest.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET_PATH/SentryClientTest.exe" -dpr SentryClientTest.dpr
|
||||
sentrytool_delphiprep "$WIN32_TARGET_PATH/SentryClientVclTest.exe" -dpr SentryClientVclTest.dpr
|
||||
tds2dbg "$WIN32_TARGET_PATH/SentryClientTest.exe"
|
||||
tds2dbg "$WIN32_TARGET_PATH/SentryClientVclTest.exe"
|
||||
|
||||
sentry-cli upload-dif -p keyman-windows --wait --include-sources .
|
||||
|
||||
|
|
|
|||
49
common/windows/delphi/ext/tds2dbg.txt
Normal file
49
common/windows/delphi/ext/tds2dbg.txt
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
Keyman Third Party Package Readme: Tds2Dbg
|
||||
===========================================
|
||||
|
||||
Name: Tds2Dbg
|
||||
Purpose: Tds2Dbg converts .tds to .dbg files
|
||||
Source: https://sourceforge.net/projects/tds2dbg/
|
||||
Version: 2014-12-22
|
||||
License: ISC (MIT compatible)
|
||||
Updated for: N/A
|
||||
Documentation: https://sourceforge.net/projects/tds2dbg/
|
||||
Download location: https://sourceforge.net/projects/tds2dbg/
|
||||
Licensed For: Unlimited developers
|
||||
Include Paths: N/A
|
||||
|
||||
|
||||
Installation notes
|
||||
------------------
|
||||
|
||||
Download from site above.
|
||||
|
||||
Build notes
|
||||
-----------
|
||||
|
||||
tds2dbg is used for building .dbg files from .tds files so that Delphi
|
||||
projects can be debugged in WinDbg/Visual Studio and with dump files.
|
||||
|
||||
This project builds with Borland C++ 5.5 and not other compilers;
|
||||
while it may build successfully with other compilers, there appear to
|
||||
be alignment issues. Hence, the executable is included in the repository
|
||||
to avoid requiring another build tool.
|
||||
|
||||
License - ISC
|
||||
-------------
|
||||
|
||||
Copyright (c) 2009-2010, Bjarne Juul Pasgaard
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice, this permission notice and the following disclaimer
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
1
common/windows/delphi/ext/tds2dbg/.gitignore
vendored
Normal file
1
common/windows/delphi/ext/tds2dbg/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/bin/
|
||||
8
common/windows/delphi/ext/tds2dbg/Build.txt
Normal file
8
common/windows/delphi/ext/tds2dbg/Build.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Get the free Borland C++ Builder 5.5 from
|
||||
https://downloads.embarcadero.com/free/c_builder
|
||||
|
||||
Ensure that the location of bcc32.exe is in your path
|
||||
and type "make.exe" in a command prompt with the
|
||||
current working directory set to the directory
|
||||
holder the sources for tds2dbg.
|
||||
|
||||
12
common/windows/delphi/ext/tds2dbg/ChangeLog
Normal file
12
common/windows/delphi/ext/tds2dbg/ChangeLog
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
tds2dbg 0.2.0
|
||||
|
||||
* Added support for conversion of public and static symbols.
|
||||
* Corrected padding and alignment.
|
||||
* Preliminary support for conversion of types. Still incomplete.
|
||||
* Can now convert a non-PE CodeView NB09 file to a PE CodeView file.
|
||||
* Can now generate bare CodeView files (i.e. no PE header).
|
||||
|
||||
tds2dbg 0.1.0
|
||||
|
||||
* Initial version
|
||||
|
||||
15
common/windows/delphi/ext/tds2dbg/LICENSE
Normal file
15
common/windows/delphi/ext/tds2dbg/LICENSE
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Copyright (c) 2009-2010, Bjarne Juul Pasgaard
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice, this permission notice and the following disclaimer
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
22
common/windows/delphi/ext/tds2dbg/Makefile
Normal file
22
common/windows/delphi/ext/tds2dbg/Makefile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
info:
|
||||
echo The following builds require Borland C++ compiler to be installed and in the path; see Readme.txt for details.
|
||||
echo So, the tds2dbg.bin is kept in the repo in order to make builds simpler
|
||||
|
||||
BCC55DIR=c:\borland\bcc55
|
||||
|
||||
tds2dbg.exe: main.cpp tds2dbg.cpp fileutils.cpp log.cpp
|
||||
# $(CL) /Fe$< /EHsc $**
|
||||
path $(BCC55DIR)\bin;$(PATH)
|
||||
$(BCC55DIR)\bin\bcc32 -y -v -L$(BCC55DIR)\Lib -I$(BCC55DIR)\Include -e$< $**
|
||||
|
||||
test.exe: testa.cpp
|
||||
# $(CL) /Fe$< /EHsc $**
|
||||
$(BCC55DIR)\bin\bcc32 -y -v -M -L$(BCC55DIR)\Lib -I$(BCC55DIR)\Include -e$< $**
|
||||
|
||||
clean:
|
||||
-del /Q tds2dbg.obj fileutils.obj log.obj main.obj tds2dbg.tds
|
||||
-del /Q testa.obj test.exe test.tds test.dbg
|
||||
-rmdir /S /Q html
|
||||
|
||||
doc:
|
||||
doxygen tds2dbg.dcf
|
||||
64
common/windows/delphi/ext/tds2dbg/ReadMe.txt
Normal file
64
common/windows/delphi/ext/tds2dbg/ReadMe.txt
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
NAME
|
||||
|
||||
tds2dbg - Borland TDS debug symbol file to Microsft DBG debug symbol file
|
||||
converter.
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
tds2dbg [ [-h|--help] | [-t|--types] [-s|--statics] [--] program.exe ]
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
tds2dbg will read the Borland debug symbol file associated with the
|
||||
Microsoft Windows executable program.exe (program.tds) and create a
|
||||
corresponding Microsoft DBG debug symbol file (program.dbg). Additionally,
|
||||
it will modify a flag in program.exe to signal that debug symbols are
|
||||
available externally to the executable.
|
||||
|
||||
The dbg files can be used with, say, windbg available from the
|
||||
Microsoft Debugging Tools at the Microsoft Windows Hardware Developer
|
||||
Central (http://www.microsoft.com/whdc).
|
||||
|
||||
OPTIONS
|
||||
|
||||
-h, --help Prints a help text. Running tds2dbg without arguments
|
||||
will do the same.
|
||||
-v, --verbose Each occurence of this option increases verbosity.
|
||||
-q, --quiet Operate silently.
|
||||
-t, --types Convert types (incomplete feature).
|
||||
-s, --statics Treat statics as publics.
|
||||
-b, --barecv Write bare code view data. No PE header is added.
|
||||
|
||||
KNOWN ISSUES
|
||||
|
||||
tds2dbg is currently only able to insert source code references, public
|
||||
symbols, and static symbols into the generated DBG file. Debug information
|
||||
on local variables is partially generated, but no debugger seems to be
|
||||
able to use this information. Additionally, conversion of types is not
|
||||
fully supported and is only done on request (the -t option).
|
||||
|
||||
VERSION
|
||||
|
||||
This is the documentation for tds2dbg version 0.2.0
|
||||
|
||||
AUTHOR
|
||||
|
||||
Copyright (C) 2009-2010, Bjarne Juul Pasgaard
|
||||
|
||||
LICENSE
|
||||
|
||||
Copyright (C) 2009-2010, Bjarne Juul Pasgaard
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice, this permission notice and the following disclaimer
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
34
common/windows/delphi/ext/tds2dbg/build.sh
Executable file
34
common/windows/delphi/ext/tds2dbg/build.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
## START STANDARD BUILD SCRIPT INCLUDE
|
||||
# adjust relative paths as necessary
|
||||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
||||
. "${THIS_SCRIPT%/*}/../../../../../resources/build/builder-full.inc.sh"
|
||||
## END STANDARD BUILD SCRIPT INCLUDE
|
||||
|
||||
# TODO: move this out of ext and into tools
|
||||
|
||||
builder_describe "tds2dbg component" clean configure build test
|
||||
builder_parse "$@"
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
source "$KEYMAN_ROOT/resources/build/win/environment.inc.sh"
|
||||
|
||||
builder_describe_outputs \
|
||||
configure:project /resources/build/win/delphi_environment_generated.inc.sh \
|
||||
build:project "$WIN32_TARGET_PATH/tds2dbg.exe"
|
||||
|
||||
#-------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function do_build() {
|
||||
mkdir -p "$WIN32_TARGET_PATH"
|
||||
cp tds2dbg.bin "$WIN32_TARGET_PATH/tds2dbg.exe"
|
||||
|
||||
mkdir -p "$KEYMAN_ROOT/common/windows/bin/tools"
|
||||
cp "$WIN32_TARGET_PATH/tds2dbg.exe" "$KEYMAN_ROOT/common/windows/bin/tools/"
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
builder_run_action configure:project configure_windows_build_environment
|
||||
builder_run_action build:project do_build
|
||||
# builder_run_action test:project do_test
|
||||
158
common/windows/delphi/ext/tds2dbg/fileutils.cpp
Normal file
158
common/windows/delphi/ext/tds2dbg/fileutils.cpp
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
// Copyright (c) 2009-2010, Bjarne Juul Pasgaard
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice, this permission notice and the following disclaimer
|
||||
// appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
/// @file fileutils.cpp File utilities
|
||||
|
||||
#include "fileutils.h"
|
||||
|
||||
FileWrapper::FileWrapper(FILE* f) : m_f(f)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int
|
||||
FileWrapper::tell() const {
|
||||
return ftell(m_f);
|
||||
}
|
||||
|
||||
void
|
||||
FileWrapper::seek(unsigned int pos) throw(std::runtime_error) {
|
||||
if(fseek(m_f,pos,SEEK_SET)) {
|
||||
throw std::runtime_error("Failed to set read/write position");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FileWrapper::skip(unsigned int amount) throw(std::runtime_error) {
|
||||
if(fseek(m_f,amount,SEEK_CUR)) {
|
||||
throw std::runtime_error("Failed to advance read/write position");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FileWrapper::write1bLpfName(const std::string& name) throw(std::runtime_error)
|
||||
{
|
||||
unsigned char len = (unsigned char) (name.length());
|
||||
|
||||
if((sizeof len) != fwrite(&len,1,(sizeof len),m_f)) {
|
||||
throw std::runtime_error("Failed to write length field of string");
|
||||
}
|
||||
if((unsigned int)(len+1) != fwrite(name.c_str(),1,len+1,m_f)) {
|
||||
throw std::runtime_error("Failed to write string contents");
|
||||
}
|
||||
}
|
||||
|
||||
RecordReader::RecordReader(FileWrapper& tdsFile, unsigned int recSz) :
|
||||
m_tdsFile(tdsFile)
|
||||
{
|
||||
m_recPos = tdsFile.tell();
|
||||
m_endPos = m_recPos + recSz;
|
||||
}
|
||||
|
||||
RecordWriter::~RecordWriter()
|
||||
{
|
||||
WriteQCont::iterator it = m_writeQ.begin();
|
||||
while(m_writeQ.end() != it) {
|
||||
delete *it++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RecordWriter::commit(FileWrapper& f) const throw(std::runtime_error)
|
||||
{
|
||||
WriteQCont::const_iterator it = m_writeQ.begin();
|
||||
while(m_writeQ.end() != it) {
|
||||
(*it++)->commit(f);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
RecordWriter::length() const
|
||||
{
|
||||
unsigned int len = 0;
|
||||
WriteQCont::const_iterator it = m_writeQ.begin();
|
||||
while(m_writeQ.end() != it) {
|
||||
len += (*it++)->length();
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
void
|
||||
RecordWriter::write1bLpfName(const std::string& name)
|
||||
{
|
||||
unsigned char len = (unsigned char) (name.length());
|
||||
|
||||
this->write(len);
|
||||
this->write(*(name.c_str()),len+1);
|
||||
}
|
||||
|
||||
RecordWriter::WriteQueueElement::~WriteQueueElement()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int
|
||||
RecordWriter::CopiedData::length() const
|
||||
{
|
||||
return m_data.size();
|
||||
}
|
||||
|
||||
void
|
||||
RecordWriter::CopiedData::commit(FileWrapper& f) const throw(std::runtime_error)
|
||||
{
|
||||
f.write(m_data.front(),m_data.size());
|
||||
}
|
||||
|
||||
RecordWriter::WriteQueueElement*
|
||||
RecordWriter::CopiedData::append(const unsigned char* src, unsigned int len)
|
||||
{
|
||||
m_data.reserve(m_data.size()+len);
|
||||
while(len--) {
|
||||
m_data.push_back(*src++);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
RecordWriter::ReferencedData::
|
||||
ReferencedData(const unsigned char* src, unsigned int len)
|
||||
: m_src(src), m_len(len)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int
|
||||
RecordWriter::ReferencedData::length() const
|
||||
{
|
||||
return m_len;
|
||||
}
|
||||
|
||||
void
|
||||
RecordWriter::ReferencedData::commit(FileWrapper& f) const
|
||||
throw(std::runtime_error)
|
||||
{
|
||||
f.write(*m_src,m_len);
|
||||
}
|
||||
|
||||
RecordWriter::WriteQueueElement*
|
||||
RecordWriter::ReferencedData::append(const unsigned char* src, unsigned int len)
|
||||
{
|
||||
CopiedData* c = new CopiedData();
|
||||
c->append(src,len);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
564
common/windows/delphi/ext/tds2dbg/fileutils.h
Normal file
564
common/windows/delphi/ext/tds2dbg/fileutils.h
Normal file
|
|
@ -0,0 +1,564 @@
|
|||
// Copyright (c) 2009-2010, Bjarne Juul Pasgaard
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice, this permission notice and the following disclaimer
|
||||
// appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
/// @file fileutils.h File utilities
|
||||
|
||||
#ifndef FILEUTILS_H
|
||||
#define FILEUTILS_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <vector>
|
||||
|
||||
/// @brief Base class for file access wrappers.
|
||||
class FileWrapper {
|
||||
public:
|
||||
|
||||
/// @brief Constructor.
|
||||
///
|
||||
/// @param f The file stream being wrapped. Ownership not transferred.
|
||||
FileWrapper(FILE* f);
|
||||
|
||||
/// @brief Returns the current read/write position.
|
||||
/// @return The current write position.
|
||||
unsigned int tell() const;
|
||||
|
||||
/// @brief Sets the current read/write position.
|
||||
///
|
||||
/// @param pos The new (absolute) write position.
|
||||
///
|
||||
/// @throw runtime_error If an error occured.
|
||||
void seek(unsigned int pos) throw(std::runtime_error);
|
||||
|
||||
/// @brief Skips a number of bytes from the input stream.
|
||||
///
|
||||
/// @param amount The number of bytes to skip.
|
||||
///
|
||||
/// @throw runtime_error If an error occured.
|
||||
void skip(unsigned int amount) throw(std::runtime_error);
|
||||
|
||||
/// @brief Reads a sequence of structures from the current read
|
||||
/// position and throws an exception if end of file is
|
||||
/// reached prematurely.
|
||||
///
|
||||
/// @param dst The 1st structure to hold the data read in.
|
||||
/// @param num The number of structures to read.
|
||||
///
|
||||
/// @tparam The class of the structures to read.
|
||||
///
|
||||
/// @throw runtime_error If not all bytes could be read.
|
||||
template <class T>
|
||||
void read(T& dst, unsigned int num = 1) throw(std::runtime_error) {
|
||||
unsigned int n = fread(&dst,1,num*sizeof(T),m_f);
|
||||
if(num*sizeof(T) != n) {
|
||||
throw std::runtime_error("Unexpected end of file");
|
||||
}
|
||||
}
|
||||
|
||||
/// @brief Attempts to reads a sequence of structures from the
|
||||
/// current read position.
|
||||
///
|
||||
/// @param dst The 1st structure to hold the data read in.
|
||||
/// @param num The number of structures to read.
|
||||
///
|
||||
/// @return The number of bytes actually read.
|
||||
///
|
||||
/// @tparam The class of the structures to read.
|
||||
template <class T>
|
||||
unsigned int tryRead(T& dst, unsigned int num = 1) {
|
||||
return fread(&dst,1,num*sizeof(T),m_f);
|
||||
}
|
||||
|
||||
/// @brief Writes a sequence of bytes to the current write position.
|
||||
///
|
||||
/// @param src Reference to the 1st structure to be written.
|
||||
/// @param num The number of instances to write.
|
||||
///
|
||||
/// @return The number of bytes actually written.
|
||||
///
|
||||
/// @tparam T Class of the structure to write.
|
||||
///
|
||||
/// @throw runtime_error If an error occured.
|
||||
template <class T>
|
||||
unsigned int
|
||||
write(const T& src, unsigned int num = 1) throw(std::runtime_error) {
|
||||
unsigned int n = fwrite(&src,1,num*sizeof(T),m_f);
|
||||
if(n != num*sizeof(T)) {
|
||||
throw std::runtime_error("Write error in write()");
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/// @brief Writes multiple copies of the same structure starting from the
|
||||
/// current write position.
|
||||
///
|
||||
/// @param src Reference to the structure to be written.
|
||||
/// @param num The number of copies to write.
|
||||
///
|
||||
/// @return The number of bytes actually written.
|
||||
///
|
||||
/// @tparam T Class of the structure to write.
|
||||
///
|
||||
/// @throw runtime_error If an error occured.
|
||||
template <class T>
|
||||
unsigned int
|
||||
writeRep(const T& src, unsigned int num = 1) throw(std::runtime_error);
|
||||
|
||||
/// @brief Writes a (1-byte) length-prefixed name to the current
|
||||
/// write position.
|
||||
///
|
||||
/// @param name The name to write.
|
||||
///
|
||||
/// @throw runtime_error If an error occured.
|
||||
void write1bLpfName(const std::string& name) throw(std::runtime_error);
|
||||
|
||||
protected:
|
||||
|
||||
FILE* m_f; ///< The file stream.
|
||||
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
unsigned int
|
||||
FileWrapper::writeRep(const T& src, unsigned int num)
|
||||
throw(std::runtime_error)
|
||||
{
|
||||
unsigned int n = 0;
|
||||
while(num--) {
|
||||
unsigned int m = fwrite(&src,1,sizeof(T),m_f);
|
||||
if(sizeof(T) != m) {
|
||||
throw std::runtime_error("Write error in writeRep()");
|
||||
}
|
||||
n += m;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/// @brief Reads a record sequentially from a file while keeping track
|
||||
/// of the number of bytes available.
|
||||
class RecordReader {
|
||||
public:
|
||||
|
||||
/// @brief Constructor.
|
||||
///
|
||||
/// @param tdsFile The file to read from.
|
||||
/// @param recSz The number of bytes in the record.
|
||||
RecordReader(FileWrapper& tdsFile, unsigned int recSz);
|
||||
|
||||
/// @brief Returns the current read position.
|
||||
///
|
||||
/// @return The current (absolute) read position.
|
||||
unsigned int tell() {
|
||||
return m_tdsFile.tell();
|
||||
}
|
||||
|
||||
/// @brief Determines whether an end-of-record condition is met.
|
||||
///
|
||||
/// @retval true if all bytes have been read.
|
||||
/// @retval false otherwise.
|
||||
bool eor() const {
|
||||
return (m_tdsFile.tell() >= m_endPos);
|
||||
}
|
||||
|
||||
/// @brief Sets the current absolute read position.
|
||||
///
|
||||
/// @param pos The new (absolute) read position.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
void seek(unsigned int pos) throw(std::runtime_error) {
|
||||
m_tdsFile.seek(pos);
|
||||
}
|
||||
|
||||
/// @brief Skips a number of bytes from the input stream.
|
||||
///
|
||||
/// @param amount The number of bytes to skip.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
void skip(unsigned int amount) throw(std::runtime_error) {
|
||||
m_tdsFile.skip(amount);
|
||||
}
|
||||
|
||||
/// @brief Reads a sequence of structures from the current read
|
||||
/// position in the TDS file.
|
||||
///
|
||||
/// @param dst The 1st structure to hold the data read in.
|
||||
/// @param num The number of structures to read.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
template <class T>
|
||||
void read(T& dst, unsigned int num = 1) throw(std::runtime_error) {
|
||||
m_tdsFile.read(dst,num);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
FileWrapper& m_tdsFile; ///< The file to read from.
|
||||
|
||||
unsigned int m_recPos; ///< The position of the current record.
|
||||
|
||||
unsigned int m_endPos; ///< The position after the end of the record list.
|
||||
|
||||
};
|
||||
|
||||
/// @brief Registers data for later writing to a file while counting
|
||||
/// the number of bytes to be written.
|
||||
class RecordWriter {
|
||||
public:
|
||||
|
||||
/// @brief Destructor.
|
||||
~RecordWriter();
|
||||
|
||||
/// @brief Commits the data registered to a file at the current write
|
||||
/// position of the file.
|
||||
///
|
||||
/// @param file The file to write to.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
void commit(FileWrapper& f) const throw(std::runtime_error);
|
||||
|
||||
/// @brief Returns the number of bytes registered for later writing.
|
||||
///
|
||||
/// @return The number of bytes registered.
|
||||
unsigned int length() const;
|
||||
|
||||
/// @brief Appends a sequence of structures to the tail of the
|
||||
/// write queue.
|
||||
///
|
||||
/// The data provided is copied into the internal write queue.
|
||||
///
|
||||
/// @param dst The 1st structure that holds the data to be written.
|
||||
/// @param num The number of structures to write.
|
||||
///
|
||||
/// @return The number of bytes written.
|
||||
template <class T>
|
||||
unsigned int write(const T& src, unsigned int num = 1) {
|
||||
unsigned int n = sizeof(T)*num;
|
||||
WriteQueueElement* e;
|
||||
|
||||
if(0 == m_writeQ.size()) {
|
||||
e = new CopiedData();
|
||||
m_writeQ.push_back(e);
|
||||
}
|
||||
|
||||
e = m_writeQ.back()->append(reinterpret_cast<const unsigned char*>(&src),n);
|
||||
if(e) {
|
||||
// New element created, append it to the queue.
|
||||
m_writeQ.push_back(e);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/// @brief Writes multiple copies of the same structure starting from the
|
||||
/// current write position.
|
||||
///
|
||||
/// @param src Reference to the structure to be written.
|
||||
/// @param num The number of copies to write.
|
||||
///
|
||||
/// @return The number of bytes actually written.
|
||||
///
|
||||
/// @tparam T Class of the structure to write.
|
||||
template <class T>
|
||||
unsigned int writeRep(const T& src, unsigned int num = 1) {
|
||||
unsigned int n = 0;
|
||||
while(num--) {
|
||||
n+= this->write(src);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/// @brief Appends a sequence of structures to the tail of the
|
||||
/// write queue.
|
||||
///
|
||||
/// This menthod appends a reference to the data to the write
|
||||
/// queue. The data provided is not copied.
|
||||
///
|
||||
/// @param dst The 1st structure that holds the data to be written.
|
||||
/// @param num The number of structures to write.
|
||||
///
|
||||
/// @return The number of bytes written.
|
||||
template <class T>
|
||||
unsigned int delayedWrite(const T& src, unsigned int num = 1) {
|
||||
unsigned int n = sizeof(T)*num;
|
||||
m_writeQ.
|
||||
push_back(new
|
||||
ReferencedData(reinterpret_cast<unsigned char*>(&src),n));
|
||||
return n;
|
||||
}
|
||||
|
||||
/// @brief Appends a (1-byte) length-prefixed name to the write queue.
|
||||
///
|
||||
/// @param name The name to write.
|
||||
void write1bLpfName(const std::string& name);
|
||||
|
||||
protected:
|
||||
|
||||
/// @brief Base class for write queue data.
|
||||
class WriteQueueElement
|
||||
{
|
||||
public:
|
||||
|
||||
/// @brief Destructor.
|
||||
virtual ~WriteQueueElement();
|
||||
|
||||
/// @brief Returns the number of bytes registered within this element.
|
||||
///
|
||||
/// @return The number of bytes registered within this element.
|
||||
virtual unsigned int length() const = 0;
|
||||
|
||||
/// @brief Commits the data in this element to the current write
|
||||
/// position of a file.
|
||||
///
|
||||
/// @param f The file to write to.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
virtual void commit(FileWrapper& f) const throw(std::runtime_error) = 0;
|
||||
|
||||
/// @brief Appends a copy of a sequence of bytes to the current
|
||||
/// element.
|
||||
///
|
||||
/// @param src The first byte to copy.
|
||||
/// @param len The number of bytes to copy.
|
||||
///
|
||||
/// @return 0 if the bytes were appended to the current element, or
|
||||
/// a pointer to a new element that received the copied bytes.
|
||||
virtual
|
||||
WriteQueueElement* append(const unsigned char* src, unsigned int len) = 0;
|
||||
|
||||
};
|
||||
|
||||
/// @brief Data copied into the write queue.
|
||||
class CopiedData : public WriteQueueElement
|
||||
{
|
||||
public:
|
||||
|
||||
// Overridden base class method.
|
||||
unsigned int length() const;
|
||||
|
||||
// Overridden base class method.
|
||||
void commit(FileWrapper& f) const throw(std::runtime_error);
|
||||
|
||||
// Overridden base class method.
|
||||
WriteQueueElement* append(const unsigned char* src, unsigned int len);
|
||||
|
||||
protected:
|
||||
|
||||
std::vector<unsigned char> m_data;
|
||||
|
||||
};
|
||||
|
||||
/// @brief Data referenced from the write queue.
|
||||
class ReferencedData : public WriteQueueElement
|
||||
{
|
||||
public:
|
||||
|
||||
// Overridden base class method.
|
||||
unsigned int length() const;
|
||||
|
||||
// Overridden base class method.
|
||||
void commit(FileWrapper& f) const throw(std::runtime_error);
|
||||
|
||||
// Overridden base class method.
|
||||
WriteQueueElement* append(const unsigned char* src, unsigned int len);
|
||||
|
||||
/// @brief Constructor.
|
||||
///
|
||||
/// @param src The first byte to reference.
|
||||
/// @param len The number of subsequent bytes to reference.
|
||||
ReferencedData(const unsigned char* src, unsigned int len);
|
||||
|
||||
protected:
|
||||
|
||||
const unsigned char* m_src; ///< The first byte referenced.
|
||||
unsigned int m_len; ///< The number of bytes referenced.
|
||||
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
/// @brief Container underlying the internal write queue.
|
||||
typedef std::vector<WriteQueueElement*> WriteQCont;
|
||||
|
||||
/// @brief The internal write queue.
|
||||
WriteQCont m_writeQ;
|
||||
|
||||
};
|
||||
|
||||
/// @brief Postpones writing of a record until committed.
|
||||
///
|
||||
/// @note It is important to create an instance of this class before writing
|
||||
/// any records that should follow it (in file order).
|
||||
///
|
||||
/// @tparam R The record structure.
|
||||
template <class R>
|
||||
class PpRecordWriter {
|
||||
public:
|
||||
|
||||
/// @brief Constructor.
|
||||
///
|
||||
/// @param dbgFile The DBG file to write to.
|
||||
/// @param rec The record to be written when committed to.
|
||||
PpRecordWriter(FileWrapper& dbgFile, R& rec) :
|
||||
m_dbgFile(dbgFile), m_rec(rec), m_len(0)
|
||||
{
|
||||
m_recPos = dbgFile.tell();
|
||||
dbgFile.skip(sizeof(R));
|
||||
}
|
||||
|
||||
/// @brief Commits to the record.
|
||||
///
|
||||
/// This method will write out the record.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
void commit() throw(std::runtime_error) {
|
||||
unsigned int oldPos = m_dbgFile.tell();
|
||||
m_dbgFile.seek(m_recPos);
|
||||
m_len = m_dbgFile.write(m_rec);
|
||||
m_dbgFile.seek(oldPos);
|
||||
}
|
||||
|
||||
/// @brief Returns the number of bytes written.
|
||||
/// @return The number of bytes written.
|
||||
unsigned int length() const {
|
||||
return m_len;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
/// @brief The DBG file to write to.
|
||||
FileWrapper& m_dbgFile;
|
||||
|
||||
/// @breif The record to write.
|
||||
R& m_rec;
|
||||
|
||||
/// @brief File position of the record.
|
||||
unsigned int m_recPos;
|
||||
|
||||
/// @brief Number of bytes written.
|
||||
unsigned int m_len;
|
||||
|
||||
};
|
||||
|
||||
/// @brief Postpones writing of a header with a length field to be
|
||||
/// computed until committed.
|
||||
///
|
||||
/// @tparam H The header structure.
|
||||
/// @tparam L The type of the length field.
|
||||
template <class H, class L>
|
||||
class HeaderWithLen {
|
||||
public:
|
||||
|
||||
/// @brief Constructor.
|
||||
///
|
||||
/// @param hdr The header to be written when committed to.
|
||||
/// Must remain available during the entire lifetime of the
|
||||
/// object created.
|
||||
/// @param lenFld The length field to update. Must remaining available
|
||||
/// during the entire lifetime of the object created.
|
||||
HeaderWithLen(H& hdr, L& lenFld) : m_hdr(hdr), m_lenFld(lenFld)
|
||||
{
|
||||
}
|
||||
|
||||
/// @brief Writes the header and the data registered by a RecordWriter.
|
||||
///
|
||||
/// This method will write out the header with an updated length field
|
||||
/// as well as the data registered by the RecordWriter.
|
||||
/// The length field will be computed as the size of the header, plus the
|
||||
/// size of the data written by the RecordWriter, minus the size of the
|
||||
/// length field itself.
|
||||
///
|
||||
/// @param f The file to write to.
|
||||
/// @param w The record writer that was used to write the data committed to.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
void
|
||||
commit(FileWrapper& f, const RecordWriter& w) throw(std::runtime_error){
|
||||
m_lenFld = sizeof(H) + w.length()-sizeof(L);
|
||||
f.write(m_hdr);
|
||||
w.commit(f);
|
||||
}
|
||||
|
||||
/// @brief Returns the number of bytes (to be) written by the record writer
|
||||
/// and the header writer itself.
|
||||
///
|
||||
/// @return The number of bytes (to be) written.
|
||||
unsigned int length(const RecordWriter& w) const {
|
||||
return sizeof(H) + w.length();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
/// @brief The header to write.
|
||||
H& m_hdr;
|
||||
|
||||
/// @brief The length field to update.
|
||||
L& m_lenFld;
|
||||
|
||||
};
|
||||
|
||||
/// @brief Writes a sequence of bytes from one file object to another.
|
||||
///
|
||||
/// @param dst Destination file object.
|
||||
/// @param src Source file object.
|
||||
/// @param amount Number of bytes to copy.
|
||||
///
|
||||
/// @tparam D Class of the destination object.
|
||||
/// @tparam S Class of the source object.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
template <class D, class S>
|
||||
void
|
||||
copyFileContent(D& dst, S& src, unsigned int amount = 1)
|
||||
throw(std::runtime_error)
|
||||
{
|
||||
unsigned char buf[512];
|
||||
unsigned int toRead = (sizeof buf);
|
||||
while(amount) {
|
||||
if(toRead>amount) {
|
||||
toRead = amount;
|
||||
}
|
||||
src.read(buf[0],toRead);
|
||||
amount -= toRead;
|
||||
dst.write(buf[0],toRead);
|
||||
}
|
||||
}
|
||||
|
||||
/// @brief Appends the contents of one file to another.
|
||||
///
|
||||
/// @param dst Destination file object.
|
||||
/// @param src Source file object.
|
||||
///
|
||||
/// @tparam D Class of the destination object.
|
||||
/// @tparam S Class of the source object.
|
||||
///
|
||||
/// @throw runtime_error In case of errors.
|
||||
template <class D, class S>
|
||||
void
|
||||
copyFile(D& dst, S& src) throw(std::runtime_error)
|
||||
{
|
||||
unsigned char buf[512];
|
||||
unsigned int bytesRead;
|
||||
do {
|
||||
bytesRead = src.tryRead(buf[0],(sizeof buf));
|
||||
dst.write(buf[0],bytesRead);
|
||||
} while((sizeof buf) == bytesRead);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
44
common/windows/delphi/ext/tds2dbg/log.cpp
Normal file
44
common/windows/delphi/ext/tds2dbg/log.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (c) 2009-2010, Bjarne Juul Pasgaard
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice, this permission notice and the following disclaimer
|
||||
// appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
/// @file log.cpp Log utilitites
|
||||
|
||||
#include "log.h"
|
||||
|
||||
std::ostream& Log::operator()(unsigned int verbosity)
|
||||
{
|
||||
if(verbosity<m_verbosity) {
|
||||
return std::cout;
|
||||
} else {
|
||||
return m_nullStream;
|
||||
}
|
||||
}
|
||||
|
||||
Log::NullStreamBuf::NullStreamBuf()
|
||||
{
|
||||
}
|
||||
|
||||
Log& mylog()
|
||||
{
|
||||
static Log _log;
|
||||
return _log;
|
||||
}
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
82
common/windows/delphi/ext/tds2dbg/log.h
Normal file
82
common/windows/delphi/ext/tds2dbg/log.h
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
// Copyright (c) 2009-2010, Bjarne Juul Pasgaard
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice, this permission notice and the following disclaimer
|
||||
// appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
/// @file log.h Log utilities
|
||||
|
||||
#ifndef LOG_H
|
||||
#define LOG_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
/// @brief Logger class.
|
||||
class Log
|
||||
{
|
||||
public:
|
||||
|
||||
/// @brief Constructor.
|
||||
Log() : m_verbosity(0), m_nullStream(&m_nullStreamBuf) {}
|
||||
|
||||
/// @brief Sets the level of verbosity
|
||||
///
|
||||
/// @param verbosity New level of verbosity. 0 means silence.
|
||||
void setVerbosity(unsigned int verbosity) { m_verbosity = verbosity; }
|
||||
|
||||
/// @brief Returns a reference to a stream handling the requested level
|
||||
/// of verbosity.
|
||||
///
|
||||
/// @param verbosity The requested level of verbosity.
|
||||
std::ostream& operator()(unsigned int verbosity = 0);
|
||||
|
||||
protected:
|
||||
|
||||
/// @brief Helper class implementing a dummy stream buffer that
|
||||
/// discards everything sent to it.
|
||||
///
|
||||
/// @ingroup HMILoggingFeatures
|
||||
class NullStreamBuf : public std::streambuf
|
||||
{
|
||||
public:
|
||||
|
||||
/// @brief Constructor
|
||||
NullStreamBuf();
|
||||
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
/// @brief The current level of verbosity.
|
||||
unsigned int m_verbosity;
|
||||
|
||||
/// @brief Supporting stream buffer for m_nullStream.
|
||||
NullStreamBuf m_nullStreamBuf;
|
||||
|
||||
/// @brief Internal stream used as a null-stream that discards
|
||||
/// everything streamed to it.
|
||||
std::ostream m_nullStream;
|
||||
|
||||
};
|
||||
|
||||
/// @brief Accesser for the global Log instance.
|
||||
///
|
||||
/// @return Reference to the global log.
|
||||
Log& mylog();
|
||||
|
||||
#endif LOG_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
115
common/windows/delphi/ext/tds2dbg/main.cpp
Normal file
115
common/windows/delphi/ext/tds2dbg/main.cpp
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
// Copyright (c) 2009-2010, Bjarne Juul Pasgaard
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice, this permission notice and the following disclaimer
|
||||
// appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
#include "tds2dbg.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <locale>
|
||||
|
||||
void printUsage(const char* argv0)
|
||||
{
|
||||
std::cerr
|
||||
<< "Usage: " << argv0
|
||||
<< " [-h|--help] [-t|--types] [-s|--statics] [--] exefilenamewithextension\n"
|
||||
"Options:\n"
|
||||
" -h, --help Prints this message\n"
|
||||
" -v, --verbose Increase verbosity\n"
|
||||
" -q, --quiet Operate silently\n"
|
||||
" -t, --types Convert types (incomplete feature)\n"
|
||||
" -s, --statics Treat statics as publics\n"
|
||||
" -b, --barecv Write bare code view data\n"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int argNo = 1;
|
||||
unsigned int verbosity = 1;
|
||||
bool convertTypes = false;
|
||||
bool staticsAsPublics = false;
|
||||
bool bareCodeView = false;
|
||||
|
||||
while(argc > 1) {
|
||||
char* a = argv[argNo];
|
||||
if('-' != *a || 0==strcmp("--",a)) {
|
||||
break;
|
||||
} else if(0==strcmp("-h",a) || 0==strcmp("--help",a)) {
|
||||
printUsage(argv[0]);
|
||||
return 0;
|
||||
} else if(0==strcmp("--verbose",a) || 0==strcmp("-v",a)) {
|
||||
if(verbosity) ++verbosity;
|
||||
} else if(0==strcmp("--quiet",a) || 0==strcmp("-q",a)) {
|
||||
verbosity = 0;
|
||||
} else if(0==strcmp("--types",a) || 0==strcmp("-t",a)) {
|
||||
convertTypes = true;
|
||||
} else if(0==strcmp("--statics",a) || 0==strcmp("-s",a)) {
|
||||
staticsAsPublics = true;
|
||||
} else if(0==strcmp("--barecv",a) || 0==strcmp("-b",a)) {
|
||||
bareCodeView = true;
|
||||
} else {
|
||||
std::cerr << "Unknown option " << a << std::endl;
|
||||
printUsage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
--argc;
|
||||
++argNo;
|
||||
}
|
||||
|
||||
if(2 != argc) {
|
||||
printUsage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string exeFile(argv[argNo]);
|
||||
std::string::size_type dotP = exeFile.rfind('.');
|
||||
if(std::string::npos == dotP) {
|
||||
std::cerr
|
||||
<< "Argument exe file name must be specified with extension"
|
||||
<< std::endl;
|
||||
return 2;
|
||||
}
|
||||
|
||||
std::string tdsFile(exeFile.substr(0,dotP+1));
|
||||
std::string dbgFile(tdsFile);
|
||||
|
||||
const std::ctype<char>& ctf =
|
||||
std::use_facet<std::ctype<char> >(std::locale());
|
||||
std::string::size_type ep = dotP;
|
||||
while(exeFile.length() != ep) {
|
||||
exeFile[ep] = ctf.tolower(exeFile[ep]);
|
||||
++ep;
|
||||
}
|
||||
|
||||
std::string ext(exeFile.substr(dotP+1));
|
||||
|
||||
if(!ext.compare("tds") || !ext.compare("dbg")) {
|
||||
std::cerr
|
||||
<< "Executable file cannot have extension .tds or .dbg"
|
||||
<< std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
tdsFile.append("tds");
|
||||
dbgFile.append("dbg");
|
||||
|
||||
return tds2dbg(exeFile.c_str(),tdsFile.c_str(),dbgFile.c_str(),
|
||||
verbosity,convertTypes,staticsAsPublics,bareCodeView);
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
BIN
common/windows/delphi/ext/tds2dbg/tds2dbg.bin
Normal file
BIN
common/windows/delphi/ext/tds2dbg/tds2dbg.bin
Normal file
Binary file not shown.
2568
common/windows/delphi/ext/tds2dbg/tds2dbg.cpp
Normal file
2568
common/windows/delphi/ext/tds2dbg/tds2dbg.cpp
Normal file
File diff suppressed because it is too large
Load diff
1515
common/windows/delphi/ext/tds2dbg/tds2dbg.dcf
Normal file
1515
common/windows/delphi/ext/tds2dbg/tds2dbg.dcf
Normal file
File diff suppressed because it is too large
Load diff
38
common/windows/delphi/ext/tds2dbg/tds2dbg.h
Normal file
38
common/windows/delphi/ext/tds2dbg/tds2dbg.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright (c) 2009-2010, Bjarne Juul Pasgaard
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice, this permission notice and the following disclaimer
|
||||
// appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
#ifndef TDS2DBGH
|
||||
#define TDS2DBGH
|
||||
|
||||
/// @brief Converts an exe and a tds file to a dbg file.
|
||||
///
|
||||
/// @param exeFileName Name of EXE file.
|
||||
/// @param tdsFileName Name of TDS file.
|
||||
/// @param dbgFileName Name of DBG file.
|
||||
/// @param verbosity Verbosity level. 0 means silence.
|
||||
/// @param doConvTypes Should types be converted?
|
||||
/// @param staticsAsPublics Treat statics as publics?
|
||||
/// @param bareCodeView Write bare code view (no header).
|
||||
///
|
||||
/// @todo doConvTypes == true is incomplete.
|
||||
int tds2dbg(const char* exeFileName,
|
||||
const char* tdsFileName,
|
||||
const char* dbgFileName,
|
||||
unsigned int verbosity,
|
||||
bool doConvTypes,
|
||||
bool staticsAsPublics,
|
||||
bool bareCodeView);
|
||||
|
||||
#endif
|
||||
31
common/windows/delphi/ext/tds2dbg/tds2dbg.sln
Normal file
31
common/windows/delphi/ext/tds2dbg/tds2dbg.sln
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1000
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tds2dbg", "tds2dbg.vcxproj", "{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Debug|x64.Build.0 = Debug|x64
|
||||
{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Release|x64.ActiveCfg = Release|x64
|
||||
{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Release|x64.Build.0 = Release|x64
|
||||
{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {50FB6E2C-4FEF-4828-A315-1017276BF47A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
119
common/windows/delphi/ext/tds2dbg/tds2dbg.vcxproj
Normal file
119
common/windows/delphi/ext/tds2dbg/tds2dbg.vcxproj
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{40BFECE3-7FC0-4649-A3DC-E017FF84C75B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="fileutils.cpp" />
|
||||
<ClCompile Include="log.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="tds2dbg.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="fileutils.h" />
|
||||
<ClInclude Include="log.h" />
|
||||
<ClInclude Include="tds2dbg.h" />
|
||||
<ClInclude Include="tdscvstructs.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="tds2dbg.bin" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
50
common/windows/delphi/ext/tds2dbg/tds2dbg.vcxproj.filters
Normal file
50
common/windows/delphi/ext/tds2dbg/tds2dbg.vcxproj.filters
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="fileutils.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="log.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tds2dbg.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="fileutils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="log.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tds2dbg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tdscvstructs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="tds2dbg.bin">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
1278
common/windows/delphi/ext/tds2dbg/tdscvstructs.h
Normal file
1278
common/windows/delphi/ext/tds2dbg/tdscvstructs.h
Normal file
File diff suppressed because it is too large
Load diff
27
common/windows/delphi/ext/tds2dbg/testa.cpp
Normal file
27
common/windows/delphi/ext/tds2dbg/testa.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
|
||||
static int a = 1;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
(void) argc; (void) argv;
|
||||
|
||||
int b = a+1;
|
||||
|
||||
printf("%i %i\n",a,b);
|
||||
|
||||
while(a<0xf0000000) {
|
||||
++a;
|
||||
printf("%i\n",a++);
|
||||
Sleep(1000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
|
|
@ -29,10 +29,11 @@ function do_build() {
|
|||
build_manifest.res
|
||||
run_in_vs_env rc icons.rc
|
||||
delphi_msbuild kmconvert.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/kmconvert.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" kmconvert.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$DEVELOPER_PROGRAM"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/kmconvert.pdb" "$DEVELOPER_DEBUGPATH"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/kmconvert.dbg" "$DEVELOPER_DEBUGPATH"
|
||||
|
||||
rm -rf "$DEVELOPER_PROGRAM/projects/templates"
|
||||
mkdir -p "$DEVELOPER_PROGRAM/projects/templates"
|
||||
|
|
@ -52,12 +53,7 @@ function do_publish() {
|
|||
|
||||
wrap-signcode //d "Keyman Developer" "$DEVELOPER_PROGRAM/kmconvert.exe"
|
||||
wrap-symstore "$DEVELOPER_PROGRAM/kmconvert.exe" //t keyman-developer
|
||||
wrap-symstore "$DEVELOPER_DEBUGPATH/kmconvert.pdb" //t keyman-developer
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$DEVELOPER_PROGRAM/kmconvert.exe" "$INSTALLPATH_KEYMANDEVELOPER/kmconvert.exe"
|
||||
cp_if_exists "$DEVELOPER_DEBUGPATH/kmconvert.pdb" "$INSTALLPATH_KEYMANDEVELOPER/kmconvert.pdb"
|
||||
wrap-symstore "$DEVELOPER_DEBUGPATH/kmconvert.dbg" //t keyman-developer
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
|
|
@ -65,5 +61,5 @@ builder_run_action configure:project configure_windows_build_environment
|
|||
builder_run_action build:project do_build
|
||||
builder_run_action test:project do_test
|
||||
builder_run_action publish:project do_publish
|
||||
builder_run_action install:project do_install
|
||||
builder_run_action install:project cp "$DEVELOPER_PROGRAM/kmconvert.exe" "$INSTALLPATH_KEYMANDEVELOPER/kmconvert.exe"
|
||||
builder_run_action edit:project start kmconvert.dproj
|
||||
|
|
|
|||
|
|
@ -28,10 +28,11 @@ function do_build() {
|
|||
build_version.res
|
||||
build_manifest.res
|
||||
delphi_msbuild kmdbrowserhost.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/kmdbrowserhost.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" kmdbrowserhost.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$DEVELOPER_PROGRAM"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/kmdbrowserhost.pdb" "$DEVELOPER_DEBUGPATH"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/kmdbrowserhost.dbg" "$DEVELOPER_DEBUGPATH"
|
||||
}
|
||||
|
||||
function do_publish() {
|
||||
|
|
@ -40,12 +41,7 @@ function do_publish() {
|
|||
|
||||
wrap-signcode //d "Keyman Developer" "$DEVELOPER_PROGRAM/kmdbrowserhost.exe"
|
||||
wrap-symstore "$DEVELOPER_PROGRAM/kmdbrowserhost.exe" //t keyman-developer
|
||||
wrap-symstore "$DEVELOPER_DEBUGPATH/kmdbrowserhost.pdb" //t keyman-developer
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$DEVELOPER_PROGRAM/kmdbrowserhost.exe" "$INSTALLPATH_KEYMANDEVELOPER/kmdbrowserhost.exe"
|
||||
cp_if_exists "$DEVELOPER_DEBUGPATH/kmdbrowserhost.pdb" "$INSTALLPATH_KEYMANDEVELOPER/kmdbrowserhost.pdb"
|
||||
wrap-symstore "$DEVELOPER_DEBUGPATH/kmdbrowserhost.dbg" //t keyman-developer
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
|
|
@ -53,6 +49,6 @@ builder_run_action configure:project configure_windows_build_environment
|
|||
builder_run_action build:project do_build
|
||||
# builder_run_action test:project do_test
|
||||
builder_run_action publish:project do_publish
|
||||
builder_run_action install:project do_install
|
||||
builder_run_action install:project cp "$DEVELOPER_PROGRAM/kmdbrowserhost.exe" "$INSTALLPATH_KEYMANDEVELOPER/kmdbrowserhost.exe"
|
||||
builder_run_action edit:project start kmdbrowserhost.dproj
|
||||
|
||||
|
|
|
|||
|
|
@ -30,32 +30,11 @@ function do_build() {
|
|||
build_version.res
|
||||
build_manifest.res
|
||||
delphi_msbuild setup.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/setup.map" "$WIN32_TARGET"
|
||||
|
||||
#
|
||||
# The installer needs to be a multiple of 512 bytes in order for the SFX code
|
||||
# to find the ZIP header. After map2pdb appends its header, the file may not
|
||||
# be the right size. So take the file size of setup.exe and generate a nul
|
||||
# file that would expand it to nearest 512 bytes, and append it to the
|
||||
# executable. This will make the file 512 bytes larger if its size is already
|
||||
# on a 512 byte boundary.
|
||||
#
|
||||
|
||||
local file_size expansion_size expansion_file
|
||||
|
||||
file_size=$(stat -c %s "$WIN32_TARGET")
|
||||
expansion_size=$(( 512 - ( $file_size % 512 ) ))
|
||||
expansion_file="$(mktemp)"
|
||||
dd if=/dev/zero of="${expansion_file}" bs=1 count="${expansion_size}"
|
||||
cat "$WIN32_TARGET" "$expansion_file" > "$WIN32_TARGET.out"
|
||||
mv -f "$WIN32_TARGET.out" "$WIN32_TARGET"
|
||||
rm -f "${expansion_file}"
|
||||
|
||||
|
||||
sentrytool_delphiprep "$WIN32_TARGET" setup.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
cp "$WIN32_TARGET" "$DEVELOPER_PROGRAM"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/setup.pdb" "$DEVELOPER_DEBUGPATH/devsetup.pdb"
|
||||
# builder_if_release_build_level cp "$WIN32_TARGET_PATH/setup.pdb" "$DEVELOPER_DEBUGPATH/devsetup.pdb"
|
||||
# builder_if_release_build_level mv "$WIN32_TARGET_PATH/setup.pdb" "$WIN32_TARGET_PATH/devsetup.pdb"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/setup.dbg" "$DEVELOPER_DEBUGPATH/devsetup.dbg"
|
||||
builder_if_release_build_level mv "$WIN32_TARGET_PATH/setup.dbg" "$WIN32_TARGET_PATH/devsetup.dbg"
|
||||
}
|
||||
|
||||
function do_publish() {
|
||||
|
|
@ -63,7 +42,7 @@ function do_publish() {
|
|||
# Not signing here because we need to sign the bundled installer instead
|
||||
# wrap-signcode /d "Keyman Developer Setup" $(DEVELOPER_PROGRAM)\setup.exe
|
||||
wrap-symstore "$DEVELOPER_PROGRAM/setup.exe" //t keyman-developer
|
||||
wrap-symstore "$DEVELOPER_DEBUGPATH/setup.pdb" //t keyman-developer
|
||||
wrap-symstore "$DEVELOPER_DEBUGPATH/setup.dbg" //t keyman-developer
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
|
|
|
|||
|
|
@ -68,15 +68,16 @@ function do_build() {
|
|||
cp -R "$DEVELOPER_ROOT/src/tike/xml/"* "$DEVELOPER_PROGRAM/xml/"
|
||||
|
||||
delphi_msbuild tike.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/tike.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" tike.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$DEVELOPER_PROGRAM"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/tike.pdb" "$DEVELOPER_DEBUGPATH"
|
||||
cp kmc.cmd "$DEVELOPER_PROGRAM"
|
||||
cp "$KEYMAN_ROOT/core/build/x86/$TARGET_PATH/src/$KEYMANCORE_DLL" "$DEVELOPER_PROGRAM"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/tike.dbg" "$DEVELOPER_DEBUGPATH"
|
||||
|
||||
cp "$KEYMAN_ROOT/core/build/x86/$TARGET_PATH/src/$KEYMANCORE_DLL" "$WIN32_TARGET_PATH"
|
||||
builder_if_release_build_level cp "$KEYMAN_ROOT/core/build/x86/$TARGET_PATH/src/$KEYMANCORE_PDB" "$DEVELOPER_DEBUGPATH"
|
||||
builder_if_release_build_level cp "$KEYMAN_ROOT/core/build/x86/$TARGET_PATH/src/$KEYMANCORE_PDB" "$WIN32_TARGET_PATH"
|
||||
|
||||
cp "$KEYMAN_ROOT/common/windows/delphi/ext/sentry/sentry.dll" "$DEVELOPER_PROGRAM/"
|
||||
cp "$KEYMAN_ROOT/common/windows/delphi/ext/sentry/sentry.x64.dll" "$DEVELOPER_PROGRAM/"
|
||||
|
|
@ -95,12 +96,11 @@ function do_publish() {
|
|||
wrap-signcode //d "Keyman Developer" "$DEVELOPER_PROGRAM/sentry.x64.dll"
|
||||
wrap-signcode //d "Keyman Developer" "$DEVELOPER_PROGRAM/crashpad_handler.exe"
|
||||
wrap-symstore "$DEVELOPER_PROGRAM/tike.exe" //t keyman-developer
|
||||
wrap-symstore "$DEVELOPER_DEBUGPATH/tike.pdb" //t keyman-developer
|
||||
wrap-symstore "$DEVELOPER_DEBUGPATH/tike.dbg" //t keyman-developer
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$DEVELOPER_PROGRAM/tike.exe" "$INSTALLPATH_KEYMANDEVELOPER/tike.exe"
|
||||
cp_if_exists "$DEVELOPER_DEBUGPATH/tike.pdb" "$INSTALLPATH_KEYMANDEVELOPER/tike.pdb"
|
||||
cp "$DEVELOPER_PROGRAM/$KEYMANCORE_DLL" "$INSTALLPATH_KEYMANDEVELOPER/$KEYMANCORE_DLL"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,5 @@ DEVELOPER_DEBUGPATH="$DEVELOPER_ROOT/debug"
|
|||
# Delphi build tool macros
|
||||
|
||||
SENTRYTOOL="$COMMON_ROOT/tools/sentrytool/$WIN32_TARGET_PATH/sentrytool.exe"
|
||||
TDS2DBG="$KEYMAN_ROOT/common/windows/bin/tools/tds2dbg"
|
||||
DEVTOOLS="$COMMON_ROOT/tools/devtools/$WIN32_TARGET_PATH/devtools.exe"
|
||||
|
|
|
|||
|
|
@ -80,25 +80,23 @@ run_in_delphi_env() {
|
|||
)
|
||||
}
|
||||
|
||||
#
|
||||
# If map2pdb is on the path, then run it. Note: we do not include it in the repo
|
||||
# because it can have false positives in malware scans. map2pdb is used to
|
||||
# generate .pdb files for Delphi-generated executables, which can then be used
|
||||
# in debuggers such as WinDbg, or profilers such as VTune.
|
||||
#
|
||||
do_map2pdb() {
|
||||
if hash map2pdb 2>/dev/null; then
|
||||
map2pdb "$1" -bind:"$2"
|
||||
sentrytool_delphiprep() {
|
||||
if builder_is_ci_build && builder_is_ci_build_level_build; then
|
||||
builder_echo "Skipping sentrytool_delphiprep - buildLevel=build: $@"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local EXE_PATH="$1"
|
||||
local DPR_PATH="$2"
|
||||
(
|
||||
builder_echo heading "### delphi: sentrytool_delphiprep $1 $2"
|
||||
source "$KEYMAN_ROOT/resources/build/win/delphi_environment.inc.sh"
|
||||
"$SENTRYTOOL" delphiprep -r "$KEYMAN_ROOT" -i "$DELPHIINCLUDES" "$(cygpath -w "$EXE_PATH")" -dpr "$DPR_PATH"
|
||||
)
|
||||
}
|
||||
|
||||
#
|
||||
# If the first parameter is a file that exists, do the copy, otherwise, no-op.
|
||||
#
|
||||
cp_if_exists() {
|
||||
if [[ -f "$1" ]]; then
|
||||
cp "$@"
|
||||
fi
|
||||
tds2dbg() {
|
||||
builder_if_release_build_level "$TDS2DBG" "$@"
|
||||
}
|
||||
|
||||
delphi_msbuild() {
|
||||
|
|
|
|||
|
|
@ -90,6 +90,10 @@ function do_publish() {
|
|||
rm -f setup.inf
|
||||
cat "$WINDOWS_PROGRAM_APP/setup-redist.exe" keymandesktop.zip > keymandesktop.exe
|
||||
rm -f keymandesktop.zip
|
||||
|
||||
#
|
||||
# Sign the installer
|
||||
#
|
||||
wrap-signcode //d "Keyman for Windows" keymandesktop.exe
|
||||
|
||||
builder_if_release_build_level copy-installer
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@ function do_build() {
|
|||
# TODO: why no manifest?
|
||||
# build_manifest.res
|
||||
delphi_msbuild insthelp.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/insthelp.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" insthelp.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_APP"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/insthelp.pdb" "$WINDOWS_DEBUGPATH_APP"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/insthelp.dbg" "$WINDOWS_DEBUGPATH_APP/insthelp.dbg"
|
||||
}
|
||||
|
||||
function do_publish() {
|
||||
|
|
@ -42,7 +43,7 @@ function do_publish() {
|
|||
|
||||
wrap-signcode //d "Keyman for Windows Install Helper" "$WINDOWS_PROGRAM_APP/insthelp.exe"
|
||||
wrap-symstore "$WINDOWS_PROGRAM_APP/insthelp.exe" //t keyman-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/insthelp.pdb" //t keyman-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/insthelp.dbg" //t keyman-windows
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
|
|
|
|||
|
|
@ -28,10 +28,11 @@ function do_build() {
|
|||
build_version.res
|
||||
build_manifest.res
|
||||
delphi_msbuild kmbrowserhost.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/kmbrowserhost.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" kmbrowserhost.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_APP"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/kmbrowserhost.pdb" "$WINDOWS_DEBUGPATH_APP"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/kmbrowserhost.dbg" "$WINDOWS_DEBUGPATH_APP/kmbrowserhost.dbg"
|
||||
}
|
||||
|
||||
function do_publish() {
|
||||
|
|
@ -40,12 +41,7 @@ function do_publish() {
|
|||
|
||||
wrap-signcode //d "Keyman for Windows" "$WINDOWS_PROGRAM_APP/kmbrowserhost.exe"
|
||||
wrap-symstore "$WINDOWS_PROGRAM_APP/kmbrowserhost.exe" //t keyman-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/kmbrowserhost.pdb" //t keyman-windows
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$WINDOWS_PROGRAM_APP/kmbrowserhost.exe" "$INSTALLPATH_KEYMANAPP/kmbrowserhost.exe"
|
||||
cp_if_exists "$WINDOWS_DEBUGPATH_APP/kmbrowserhost.pdb" "$INSTALLPATH_KEYMANAPP/kmbrowserhost.pdb"
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/kmbrowserhost.dbg" //t keyman-windows
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
|
|
@ -53,5 +49,5 @@ builder_run_action configure:project configure_windows_build_environment
|
|||
builder_run_action build:project do_build
|
||||
# builder_run_action test:project do_test
|
||||
builder_run_action publish:project do_publish
|
||||
builder_run_action install:project do_install
|
||||
builder_run_action install:project cp "$WINDOWS_PROGRAM_APP/kmbrowserhost.exe" "$INSTALLPATH_KEYMANAPP/kmbrowserhost.exe"
|
||||
builder_run_action edit:project start kmbrowserhost.dproj
|
||||
|
|
|
|||
|
|
@ -28,10 +28,11 @@ function do_build() {
|
|||
build_version.res
|
||||
build_manifest.res
|
||||
delphi_msbuild kmconfig.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/kmconfig.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" kmconfig.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_APP"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/kmconfig.pdb" "$WINDOWS_DEBUGPATH_APP"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/kmconfig.dbg" "$WINDOWS_DEBUGPATH_APP/kmconfig.dbg"
|
||||
}
|
||||
|
||||
function do_publish() {
|
||||
|
|
@ -40,12 +41,7 @@ function do_publish() {
|
|||
|
||||
wrap-signcode //d "Keyman for Windows" "$WINDOWS_PROGRAM_APP/kmconfig.exe"
|
||||
wrap-symstore "$WINDOWS_PROGRAM_APP/kmconfig.exe" //t keyman-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/kmconfig.pdb" //t keyman-windows
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$WINDOWS_PROGRAM_APP/kmconfig.exe" "$INSTALLPATH_KEYMANAPP/kmconfig.exe"
|
||||
cp_if_exists "$WINDOWS_DEBUGPATH_APP/kmconfig.pdb" "$INSTALLPATH_KEYMANAPP/kmconfig.pdb"
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/kmconfig.dbg" //t keyman-windows
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
|
|
@ -53,5 +49,5 @@ builder_run_action configure:project configure_windows_build_environment
|
|||
builder_run_action build:project do_build
|
||||
# builder_run_action test:project do_test
|
||||
builder_run_action publish:project do_publish
|
||||
builder_run_action install:project do_install
|
||||
builder_run_action install:project cp "$WINDOWS_PROGRAM_APP/kmconfig.exe" "$INSTALLPATH_KEYMANAPP/kmconfig.exe"
|
||||
builder_run_action edit:project start kmconfig.dproj
|
||||
|
|
|
|||
|
|
@ -35,10 +35,11 @@ function do_build() {
|
|||
build_manifest.res
|
||||
run_in_vs_env rc icons.rc
|
||||
delphi_msbuild kmshell.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/kmshell.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" kmshell.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_APP"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/kmshell.pdb" "$WINDOWS_DEBUGPATH_APP"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/kmshell.dbg" "$WINDOWS_DEBUGPATH_APP/kmshell.dbg"
|
||||
|
||||
do_build_data
|
||||
}
|
||||
|
|
@ -72,13 +73,11 @@ function do_publish() {
|
|||
|
||||
wrap-signcode //d "Keyman for Windows" "$WINDOWS_PROGRAM_APP/kmshell.exe"
|
||||
wrap-symstore "$WINDOWS_PROGRAM_APP/kmshell.exe" //t keyman-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/kmshell.pdb" //t keyman-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/kmshell.dbg" //t keyman-windows
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$WINDOWS_PROGRAM_APP/kmshell.exe" "$INSTALLPATH_KEYMANAPP/kmshell.exe"
|
||||
cp_if_exists "$WINDOWS_DEBUGPATH_APP/kmshell.pdb" "$INSTALLPATH_KEYMANAPP/kmshell.pdb"
|
||||
|
||||
rm -rf "$INSTALLPATH_KEYMANAPP/xml"
|
||||
mkdir -p "$INSTALLPATH_KEYMANAPP/xml"
|
||||
cp -r "$WINDOWS_PROGRAM_APP/xml"/* "$INSTALLPATH_KEYMANAPP/xml/"
|
||||
|
|
|
|||
|
|
@ -37,32 +37,13 @@ function do_build() {
|
|||
"$DEVTOOLS" -buildsetupstrings locale\\ .\\
|
||||
|
||||
delphi_msbuild setup.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/setup.map" "$WIN32_TARGET"
|
||||
|
||||
#
|
||||
# The installer needs to be a multiple of 512 bytes in order for the SFX code
|
||||
# to find the ZIP header. After map2pdb appends its header, the file may not
|
||||
# be the right size. So take the file size of setup.exe and generate a nul
|
||||
# file that would expand it to nearest 512 bytes, and append it to the
|
||||
# executable. This will make the file 512 bytes larger if its size is already
|
||||
# on a 512 byte boundary.
|
||||
#
|
||||
|
||||
local file_size expansion_size expansion_file
|
||||
|
||||
file_size=$(stat -c %s "$WIN32_TARGET")
|
||||
expansion_size=$(( 512 - ( $file_size % 512 ) ))
|
||||
expansion_file="$(mktemp)"
|
||||
dd if=/dev/zero of="${expansion_file}" bs=1 count="${expansion_size}"
|
||||
cat "$WIN32_TARGET" "$expansion_file" > "$WIN32_TARGET.out"
|
||||
mv -f "$WIN32_TARGET.out" "$WIN32_TARGET"
|
||||
rm -f "${expansion_file}"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" setup.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_APP"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/setup.pdb" "$WINDOWS_DEBUGPATH_APP"
|
||||
|
||||
# setup-redist.exe does not get signed as it is intended for a bundled installer
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_APP/setup-redist.exe"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/setup.dbg" "$WINDOWS_DEBUGPATH_APP/setup.dbg"
|
||||
}
|
||||
|
||||
function do_build_debug_manifest() {
|
||||
|
|
@ -80,7 +61,7 @@ function do_publish() {
|
|||
|
||||
wrap-signcode //d "Keyman for Windows Setup" "$WINDOWS_PROGRAM_APP/setup.exe"
|
||||
wrap-symstore "$WINDOWS_PROGRAM_APP/setup.exe" //t keyman-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/setup.pdb" //t keyman-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_APP/setup.dbg" //t keyman-windows
|
||||
}
|
||||
|
||||
builder_run_action clean:project do_clean
|
||||
|
|
|
|||
|
|
@ -27,17 +27,18 @@ function do_build() {
|
|||
create-windows-output-folders
|
||||
build_version.res
|
||||
delphi_msbuild insthelper.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/insthelper.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" insthelper.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_ENGINE"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/insthelper.pdb" "$WINDOWS_DEBUGPATH_ENGINE"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/insthelper.dbg" "$WINDOWS_DEBUGPATH_ENGINE/insthelper.dbg"
|
||||
}
|
||||
|
||||
function do_publish() {
|
||||
wrap-signcode //d "Keyman Engine for Windows" "$WINDOWS_PROGRAM_ENGINE/insthelper.dll"
|
||||
|
||||
wrap-symstore "$WINDOWS_PROGRAM_ENGINE/insthelper.dll" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/insthelper.pdb" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/insthelper.dbg" //t keyman-engine-windows
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
|
|
|
|||
|
|
@ -38,10 +38,11 @@ function do_build() {
|
|||
run_in_vs_env rc osktoolbar.rc
|
||||
run_in_vs_env rc langswitch/langswitchmanager.rc
|
||||
delphi_msbuild keyman.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/keyman.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" keyman.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_ENGINE"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/keyman.pdb" "$WINDOWS_DEBUGPATH_ENGINE"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/keyman.dbg" "$WINDOWS_DEBUGPATH_ENGINE/keyman.dbg"
|
||||
|
||||
# Also copy sentry files here
|
||||
cp "$KEYMAN_ROOT/common/windows/delphi/ext/sentry/sentry.dll" \
|
||||
|
|
@ -64,7 +65,7 @@ function do_publish() {
|
|||
wrap-signcode //d "Keyman Engine for Windows" "$WINDOWS_PROGRAM_ENGINE/crashpad_handler.exe"
|
||||
|
||||
wrap-symstore "$WINDOWS_PROGRAM_ENGINE/keyman.exe" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/keyman.pdb" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/keyman.dbg" //t keyman-engine-windows
|
||||
}
|
||||
|
||||
function do_build_debug_manifest() {
|
||||
|
|
@ -76,17 +77,12 @@ function do_build_debug_manifest() {
|
|||
mv -f std-manifest.tmp manifest.in
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$WINDOWS_PROGRAM_ENGINE/keyman.exe" "$INSTALLPATH_KEYMANENGINE/keyman.exe"
|
||||
cp_if_exists "$WINDOWS_DEBUGPATH_ENGINE/keyman.pdb" "$INSTALLPATH_KEYMANENGINE/keyman.pdb"
|
||||
}
|
||||
|
||||
builder_run_action clean:project do_clean
|
||||
builder_run_action configure:project configure_windows_build_environment
|
||||
builder_run_action build:project do_build
|
||||
# builder_run_action test:project do_test
|
||||
builder_run_action publish:project do_publish
|
||||
builder_run_action install:project do_install
|
||||
builder_run_action install:project cp "$WINDOWS_PROGRAM_ENGINE/keyman.exe" "$INSTALLPATH_KEYMANENGINE/keyman.exe"
|
||||
|
||||
builder_run_action debug-manifest:project do_build_debug_manifest
|
||||
builder_run_action edit:project start keyman.dproj
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ function do_build() {
|
|||
|
||||
function do_install() {
|
||||
cp "$WINDOWS_PROGRAM_ENGINE/keymanmc.dll" "$INSTALLPATH_KEYMANENGINE/keymanmc.dll"
|
||||
reg add 'HKLM\SYSTEM\CurrentControlSet\services\eventlog\Application\Keyman' //v CategoryCount //t REG_DWORD //d 1 //f
|
||||
reg add 'HKLM\SYSTEM\CurrentControlSet\services\eventlog\Application\Keyman' //v CategoryMessageFile //t REG_SZ //d "$INSTALLPATH_KEYMANENGINE\\keymanmc.dll" //f
|
||||
reg add 'HKLM\SYSTEM\CurrentControlSet\services\eventlog\Application\Keyman' //v EventMessageFile //t REG_SZ //d "$INSTALLPATH_KEYMANENGINE\\keymanmc.dll" //f
|
||||
reg add 'HKLM\SYSTEM\CurrentControlSet\services\eventlog\Application\Keyman' //v TypesSupported //t REG_DWORD //d 7 //f
|
||||
reg add 'HKLM\\SYSTEM\\CurrentControlSet\\services\\eventlog\\Application\\Keyman' //v CategoryCount //t REG_DWORD //d 1 //f
|
||||
reg add 'HKLM\\SYSTEM\\CurrentControlSet\\services\\eventlog\\Application\\Keyman' //v CategoryMessageFile //t REG_SZ //d "$INSTALLPATH_KEYMANENGINE\\keymanmc.dll" //f
|
||||
reg add 'HKLM\\SYSTEM\\CurrentControlSet\\services\\eventlog\\Application\\Keyman' //v EventMessageFile //t REG_SZ //d "$INSTALLPATH_KEYMANENGINE\\keymanmc.dll" //f
|
||||
reg add 'HKLM\\SYSTEM\\CurrentControlSet\\services\\eventlog\\Application\\Keyman' //v TypesSupported //t REG_DWORD //d 7 //f
|
||||
}
|
||||
|
||||
builder_run_action clean:project rm -f keymanmc.dll keymanmc.h keymanmc.rc keymanmc.res MSG00409.bin
|
||||
|
|
|
|||
|
|
@ -36,16 +36,15 @@ function do_build() {
|
|||
run_in_vs_env gentlb -Tkmcomapi.tlb kmcomapi.ridl
|
||||
|
||||
delphi_msbuild kmcomapi.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/kmcomapi.map" "$WIN32_TARGET"
|
||||
# TODO: map2pdb for .x64
|
||||
sentrytool_delphiprep "$WIN32_TARGET" kmcomapi.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
delphi_msbuild kmcomapi.dproj "//p:Platform=Win64"
|
||||
# Delphi does not allow us to build to a different target filename so we rename after build
|
||||
mv -f "$WIN64_TARGET_PATH/kmcomapi.dll" "$WIN64_TARGET_PATH/kmcomapi.x64.dll"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_ENGINE"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/kmcomapi.pdb" "$WINDOWS_DEBUGPATH_ENGINE"
|
||||
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/kmcomapi.dbg" "$WINDOWS_DEBUGPATH_ENGINE/kmcomapi.dbg"
|
||||
cp "$WIN64_TARGET_PATH/kmcomapi.x64.dll" "$WINDOWS_PROGRAM_ENGINE/kmcomapi.x64.dll"
|
||||
|
||||
# x64 Delphi symbols not supported: cp "$WIN64_TARGET_PATH/kmcomapi.dbg" "$WINDOWS_PROGRAM_ENGINE/kmcomapi.x64.dbg"
|
||||
|
|
@ -57,7 +56,7 @@ function do_publish() {
|
|||
|
||||
wrap-symstore "$WINDOWS_PROGRAM_ENGINE/kmcomapi.dll" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_PROGRAM_ENGINE/kmcomapi.x64.dll" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/kmcomapi.pdb" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/kmcomapi.dbg" //t keyman-engine-windows
|
||||
# No support for 64-bit delphi symbols
|
||||
}
|
||||
|
||||
|
|
@ -66,8 +65,6 @@ function do_install() {
|
|||
cp "$WINDOWS_PROGRAM_ENGINE/kmcomapi.dll" "$INSTALLPATH_KEYMANENGINE/kmcomapi.dll"
|
||||
regsvr32 //s "$INSTALLPATH_KEYMANENGINE/kmcomapi.dll"
|
||||
|
||||
cp_if_exists "$WINDOWS_DEBUGPATH_ENGINE/kmcomapi.pdb" "$INSTALLPATH_KEYMANENGINE/kmcomapi.pdb"
|
||||
|
||||
regsvr32 //s //u "$INSTALLPATH_KEYMANENGINE/kmcomapi.x64.dll"
|
||||
cp "$WINDOWS_PROGRAM_ENGINE/kmcomapi.x64.dll" "$INSTALLPATH_KEYMANENGINE/kmcomapi.x64.dll"
|
||||
regsvr32 //s "$INSTALLPATH_KEYMANENGINE/kmcomapi.x64.dll"
|
||||
|
|
|
|||
|
|
@ -42,11 +42,12 @@ function do_build() {
|
|||
rm -f tsysinfox64.bin
|
||||
|
||||
delphi_msbuild tsysinfo.dproj "//p:Platform=Win32"
|
||||
do_map2pdb "$WIN32_TARGET_PATH/tsysinfo.map" "$WIN32_TARGET"
|
||||
sentrytool_delphiprep "$WIN32_TARGET" tsysinfo.dpr
|
||||
tds2dbg "$WIN32_TARGET"
|
||||
|
||||
cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_ENGINE"
|
||||
cp *.xslt "$WINDOWS_PROGRAM_ENGINE/"
|
||||
cp_if_exists "$WIN32_TARGET_PATH/tsysinfo.pdb" "$WINDOWS_DEBUGPATH_ENGINE"
|
||||
builder_if_release_build_level cp "$WIN32_TARGET_PATH/tsysinfo.dbg" "$WINDOWS_DEBUGPATH_ENGINE/tsysinfo.dbg"
|
||||
}
|
||||
|
||||
function do_publish() {
|
||||
|
|
@ -56,12 +57,11 @@ function do_publish() {
|
|||
wrap-signcode //d "Keyman Engine for Windows" "$WINDOWS_PROGRAM_ENGINE/tsysinfo.exe"
|
||||
|
||||
wrap-symstore "$WINDOWS_PROGRAM_ENGINE/tsysinfo.exe" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/tsysinfo.pdb" //t keyman-engine-windows
|
||||
wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/tsysinfo.dbg" //t keyman-engine-windows
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$WINDOWS_PROGRAM_ENGINE/tsysinfo.exe" "$INSTALLPATH_KEYMANENGINE/tsysinfo.exe"
|
||||
cp_if_exists "$WINDOWS_DEBUGPATH_ENGINE/tsysinfo.pdb" "$INSTALLPATH_KEYMANENGINE/tsysinfo.pdb"
|
||||
cp *.xslt "$INSTALLPATH_KEYMANENGINE/"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,10 +39,15 @@ function do_publish() {
|
|||
wrap-signcode //d "Keyman Engine for Windows" "$WINDOWS_PROGRAM_ENGINE/tsysinfox64.exe"
|
||||
}
|
||||
|
||||
function do_install() {
|
||||
cp "$WINDOWS_PROGRAM_ENGINE/tsysinfox64.exe" "$INSTALLPATH_KEYMANENGINE/tsysinfox64.exe"
|
||||
cp *.xslt "$INSTALLPATH_KEYMANENGINE/"
|
||||
}
|
||||
|
||||
builder_run_action clean:project clean_windows_project_files
|
||||
builder_run_action configure:project configure_windows_build_environment
|
||||
builder_run_action build:project do_build
|
||||
# builder_run_action test:project (no current tests)
|
||||
# builder_run_action test:project do_test
|
||||
builder_run_action publish:project do_publish
|
||||
# builder_run_action install:project (installed as part of tsysinfo)
|
||||
builder_run_action install:project do_install
|
||||
builder_run_action edit:project start tsysinfox64.dproj
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue