亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? crashhandler.cpp

?? Amarok是一款在LINUX或其他類UNIX操作系統(tǒng)中運行的音頻播放器軟件。 經(jīng)過兩年開發(fā)后
?? CPP
字號:
/*************************************************************************** *   Copyright (C) 2005 Max Howell <max.howell@methylblue.com>             * *                                                                         * *   This program 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; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#include "amarok.h"#include "amarokconfig.h"#include "crashhandler.h"#include <kapplication.h> //invokeMailer()#include <kdebug.h>       //kdBacktrace()#include <kdeversion.h>#include <klocale.h>#include <ktempfile.h>#include <qfile.h>#include <qregexp.h>#include <qtextstream.h>#include <qglobal.h> //qVersion()#include <cstdio>         //popen, fread#include <iostream>#include <sys/types.h>    //pid_t#include <sys/wait.h>     //waitpid#include <taglib/taglib.h>#include <unistd.h>       //write, getpid#ifndef TAGLIB_PATCH_VERSION// seems to be wheel's style#define TAGLIB_PATCH_VERSION 0#endifnamespace Amarok{    #if 0    class CrashHandlerWidget : public KDialog {    public:        CrashHandlerWidget();    };    #endif    static QString    runCommand( const QCString &command )    {        static const uint SIZE = 40960; //40 KiB        static char stdoutBuf[ SIZE ] = {0};        std::cout << "Running: " << command << std::endl;        FILE *process = ::popen( command, "r" );        if ( process )        {            stdoutBuf[ std::fread( static_cast<void*>( stdoutBuf ), sizeof(char), SIZE-1, process ) ] = '\0';            ::pclose( process );        }        return QString::fromLocal8Bit( stdoutBuf );    }    void    Crash::crashHandler( int /*signal*/ )    {        // we need to fork to be able to get a        // semi-decent bt - I dunno why        const pid_t pid = ::fork();        if( pid < 0 )        {            std::cout << "forking crash reporter failed\n";            // continuing now can't do no good            _exit( 1 );        }        else if ( pid == 0 )        {            // we are the child process (the result of the fork)            std::cout << "Amarok is crashing...\n";            QString subject = APP_VERSION " ";            QString body = i18n(                    "Amarok has crashed! We are terribly sorry about this :(\n\n"                    "But, all is not lost! You could potentially help us fix the crash. "                    "Information describing the crash is below, so just click send, "                    "or if you have time, write a brief description of how the crash happened first.\n\n"                    "Many thanks.\n\n" );            body += i18n( "\n\n\n\n\n\n"                    "The information below is to help the developers identify the problem, "                    "please do not modify it.\n\n\n\n" );            body += "======== DEBUG INFORMATION  =======\n"                    "Version:    " APP_VERSION "\n"                    "Engine:     %1\n"                    "Build date: " __DATE__ "\n"                    "CC version: " __VERSION__ "\n" //assuming we're using GCC                    "KDElibs:    " KDE_VERSION_STRING "\n"                    "Qt:         %2\n"                    "TagLib:     %3.%4.%5\n"                    "CPU count:  %6\n";            QString cpucount = "unknown";#ifdef __linux__            QString line;            uint cpuCount = 0;            QFile cpuinfo( "/proc/cpuinfo" );            if ( cpuinfo.open( IO_ReadOnly ) ) {                while ( cpuinfo.readLine( line, 20000 ) != -1 ) {                    if ( line.startsWith( "processor" ) ) {                        ++cpuCount;                    }                }            }            cpucount = QString::number( cpuCount );#endif            body = body.arg( AmarokConfig::soundSystem() )                    .arg( qVersion() )                    .arg( TAGLIB_MAJOR_VERSION )                    .arg( TAGLIB_MINOR_VERSION )                    .arg( TAGLIB_PATCH_VERSION )                    .arg( cpucount );            #ifdef NDEBUG            body += "NDEBUG:     true";            #endif            body += '\n';            /// obtain the backtrace with gdb            KTempFile temp;            temp.setAutoDelete( true );            const int handle = temp.handle();//             QCString gdb_command_string =//                     "file amarokapp\n"//                     "attach " + QCString().setNum( ::getppid() ) + "\n"//                     "bt\n" "echo \\n\n"//                     "thread apply all bt\n";            const QCString gdb_batch =                    "bt\n"                    "echo \\n\\n\n"                    "bt full\n"                    "echo \\n\\n\n"                    "echo ==== (gdb) thread apply all bt ====\\n\n"                    "thread apply all bt\n";            ::write( handle, gdb_batch, gdb_batch.length() );            ::fsync( handle );            // so we can read stderr too            ::dup2( fileno( stdout ), fileno( stderr ) );            QCString gdb;            gdb  = "gdb --nw -n --batch -x ";            gdb += temp.name().latin1();            gdb += " amarokapp ";            gdb += QCString().setNum( ::getppid() );            QString bt = runCommand( gdb );            /// clean up            bt.remove( "(no debugging symbols found)..." );            bt.remove( "(no debugging symbols found)\n" );            bt.replace( QRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters            bt.stripWhiteSpace();            /// analyze usefulness            bool useful = true;            const QString fileCommandOutput = runCommand( "file `which amarokapp`" );            if( fileCommandOutput.find( "not stripped", false ) == -1 )                subject += "[___stripped]"; //same length as below            else                subject += "[NOTstripped]";            if( !bt.isEmpty() ) {                const int invalidFrames = bt.contains( QRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") );                const int validFrames = bt.contains( QRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") );                const int totalFrames = invalidFrames + validFrames;                if( totalFrames > 0 ) {                    const double validity = double(validFrames) / totalFrames;                    subject += QString("[validity: %1]").arg( validity, 0, 'f', 2 );                    if( validity <= 0.5 ) useful = false;                }                subject += QString("[frames: %1]").arg( totalFrames, 3 /*padding*/ );                if( bt.find( QRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 )                    subject += "[line numbers]";            }            else                useful = false;            subject += QString("[%1]").arg( AmarokConfig::soundSystem().remove( QRegExp("-?engine") ) );            std::cout << subject.latin1() << std::endl;            //TODO -fomit-frame-pointer buggers up the backtrace, so detect it            //TODO -O optimization can rearrange execution and stuff so show a warning for the developer            //TODO pass the CXXFLAGS used with the email            if( useful ) {                body += "==== file `which amarokapp` =======\n";                body += fileCommandOutput + "\n\n";                body += "==== (gdb) bt =====================\n";                body += bt + "\n\n";                body += "==== kdBacktrace() ================\n";                body += kdBacktrace();                //TODO startup notification                kapp->invokeMailer(                        /*to*/          "amarok-backtraces@lists.sf.net",                        /*cc*/          QString(),                        /*bcc*/         QString(),                        /*subject*/     subject,                        /*body*/        body,                        /*messageFile*/ QString(),                        /*attachURLs*/  QStringList(),                        /*startup_id*/  "" );            }            else {                std::cout << i18n( "\nAmarok has crashed! We are terribly sorry about this :(\n\n"                                   "But, all is not lost! Perhaps an upgrade is already available "                                   "which fixes the problem. Please check your distribution's software repository.\n" ).local8Bit();            }            //_exit() exits immediately, otherwise this            //function is called repeatedly ad finitum            ::_exit( 255 );        }        else {            // we are the process that crashed            ::alarm( 0 );            // wait for child to exit            ::waitpid( pid, NULL, 0 );            ::_exit( 253 );        }    }}#if 0#include <qlabel.h>#include <qlayout.h>#include <qvbox.h>#include <kdialog.h>#include <kpushbutton.h>#include <kstdguiitem.h>#include <kstandarddirs.h>Amarok::CrashHandlerWidget::CrashHandlerWidget(){    QBoxLayout *layout = new QHBoxLayout( this, 18, 12 );    {        QBoxLayout *lay = new QVBoxLayout( layout );        QLabel *label = new QLabel( this );        label->setPixmap( locate( "data", "drkonqi/pics/konqi.png" ) );        label->setFrameStyle( QFrame::Plain | QFrame::Box );        lay->add( label );        lay->addItem( new QSpacerItem( 3, 3, QSizePolicy::Minimum, QSizePolicy::Expanding ) );    }    layout = new QVBoxLayout( layout, 6 );    layout->add( new QLabel( /*i18n*/(            "<p>" "Amarok has crashed! We are terribly sorry about this :("            "<p>" "However you now have an opportunity to help us fix this crash so that it doesn't "                  "happen again! Click <b>Send Email</b> and Amarok will prepare an email that you "                  "can send to us that contains information about the crash, and we'll try to fix it "                  "as soon as possible."            "<p>" "Thanks for choosing Amarok.<br>" ), this ) );    layout = new QHBoxLayout( layout, 6 );    layout->addItem( new QSpacerItem( 6, 6, QSizePolicy::Expanding ) );    layout->add( new KPushButton( KGuiItem( i18n("Send Email"), "mail_send" ), this, "email" ) );    layout->add( new KPushButton( KStdGuiItem::close(), this, "close" ) );    static_cast<QPushButton*>(child("email"))->setDefault( true );    connect( child( "email" ), SIGNAL(clicked()), SLOT(accept()) );    connect( child( "close" ), SIGNAL(clicked()), SLOT(reject()) );    setCaption( i18n("Crash Handler") );    setFixedSize( sizeHint() );}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久电影网站中文字幕| 欧美综合在线视频| 91久久精品一区二区三区| 欧美日韩综合不卡| 国产免费成人在线视频| 亚洲国产精品自拍| 91在线播放网址| 久久久一区二区三区| 三级久久三级久久| 色综合久久中文综合久久97| 久久久久久麻豆| 久久精品999| 日韩三级免费观看| 视频一区在线播放| 欧美精品久久99久久在免费线| 成人免费在线观看入口| 国产成人av电影在线播放| 欧美大片国产精品| 蜜桃一区二区三区在线| 7777精品伊人久久久大香线蕉超级流畅 | 色综合中文字幕国产| 国产精品不卡一区| 精品一区二区三区av| 777色狠狠一区二区三区| 亚洲综合久久久| 色婷婷久久久亚洲一区二区三区 | 成人丝袜18视频在线观看| 日韩女优av电影| 奇米影视一区二区三区| 欧美日韩电影在线播放| 亚洲综合激情小说| 欧美色网一区二区| 亚洲成人中文在线| 日韩视频免费直播| 精品一区二区三区在线播放| 欧美成人一区二区三区片免费| 人人超碰91尤物精品国产| 日韩欧美国产综合| 国产精品1区2区3区在线观看| 国产日产欧美一区二区视频| 国产suv一区二区三区88区| 国产精品美女久久福利网站| 99久久亚洲一区二区三区青草| 亚洲欧洲av在线| 欧美日韩在线电影| 蜜臀va亚洲va欧美va天堂| 欧美精品一区二区三区视频| 盗摄精品av一区二区三区| 亚洲人午夜精品天堂一二香蕉| 一本色道**综合亚洲精品蜜桃冫| 亚洲一区二区不卡免费| 欧美一区二区三区在线观看| 开心九九激情九九欧美日韩精美视频电影| 日韩一区二区精品在线观看| 国产成人自拍网| 亚洲尤物在线视频观看| 欧美mv日韩mv国产| proumb性欧美在线观看| 亚洲va在线va天堂| 久久精品亚洲乱码伦伦中文| 波多野结衣的一区二区三区| 偷偷要91色婷婷| 久久久久久影视| 91麻豆免费观看| 精品一区二区三区免费视频| 中文字幕一区二区5566日韩| 337p亚洲精品色噜噜| 成人一区二区视频| 天天爽夜夜爽夜夜爽精品视频| 精品sm在线观看| 欧美日韩免费一区二区三区| 国产成人免费视频网站| 亚洲一区二区不卡免费| 欧美精彩视频一区二区三区| 欧美亚洲高清一区二区三区不卡| 国产一区二区三区在线观看免费视频| 亚洲三级在线免费观看| 久久久午夜精品理论片中文字幕| 91国偷自产一区二区三区成为亚洲经典 | 久久99热这里只有精品| 国产精品乱码一区二区三区软件| 欧美日韩国产小视频在线观看| 国产黑丝在线一区二区三区| 亚洲成国产人片在线观看| 日本一区二区三级电影在线观看| 91精品欧美久久久久久动漫| fc2成人免费人成在线观看播放| 日韩成人伦理电影在线观看| 亚洲猫色日本管| 国产欧美一区二区在线| 8x福利精品第一导航| 91福利资源站| 99国产精品一区| 国产成人午夜高潮毛片| 极品尤物av久久免费看| 热久久久久久久| 图片区小说区区亚洲影院| 一区二区三区免费| 亚洲人精品一区| 中文字幕av一区二区三区| 精品少妇一区二区三区| 欧美精品在线一区二区三区| 91成人看片片| 91久久精品日日躁夜夜躁欧美| 成人高清视频在线观看| 国产福利一区在线观看| 国产精品一二三区在线| 激情图片小说一区| 精品午夜一区二区三区在线观看| 奇米色一区二区| 琪琪久久久久日韩精品| 青青草国产成人99久久| 美女一区二区视频| 日本麻豆一区二区三区视频| 天堂蜜桃91精品| 日韩精品成人一区二区三区| 五月综合激情网| 欧美a级理论片| 久久精工是国产品牌吗| 精品一区二区日韩| 国产一区二区三区日韩| 成人国产在线观看| av在线这里只有精品| 99久久综合狠狠综合久久| 色综合天天综合网天天看片| 日本韩国欧美在线| 欧美日本在线看| 欧美成va人片在线观看| 亚洲精品一区在线观看| 国产精品午夜免费| 亚洲精品中文在线观看| 亚洲va中文字幕| 国产在线看一区| eeuss鲁一区二区三区| 91激情在线视频| 精品免费国产二区三区 | 欧美一级欧美一级在线播放| 日韩欧美一区二区不卡| 国产日韩一级二级三级| 亚洲视频免费在线| 日韩高清不卡在线| 国产一区二区不卡| 91丝袜呻吟高潮美腿白嫩在线观看| 在线观看视频一区二区 | 国产精品高潮呻吟久久| 亚洲综合成人在线视频| 美腿丝袜在线亚洲一区| 99久久久精品| 日韩一级片在线观看| 国产精品久线观看视频| 亚洲18色成人| 懂色一区二区三区免费观看| 欧美亚洲高清一区二区三区不卡| 精品国产髙清在线看国产毛片| 中文字幕永久在线不卡| 美腿丝袜亚洲色图| 色综合久久中文综合久久97| 欧美精品一区男女天堂| 亚洲午夜成aⅴ人片| 国产成人在线网站| 欧美一区二区三区免费大片| 《视频一区视频二区| 久久精品国产在热久久| 色偷偷久久人人79超碰人人澡| 欧美日韩国产另类不卡| 综合激情网...| 国产一区视频在线看| 制服.丝袜.亚洲.另类.中文| 亚洲精品免费在线播放| 国产成人精品网址| 欧美不卡一区二区| 午夜久久久久久电影| 色综合久久天天综合网| 精品成人私密视频| 美女任你摸久久| 欧美日韩成人高清| 亚洲一区二区三区四区在线观看 | 久久久青草青青国产亚洲免观| 亚洲黄色在线视频| 成人伦理片在线| 国产午夜精品理论片a级大结局| 日本亚洲免费观看| 欧美日韩高清在线播放| 亚洲免费观看高清完整| 成人av在线一区二区三区| 26uuu久久天堂性欧美| 亚洲国产综合91精品麻豆| 成人激情免费网站| 国产视频一区在线观看| 国产自产视频一区二区三区| 日韩三级精品电影久久久| 一区二区成人在线视频| 波多野结衣中文字幕一区二区三区| 精品美女一区二区三区| 久久99精品久久久久久久久久久久 | 日本久久电影网| 亚洲乱码中文字幕| 色成人在线视频| 一区二区欧美精品| 欧洲视频一区二区|