本文整理汇总了C++中CB函数的典型用法代码示例。如果您正苦于以下问题:C++ CB函数的具体用法?C++ CB怎么用?C++ CB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CHECK_STATE
void GdbCoreEngine::setupInferior()
{
CHECK_STATE(InferiorSetupRequested);
// Do that first, otherwise no symbols are loaded.
QFileInfo fi(m_executable);
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
postCommand("-file-exec-and-symbols \"" + path + '"', NoFlags,
CB(handleFileExecAndSymbols));
}
示例2: callback_cmd_get_secret_key
ops_parse_cb_return_t
callback_cmd_get_secret_key(const ops_parser_content_t *content_,ops_parse_cb_info_t *cbinfo)
{
ops_parser_content_union_t* content=(ops_parser_content_union_t *)&content_->content;
const ops_secret_key_t *secret;
ops_parser_content_t pc;
OPS_USED(cbinfo);
// ops_print_packet(content_);
switch(content_->tag)
{
case OPS_PARSER_CMD_GET_SECRET_KEY:
cbinfo->cryptinfo.keydata=ops_keyring_find_key_by_id(cbinfo->cryptinfo.keyring,content->get_secret_key.pk_session_key->key_id);
if (!cbinfo->cryptinfo.keydata || !ops_is_key_secret(cbinfo->cryptinfo.keydata))
return 0;
/* now get the key from the data */
secret=ops_get_secret_key_from_data(cbinfo->cryptinfo.keydata);
int tag_to_use = OPS_PARSER_CMD_GET_SK_PASSPHRASE ;
int nbtries = 0 ;
while( (!secret) && nbtries++ < 3)
{
if (!cbinfo->cryptinfo.passphrase)
{
memset(&pc,'\0',sizeof pc);
pc.content.secret_key_passphrase.passphrase=&cbinfo->cryptinfo.passphrase;
CB(cbinfo,tag_to_use,&pc);
if (!cbinfo->cryptinfo.passphrase)
{
fprintf(stderr,"can't get passphrase\n");
assert(0);
}
}
/* then it must be encrypted */
secret=ops_decrypt_secret_key_from_data(cbinfo->cryptinfo.keydata,cbinfo->cryptinfo.passphrase);
free(cbinfo->cryptinfo.passphrase) ;
cbinfo->cryptinfo.passphrase = NULL ;
tag_to_use = OPS_PARSER_CMD_GET_SK_PASSPHRASE_PREV_WAS_BAD ;
}
if(!secret)
return 0 ;
*content->get_secret_key.secret_key=secret;
break;
default:
// return callback_general(content_,cbinfo);
break;
}
return OPS_RELEASE_MEMORY;
}
示例3: QTC_ASSERT
void GdbCoreEngine::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
// Do that first, otherwise no symbols are loaded.
QFileInfo fi(m_executable);
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
postCommand("-file-exec-and-symbols \"" + path + '"',
CB(handleFileExecAndSymbols));
}
示例4: QTC_ASSERT
void PlainGdbAdapter::startInferior()
{
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
if (!startParameters().processArgs.isEmpty())
m_engine->postCommand(_("-exec-arguments ")
+ startParameters().processArgs.join(_(" ")));
QFileInfo fi(startParameters().executable);
m_engine->postCommand(_("-file-exec-and-symbols \"%1\"").arg(fi.absoluteFilePath()),
CB(handleFileExecAndSymbols));
}
示例5: QTC_ASSERT
void GdbPlainEngine::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
if (!startParameters().processArgs.isEmpty()) {
QString args = startParameters().processArgs;
postCommand("-exec-arguments " + toLocalEncoding(args));
}
postCommand("-file-exec-and-symbols \"" + execFilePath() + '"',
CB(handleFileExecAndSymbols));
}
示例6: prev_key
int prev_key(ENTRY *pe, IX_DESC *pix)
{
RECPOS address;
pci = pix;
retrieve_block(pci->level, CB(pci->level));
prev_entry(CO(pci->level));
if (CO(pci->level) == -1)
{
address = block_ptr->p0;
}
else
{
address = ENT_ADR(block_ptr, CO(pci->level))->idxptr;
}
if (address != NULLREC)
{
do
{
retrieve_block(++(pci->level), address);
address = ENT_ADR(block_ptr, last_entry())->idxptr;
} while (address != NULLREC);
}
if (CO(pci->level) == -1)
{
do
{
if(pci->level == 0)
{
first_key(pci);
return (EOIX);
}
--(pci->level);
} while (CO(pci->level) == -1);
retrieve_block(pci->level, CB(pci->level));
}
copy_entry(pe, ENT_ADR(block_ptr, CO(pci->level)));
return ( IX_OK );
}
示例7: QTC_ASSERT
void GdbPlainEngine::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
setEnvironmentVariables();
if (!runParameters().inferior.commandLineArguments.isEmpty()) {
QString args = runParameters().inferior.commandLineArguments;
runCommand({"-exec-arguments " + toLocalEncoding(args), NoFlags});
}
runCommand({"-file-exec-and-symbols \"" + execFilePath() + '"', NoFlags,
CB(handleFileExecAndSymbols)});
}
示例8: QTC_ASSERT
void CoreGdbAdapter::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
// Do that first, otherwise no symbols are loaded.
QFileInfo fi(m_executable);
const QByteArray sysroot = startParameters().sysroot.toLocal8Bit();
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
if (!sysroot.isEmpty())
m_engine->postCommand("set sysroot " + sysroot);
m_engine->postCommand("-file-exec-and-symbols \"" + path + '"',
CB(handleFileExecAndSymbols));
}
示例9: startParameters
void RemoteGdbServerAdapter::callTargetRemote()
{
//m_breakHandler->clearBreakMarkers();
// "target remote" does three things:
// (1) connects to the gdb server
// (2) starts the remote application
// (3) stops the remote application (early, e.g. in the dynamic linker)
QString channel = startParameters().remoteChannel;
m_engine->postCommand("target remote " + channel.toLatin1(),
CB(handleTargetRemote));
}
示例10: flush
static void flush(dearmour_arg_t *arg,ops_parse_cb_info_t *cbinfo)
{
ops_parser_content_t content;
if(arg->num_unarmoured == 0)
return;
content.content.unarmoured_text.data=arg->unarmoured;
content.content.unarmoured_text.length=arg->num_unarmoured;
CB(cbinfo,OPS_PTAG_CT_UNARMOURED_TEXT,&content);
arg->num_unarmoured=0;
}
示例11: retrieve_block
static void retrieve_block(int j, RECPOS r)
{
if (j == 0)
{
block_ptr = &(pci->root);
}
else
{
get_cache(r);
}
CB(j) = block_ptr->brec;
}
示例12: CB
GUI::Widget* ZScriptMainDialog::createDialog(const GUI::WidgetFactory& f)
{
GUI::Window* win=
f.window("Compile ZScript",
f.column(GUI::Contents(
sizeText=f.text(""),
f.buttonRow(GUI::Contents(
f.button("&Edit", CB(onEdit)),
f.button("&Compile", CB(onCompile))
)),
f.buttonRow(GUI::Contents(
f.button("&Import", CB(onImport)),
f.button("E&xport", CB(onExport))
)),
f.button("C&lose", CB(shutDown))
))
);
setSizeText();
return win;
}
示例13: next_key
/* get next, previous entries */
int next_key(ENTRY *pe, IX_DESC *pix)
{
RECPOS address;
if(block_ptr->bend == 0)
{
return IX_FAIL;
}
pci = pix;
retrieve_block(pci->level, CB(pci->level));
address = ENT_ADR(block_ptr, CO(pci->level))->idxptr;
while (address != NULLREC)
{
retrieve_block(++(pci->level), address);
CO(pci->level) = -1;
address = block_ptr->p0;
}
next_entry(CO(pci->level));
if (CO(pci->level) == block_ptr->bend)
{
do
{
if(pci->level == 0)
{
last_key(pci);
return (EOIX);
}
--(pci->level);
retrieve_block(pci->level, CB(pci->level));
next_entry(CO(pci->level));
} while (CO(pci->level) == block_ptr->bend);
}
copy_entry(pe, ENT_ADR(block_ptr, CO(pci->level)));
return ( IX_OK );
}
示例14: DataCopy
void Fuzzer::ExecuteCallback(const uint8_t *Data, size_t Size) {
// We copy the contents of Unit into a separate heap buffer
// so that we reliably find buffer overflows in it.
std::unique_ptr<uint8_t[]> DataCopy(new uint8_t[Size]);
memcpy(DataCopy.get(), Data, Size);
AssignTaintLabels(DataCopy.get(), Size);
CurrentUnitData = DataCopy.get();
CurrentUnitSize = Size;
int Res = CB(DataCopy.get(), Size);
(void)Res;
assert(Res == 0);
CurrentUnitData = nullptr;
CurrentUnitSize = 0;
}
示例15: QTC_ASSERT
void TermGdbAdapter::setupInferior()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
const qint64 attachedPID = m_stubProc.applicationPID();
#ifdef Q_OS_WIN
const qint64 attachedMainThreadID = m_stubProc.applicationMainThreadID();
showMessage(QString::fromLatin1("Attaching to %1 (%2)").arg(attachedPID).arg(attachedMainThreadID), LogMisc);
#else
showMessage(QString::fromLatin1("Attaching to %1").arg(attachedPID), LogMisc);
#endif
m_engine->notifyInferiorPid(attachedPID);
m_engine->postCommand("attach " + QByteArray::number(attachedPID),
CB(handleStubAttached));
}