vc release dll檔案除錯

2021-08-01 15:09:37 字數 3728 閱讀 4735

第三方工程、庫為release版本

開放給我們的是dll原始碼,並且是release版本

直接將dll工程改為debug,編譯肯定是過不去的

曲線救國,debug資訊經由乙個文字檔案輸出

實現dll的除錯

#include "serialanalyzer.h"

#include "serialanalyzersettings.h"

#include

#include

#include

#include

serialanalyzer::serialanalyzer()

:analyzer2(),  

msettings( new serialanalyzersettings() ),

msimulationinitilized( false )

serialanalyzer::~serialanalyzer()

void serialanalyzer::computesampleoffsets()

else}}

macdbg_prser("\r\n");

return retval;

}void serialanalyzer::workerthread()

if( msettings->minverted == false )

else

u64 bit_mask = 0;

u64 mask = 0x1ull;

for( u32 i=0; i

ser_printf("bit_mask = %x.\n", bit_mask);

ser_printf("mask = %x.\n", mask);

mserial = getanalyzerchanneldata( msettings->minputchannel );

mserial->trackminimumpulsewidth();

if( mserial->getbitstate() == mbitlow )

mserial->advancetonextedge();

for( ; ; )

if( msettings->minverted == true )

//資料在此已經解析出來了,儲存在data變數中

ser_printf("parse data = 0x%x.\n", data);

if( msettings->mserialmode != serialanalyzerenums::normal )

if( msettings->mserialmode == serialanalyzerenums::mpmodemsbzeromeansaddress )

//now remove the msb.

data &= ( bit_mask >> 1 );

}parity_error = false;

if( msettings->mparity != analyzerenums::none )

else

}else  //if( msettings->mparity == analyzerenums::odd )

else

}marker_location += mparitybitoffset;

mresults->addmarker( marker_location, analyzerresults::square, msettings->minputchannel );

}//now we must dermine if there is a framing error.

framing_error = false;

mserial->advance( mstartofstopbitoffset );

if( mserial->getbitstate() != mbithigh )

else

if( framing_error == true )

}//ok now record the value!

//note that we're not using the mdata2 or mtype fields for anything, so we won't bother to set them.

frame frame;

frame.mstartingsampleinclusive = frame_starting_sample;

frame.mendingsampleinclusive = mserial->getsamplenumber();

frame.mdata1 = data;

frame.mflags = 0;

if( parity_error == true )

frame.mflags |= parity_error_flag | display_as_error_flag;

if( framing_error == true )

frame.mflags |= framing_error_flag | display_as_error_flag;

if( mp_is_address == true )

frame.mflags |= mp_mode_address_flag;

if( mp_is_address == true )

mresults->commitpacketandstartnewpacket();

mresults->addframe( frame );

mresults->commitresults();

reportprogress( frame.mendingsampleinclusive );

checkifthreadshouldexit();

if( framing_error == true )  //if we're still low, let's fix that for the next round.

}debug_out_to_file_exit();

}bool serialanalyzer::needsrerun()

u32 specified_bit_rate = msettings->mbitrate;

double error = double( analyzerhelpers::diff32( computed_bit_rate, specified_bit_rate ) ) / double( specified_bit_rate );

if( error > 0.1 )

else

}u32 serialanalyzer::generatesimulationdata( u64 minimum_sample_index, u32 device_sample_rate, simulationchanneldescriptor** simulation_channels )

return msimulationdatagenerator.generatesimulationdata( minimum_sample_index, device_sample_rate, simulation_channels );

}u32 serialanalyzer::getminimumsampleratehz()

const char* serialanalyzer::getanalyzername() const

const char* getanalyzername()

analyzer* createanalyzer()

void destroyanalyzer( analyzer* analyzer )

linux 調優 修改檔案最大控制代碼數

在linux伺服器調優時,經常需要調優linux引數,以下是針對控制代碼數調優的相關說明 首先檢視下系統的控制代碼是多少,用ulimit a 命令檢視 root hu wen ulimit a core file size blocks,c 0 data seg size kbytes,d unli...

ORACLE資料庫DMP檔案,調OGG

oralce匯出dmp普通方法,除錯ogg 1.檢視scn號 select to char current scn from v database 2.源端匯出dmp 查詢資料幫浦 select from dba directories expdp 使用者名稱 密碼 directory 查詢出的資料...

Linux環境崩潰生成core檔案以及除錯

步驟很詳細具體,很有幫助,所以 windows環境崩潰問題可根據vs除錯工具檢視,linux同樣可以檢視呼叫堆疊的資訊,只是 需要更改linux設定,使程式崩潰時候產生core檔案。然後gdb除錯即可。1產生core檔案方法 產生coredump的條件,首先需要確認當前會話的ulimit c,若為0...