mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-2586 Exceptions for injection error conditions
This commit is contained in:
parent
dc927fc7be
commit
e996440c77
9 changed files with 240 additions and 206 deletions
|
@ -1154,6 +1154,8 @@ void FlowInfo::doInjection(InjectPayload *payload,InjectContext &icontext,PcodeO
|
|||
|
||||
bool startbasic = op->isBlockStart();
|
||||
++iter; // Now points to first op in the injection
|
||||
if (iter == obank.endDead())
|
||||
throw LowlevelError("Empty injection: " + payload->getName());
|
||||
PcodeOp *firstop = *iter;
|
||||
bool isfallthru = true;
|
||||
PcodeOp *lastop = xrefControlFlow(iter,startbasic,isfallthru,fc);
|
||||
|
|
|
@ -51,13 +51,13 @@ void InjectPayloadGhidra::inject(InjectContext &con,PcodeEmit &emit) const
|
|||
PackedDecode decoder(ghidra);
|
||||
try {
|
||||
if (!ghidra->getPcodeInject(name,type,con,decoder))
|
||||
throw LowlevelError("Could not retrieve pcode snippet: "+name);
|
||||
throw LowlevelError("Could not retrieve injection: "+name);
|
||||
}
|
||||
catch(JavaError &err) {
|
||||
throw LowlevelError("Error getting pcode snippet: " + err.explain);
|
||||
throw LowlevelError("Injection error: " + err.explain);
|
||||
}
|
||||
catch(DecoderError &err) {
|
||||
throw LowlevelError("Error in pcode snippet xml: "+err.explain);
|
||||
throw LowlevelError("Error decoding injection: "+err.explain);
|
||||
}
|
||||
uint4 elemId = decoder.openElement();
|
||||
Address addr = Address::decode(decoder);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue