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

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

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

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

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

@ -28,22 +28,22 @@
UBWindowCapture::UBWindowCapture(UBDesktopAnnotationController *parent)
: QObject(parent)
, mParent(parent)
: QObject(parent)
, mParent(parent)
{
// NOOP
// NOOP
}
UBWindowCapture::~UBWindowCapture()
{
// NOOP
// NOOP
}
const QPixmap UBWindowCapture::getCapturedWindow()
{
return mWindowPixmap;
return mWindowPixmap;
}
@ -51,11 +51,11 @@ int UBWindowCapture::execute()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *path = [NSString pathWithComponents: [NSArray arrayWithObjects: NSTemporaryDirectory(),
[[NSString stringWithFormat:@"%d",[NSDate timeIntervalSinceReferenceDate]] stringByAppendingPathExtension:@"uninote"],
nil]];
[[NSString stringWithFormat:@"%d",[NSDate timeIntervalSinceReferenceDate]] stringByAppendingPathExtension:@"uninote"],
nil]];
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 setArguments: arguments];

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save