some missing headers

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 3988bc837f
commit 8511c7ac0e
  1. 16
      plugins/cffadaptor/src/UBCFFAdaptor.cpp
  2. 15
      plugins/cffadaptor/src/UBCFFAdaptor.h
  3. 15
      plugins/cffadaptor/src/UBCFFAdaptor_global.h
  4. 15
      plugins/cffadaptor/src/UBCFFConstants.h
  5. 15
      plugins/cffadaptor/src/UBGlobals.h
  6. 16
      src/desktop/UBWindowCapture_mac.mm
  7. 6
      src/frameworks/UBPlatformUtils_mac.mm
  8. 1
      src/gui/UBThumbnailWidget.cpp
  9. 59
      tools/CrashReportViewer/CrashReporterSymbolSupplier.cpp
  10. 39
      tools/CrashReportViewer/CrashReporterSymbolSupplier.h
  11. 261
      tools/CrashReportViewer/CrashWindow.cpp
  12. 35
      tools/CrashReportViewer/CrashWindow.h
  13. 15
      tools/CrashReportViewer/main.cpp
  14. 15
      tools/pdf2image/core/UBPlatformUtils.cpp
  15. 15
      tools/pdf2image/core/UBPlatformUtils.h
  16. 17
      tools/pdf2image/pdf2image.cpp

@ -3,24 +3,24 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */
#include "UBCFFAdaptor.h" #include "UBCFFAdaptor.h"
#include <QtCore> #include <QtCore>

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */

@ -28,22 +28,22 @@
UBWindowCapture::UBWindowCapture(UBDesktopAnnotationController *parent) UBWindowCapture::UBWindowCapture(UBDesktopAnnotationController *parent)
: QObject(parent) : QObject(parent)
, mParent(parent) , mParent(parent)
{ {
// NOOP // NOOP
} }
UBWindowCapture::~UBWindowCapture() UBWindowCapture::~UBWindowCapture()
{ {
// NOOP // NOOP
} }
const QPixmap UBWindowCapture::getCapturedWindow() const QPixmap UBWindowCapture::getCapturedWindow()
{ {
return mWindowPixmap; return mWindowPixmap;
} }
@ -51,11 +51,11 @@ int UBWindowCapture::execute()
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *path = [NSString pathWithComponents: [NSArray arrayWithObjects: NSTemporaryDirectory(), NSString *path = [NSString pathWithComponents: [NSArray arrayWithObjects: NSTemporaryDirectory(),
[[NSString stringWithFormat:@"%d",[NSDate timeIntervalSinceReferenceDate]] stringByAppendingPathExtension:@"uninote"], [[NSString stringWithFormat:@"%d",[NSDate timeIntervalSinceReferenceDate]] stringByAppendingPathExtension:@"uninote"],
nil]]; nil]];
NSTask *task = [[NSTask alloc] init]; NSTask *task = [[NSTask alloc] init];
NSArray *arguments = [NSArray arrayWithObjects: @"-i", @"-W", @"-m", @"-tpng", path, nil]; NSArray *arguments = [NSArray arrayWithObjects: @"-i", @"-W", @"-m", @"-tpng", path, nil];
[task setLaunchPath: @"/usr/sbin/screencapture"]; [task setLaunchPath: @"/usr/sbin/screencapture"];
[task setArguments: arguments]; [task setArguments: arguments];

@ -461,8 +461,8 @@ void UBPlatformUtils::initializeKeyboardLayouts()
int count = CFArrayGetCount(kbds); int count = CFArrayGetCount(kbds);
QList<UBKeyboardLocale*> result; QList<UBKeyboardLocale*> result;
qDebug() << "initializeKeyboardLayouts"; qDebug() << "initializeKeyboardLayouts";
qDebug() << "Found system locales: " << count; qDebug() << "Found system locales: " << count;
for(int i=0; i<count; i++) for(int i=0; i<count; i++)
{ {
@ -554,7 +554,7 @@ void UBPlatformUtils::initializeKeyboardLayouts()
const QString resName = ":/images/flags/" + name + ".png"; const QString resName = ":/images/flags/" + name + ".png";
QIcon *iconLang = new QIcon(resName); QIcon *iconLang = new QIcon(resName);
qDebug() << "Locale: " << ID << ", name: " << name; qDebug() << "Locale: " << ID << ", name: " << name;
result.append(new UBKeyboardLocale(fullName, name, ID, iconLang, keybt)); result.append(new UBKeyboardLocale(fullName, name, ID, iconLang, keybt));
} }

@ -19,6 +19,7 @@
* along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>. * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QString> #include <QString>
#include <QCursor> #include <QCursor>

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */
@ -34,39 +33,39 @@
CrashReporterSymbolSupplier::CrashReporterSymbolSupplier(QString pUniboardSymFiles) { CrashReporterSymbolSupplier::CrashReporterSymbolSupplier(QString pUniboardSymFiles) {
mUniboardSymFile.setFileName(pUniboardSymFiles); mUniboardSymFile.setFileName(pUniboardSymFiles);
} }
// Returns the path to the symbol file for the given module. // Returns the path to the symbol file for the given module.
google_breakpad::SymbolSupplier::SymbolResult CrashReporterSymbolSupplier::GetSymbolFile(const google_breakpad::CodeModule *module, google_breakpad::SymbolSupplier::SymbolResult CrashReporterSymbolSupplier::GetSymbolFile(const google_breakpad::CodeModule *module,
const google_breakpad::SystemInfo *system_info, const google_breakpad::SystemInfo *system_info,
string *symbol_file) string *symbol_file)
{ {
QString moduleName = QString::fromStdString(module->code_file()); QString moduleName = QString::fromStdString(module->code_file());
if (moduleName.contains("Uniboard")) if (moduleName.contains("Uniboard"))
{ {
*symbol_file = mUniboardSymFile.fileName().toStdString(); *symbol_file = mUniboardSymFile.fileName().toStdString();
return FOUND; return FOUND;
} }
return NOT_FOUND; return NOT_FOUND;
} }
// Returns the path to the symbol file for the given module. // Returns the path to the symbol file for the given module.
google_breakpad::SymbolSupplier::SymbolResult CrashReporterSymbolSupplier::GetSymbolFile(const google_breakpad::CodeModule *module, google_breakpad::SymbolSupplier::SymbolResult CrashReporterSymbolSupplier::GetSymbolFile(const google_breakpad::CodeModule *module,
const google_breakpad::SystemInfo *system_info, const google_breakpad::SystemInfo *system_info,
string *symbol_file, string *symbol_file,
string *symbol_data) string *symbol_data)
{ {
SymbolSupplier::SymbolResult s = GetSymbolFile(module, SymbolSupplier::SymbolResult s = GetSymbolFile(module,
system_info, system_info,
symbol_file); symbol_file);
if (s == FOUND) { if (s == FOUND) {
std::ifstream in(symbol_file->c_str()); std::ifstream in(symbol_file->c_str());
getline(in, *symbol_data, std::string::traits_type::to_char_type( getline(in, *symbol_data, std::string::traits_type::to_char_type(
std::string::traits_type::eof())); std::string::traits_type::eof()));
in.close(); in.close();
} }
return s; return s;
} }

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */
@ -32,22 +31,22 @@ using std::string;
class CrashReporterSymbolSupplier : public google_breakpad::SymbolSupplier class CrashReporterSymbolSupplier : public google_breakpad::SymbolSupplier
{ {
public: public:
CrashReporterSymbolSupplier(QString pUniboardSymFiles); CrashReporterSymbolSupplier(QString pUniboardSymFiles);
virtual ~CrashReporterSymbolSupplier() {} virtual ~CrashReporterSymbolSupplier() {}
// Returns the path to the symbol file for the given module. // Returns the path to the symbol file for the given module.
SymbolResult GetSymbolFile(const google_breakpad::CodeModule *module, SymbolResult GetSymbolFile(const google_breakpad::CodeModule *module,
const google_breakpad::SystemInfo *system_info, const google_breakpad::SystemInfo *system_info,
string *symbol_file); string *symbol_file);
// Returns the path to the symbol file for the given module. // Returns the path to the symbol file for the given module.
SymbolResult GetSymbolFile(const google_breakpad::CodeModule *module, SymbolResult GetSymbolFile(const google_breakpad::CodeModule *module,
const google_breakpad::SystemInfo *system_info, const google_breakpad::SystemInfo *system_info,
string *symbol_file, string *symbol_file,
string *symbol_data); string *symbol_data);
private: private:
QFile mUniboardSymFile; QFile mUniboardSymFile;
}; };
#endif /* CRASHREPORTERSYMBOLSUPPLIER_H_ */ #endif /* CRASHREPORTERSYMBOLSUPPLIER_H_ */

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */
@ -31,14 +30,14 @@ CrashWindow::CrashWindow(QWidget* parent) : QDialog(parent)
mCrashReporterUi->setupUi(this); mCrashReporterUi->setupUi(this);
mCrashReporterUi->crashReportResult->setFont(QFont("Monaco", 11)); mCrashReporterUi->crashReportResult->setFont(QFont("Monaco", 11));
connect(mCrashReporterUi->viewReportButton, SIGNAL(clicked(bool)), this, SLOT(showReport())); connect(mCrashReporterUi->viewReportButton, SIGNAL(clicked(bool)), this, SLOT(showReport()));
connect(mCrashReporterUi->dumpFileButton, SIGNAL(clicked(bool)), this, SLOT(chooseDumpFile())); connect(mCrashReporterUi->dumpFileButton, SIGNAL(clicked(bool)), this, SLOT(chooseDumpFile()));
connect(mCrashReporterUi->symFileButton, SIGNAL(clicked(bool)), this, SLOT(chooseSymboleFile())); connect(mCrashReporterUi->symFileButton, SIGNAL(clicked(bool)), this, SLOT(chooseSymboleFile()));
} }
CrashWindow::~CrashWindow() CrashWindow::~CrashWindow()
{ {
// NOOP // NOOP
} }
void CrashWindow::setDumpFilePath(const QString &fileName) void CrashWindow::setDumpFilePath(const QString &fileName)
@ -48,47 +47,47 @@ void CrashWindow::setDumpFilePath(const QString &fileName)
void CrashWindow::chooseDumpFile() void CrashWindow::chooseDumpFile()
{ {
QSettings settings("Mnemis", "CrashReporter"); QSettings settings("Mnemis", "CrashReporter");
QString dumpFileName = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); QString dumpFileName = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
if (settings.contains("DumpFileName")) if (settings.contains("DumpFileName"))
{ {
dumpFileName = settings.value("DumpFileName").toString(); dumpFileName = settings.value("DumpFileName").toString();
} }
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
dumpFileName, dumpFileName,
tr("Dump file (*.dmp)")); tr("Dump file (*.dmp)"));
settings.setValue("DumpFileName", QVariant(fileName)); settings.setValue("DumpFileName", QVariant(fileName));
setDumpFilePath(fileName); setDumpFilePath(fileName);
} }
void CrashWindow::chooseSymboleFile() void CrashWindow::chooseSymboleFile()
{ {
QSettings settings("Mnemis", "CrashReporter"); QSettings settings("Mnemis", "CrashReporter");
QString symFileName = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); QString symFileName = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
if (settings.contains("SymFileName")) if (settings.contains("SymFileName"))
{ {
symFileName = settings.value("SymFileName").toString(); symFileName = settings.value("SymFileName").toString();
} }
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
symFileName, symFileName,
tr("Symbol file (*.sym)")); tr("Symbol file (*.sym)"));
settings.setValue("SymFileName", QVariant(fileName)); settings.setValue("SymFileName", QVariant(fileName));
mCrashReporterUi->symFilePath->setText(fileName); mCrashReporterUi->symFilePath->setText(fileName);
} }
//============================================================================= //=============================================================================
int CrashWindow::PrintRegister(const char *name, u_int32_t value, int sequence) { int CrashWindow::PrintRegister(const char *name, u_int32_t value, int sequence) {
if (sequence % 4 == 0) { if (sequence % 4 == 0) {
mReport.append("\n"); mReport.append("\n");
} }
// string should not exceed 200 byte!!! // string should not exceed 200 byte!!!
size_t BufSize = 2000; size_t BufSize = 2000;
char buf[BufSize]; char buf[BufSize];
snprintf(buf, BufSize, "%6s = 0x%08x ", name, value); snprintf(buf, BufSize, "%6s = 0x%08x ", name, value);
QString str = QString::fromAscii(buf); QString str = QString::fromAscii(buf);
mReport.append(str); mReport.append(str);
return ++sequence; return ++sequence;
} }
//============================================================================= //=============================================================================
@ -101,9 +100,9 @@ void CrashWindow::PrintStack(const CallStack* stack, const string &cpu) {
const CodeModule *module = frame->module; const CodeModule *module = frame->module;
// string should not exceed 200 byte!!! // string should not exceed 200 byte!!!
size_t BufSize = 2000; size_t BufSize = 2000;
char buf[BufSize]; char buf[BufSize];
snprintf(buf, BufSize, "%2d ", frame_index); snprintf(buf, BufSize, "%2d ", frame_index);
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
if (module) { if (module) {
// Module name (20 chars max) // Module name (20 chars max)
@ -229,98 +228,98 @@ void CrashWindow::PrintModules(const CodeModules *modules) {
u_int64_t base_address = module->base_address(); u_int64_t base_address = module->base_address();
// string should not exceed 200 byte!!! // string should not exceed 200 byte!!!
size_t BufSize = 2000; size_t BufSize = 2000;
char buf[BufSize]; char buf[BufSize];
snprintf(buf, BufSize, "0x%08llx - 0x%08llx %s %s%s %s\n", snprintf(buf, BufSize, "0x%08llx - 0x%08llx %s %s%s %s\n",
base_address, base_address + module->size() - 1, base_address, base_address + module->size() - 1,
PathnameStripper::File(module->code_file()).c_str(), PathnameStripper::File(module->code_file()).c_str(),
module->version().empty() ? "???" : module->version().c_str(), module->version().empty() ? "???" : module->version().c_str(),
main_module != NULL && base_address == main_address ? main_module != NULL && base_address == main_address ?
" (main)" : "", " (main)" : "",
module->code_file().c_str()); module->code_file().c_str());
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
} }
} }
void CrashWindow::showReport() void CrashWindow::showReport()
{ {
qDebug() << "compute report"; qDebug() << "compute report";
mReport.clear(); mReport.clear();
QString minidump_file = mCrashReporterUi->dumpFilePath->text(); QString minidump_file = mCrashReporterUi->dumpFilePath->text();
BasicSourceLineResolver resolver; BasicSourceLineResolver resolver;
scoped_ptr<CrashReporterSymbolSupplier> symbol_supplier( scoped_ptr<CrashReporterSymbolSupplier> symbol_supplier(
new CrashReporterSymbolSupplier(mCrashReporterUi->symFilePath->text())); new CrashReporterSymbolSupplier(mCrashReporterUi->symFilePath->text()));
scoped_ptr<MinidumpProcessor> scoped_ptr<MinidumpProcessor>
minidump_processor(new MinidumpProcessor(symbol_supplier.get(), &resolver)); minidump_processor(new MinidumpProcessor(symbol_supplier.get(), &resolver));
ProcessState process_state; ProcessState process_state;
if (minidump_processor->Process(minidump_file.toStdString(), &process_state) != if (minidump_processor->Process(minidump_file.toStdString(), &process_state) !=
MinidumpProcessor::PROCESS_OK) { MinidumpProcessor::PROCESS_OK) {
mReport += "MinidumpProcessor::Process failed\n"; mReport += "MinidumpProcessor::Process failed\n";
return; return;
} }
const SystemInfo *system_info = process_state.system_info(); const SystemInfo *system_info = process_state.system_info();
string cpu = system_info->cpu; string cpu = system_info->cpu;
// Convert the time to a string // Convert the time to a string
u_int32_t time_date_stamp = process_state.time_date_stamp(); u_int32_t time_date_stamp = process_state.time_date_stamp();
struct tm timestruct; struct tm timestruct;
gmtime_r(reinterpret_cast<time_t*>(&time_date_stamp), &timestruct); gmtime_r(reinterpret_cast<time_t*>(&time_date_stamp), &timestruct);
char timestr[20]; char timestr[20];
// string should not exceed 200 byte!!! // string should not exceed 200 byte!!!
size_t BufSize = 2000; size_t BufSize = 2000;
char buf[BufSize]; char buf[BufSize];
strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", &timestruct); strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", &timestruct);
snprintf(buf, BufSize, "Date: %s GMT\n", timestr); snprintf(buf, BufSize, "Date: %s GMT\n", timestr);
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
snprintf(buf, BufSize, "Operating system: %s (%s)\n", system_info->os.c_str(), snprintf(buf, BufSize, "Operating system: %s (%s)\n", system_info->os.c_str(),
system_info->os_version.c_str()); system_info->os_version.c_str());
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
snprintf(buf, BufSize, "Architecture: %s\n", cpu.c_str()); snprintf(buf, BufSize, "Architecture: %s\n", cpu.c_str());
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
if (process_state.crashed()) { if (process_state.crashed()) {
snprintf(buf, BufSize, "Crash reason: %s\n", process_state.crash_reason().c_str()); snprintf(buf, BufSize, "Crash reason: %s\n", process_state.crash_reason().c_str());
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
snprintf(buf, BufSize, "Crash address: 0x%llx\n", process_state.crash_address()); snprintf(buf, BufSize, "Crash address: 0x%llx\n", process_state.crash_address());
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
} else { } else {
mReport.append("No crash\n"); mReport.append("No crash\n");
} }
int requesting_thread = process_state.requesting_thread(); int requesting_thread = process_state.requesting_thread();
if (requesting_thread != -1) { if (requesting_thread != -1) {
mReport.append("\n"); mReport.append("\n");
snprintf(buf, BufSize, "Thread %d (%s)\n", snprintf(buf, BufSize, "Thread %d (%s)\n",
requesting_thread, requesting_thread,
process_state.crashed() ? "crashed" : process_state.crashed() ? "crashed" :
"requested dump, did not crash"); "requested dump, did not crash");
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
PrintStack(process_state.threads()->at(requesting_thread), cpu); PrintStack(process_state.threads()->at(requesting_thread), cpu);
} }
// Print all of the threads in the dump. // Print all of the threads in the dump.
int thread_count = process_state.threads()->size(); int thread_count = process_state.threads()->size();
for (int thread_index = 0; thread_index < thread_count; ++thread_index) { for (int thread_index = 0; thread_index < thread_count; ++thread_index) {
if (thread_index != requesting_thread) { if (thread_index != requesting_thread) {
// Don't print the crash thread again, it was already printed. // Don't print the crash thread again, it was already printed.
mReport.append("\n"); mReport.append("\n");
snprintf(buf, BufSize,"Thread %d\n", thread_index); snprintf(buf, BufSize,"Thread %d\n", thread_index);
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
PrintStack(process_state.threads()->at(thread_index), cpu); PrintStack(process_state.threads()->at(thread_index), cpu);
} }
} }
// Print the crashed registers // Print the crashed registers
if (requesting_thread != -1) { if (requesting_thread != -1) {
snprintf(buf, BufSize,"\nThread %d:", requesting_thread); snprintf(buf, BufSize,"\nThread %d:", requesting_thread);
mReport.append(QString::fromAscii(buf)); mReport.append(QString::fromAscii(buf));
PrintRegisters(process_state.threads()->at(requesting_thread), cpu); PrintRegisters(process_state.threads()->at(requesting_thread), cpu);
} }
// Print information about modules // Print information about modules
PrintModules(process_state.modules()); PrintModules(process_state.modules());
mCrashReporterUi->crashReportResult->setPlainText(mReport); mCrashReporterUi->crashReportResult->setPlainText(mReport);
} }

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */
@ -59,23 +58,23 @@ namespace Ui
class CrashWindow : public QDialog class CrashWindow : public QDialog
{ {
Q_OBJECT; Q_OBJECT;
public: public:
CrashWindow(QWidget* parent = 0); CrashWindow(QWidget* parent = 0);
virtual ~CrashWindow(); virtual ~CrashWindow();
void setDumpFilePath(const QString &fileName); void setDumpFilePath(const QString &fileName);
private slots: private slots:
void showReport(); void showReport();
void chooseDumpFile(); void chooseDumpFile();
void chooseSymboleFile(); void chooseSymboleFile();
private: private:
int PrintRegister(const char *name, u_int32_t value, int sequence); int PrintRegister(const char *name, u_int32_t value, int sequence);
void PrintStack(const CallStack* stack, const string &cpu); void PrintStack(const CallStack* stack, const string &cpu);
void PrintRegisters(const CallStack *stack, const string &cpu); void PrintRegisters(const CallStack *stack, const string &cpu);
void PrintModules(const CodeModules *modules); void PrintModules(const CodeModules *modules);
Ui::UniboardCrashreporter* mCrashReporterUi; Ui::UniboardCrashreporter* mCrashReporterUi;
QString mReport; QString mReport;
}; };

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */

@ -3,21 +3,20 @@
* *
* This file is part of Open-Sankoré. * This file is part of Open-Sankoré.
* *
* Open-Sankoré is free software; you can redistribute it and/or * Open-Sankoré is free software: you can redistribute it and/or modify
* modify it under the terms of the GNU Library General Public * it under the terms of the GNU General Public License as published by
* License as published by the Free Software Foundation, version 2, * the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's * with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the * "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library). * same license as the "OpenSSL" library).
* *
* Open-Sankoré is distributed in the hope that it will be useful, * Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Library General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU General Public License
* License along with Open-Sankoré; if not, see * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
* <http://www.gnu.org/licenses/>.
*/ */
@ -79,7 +78,7 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
//qDebug() << "Converting" << pdfFile << "(" << pageNumber << ") into" << imageFormat; //qDebug() << "Converting" << pdfFile << "(" << pageNumber << ") into" << imageFormat;
QImage image(width, height, QImage::Format_ARGB32); QImage image(width, height, QImage::Format_ARGB32);

Loading…
Cancel
Save