MCPcopy Create free account
hub / github.com/Inori/GPCS4 / ShouldInstrumentIndirect

Method ShouldInstrumentIndirect

3rdParty/tinydbr/tinydbr.cpp:578–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578TinyDBR::IndirectInstrumentation TinyDBR::ShouldInstrumentIndirect(
579 ModuleInfo* module,
580 Instruction& inst,
581 size_t instruction_address)
582{
583
584 if (inst.iclass == InstructionClass::RET)
585 {
586 if (!patch_return_addresses)
587 {
588 return II_NONE;
589 }
590 }
591 else
592 {
593 if ((inst.iclass != InstructionClass::IJUMP) &&
594 (inst.iclass != InstructionClass::ICALL))
595 return II_NONE;
596 }
597
598 if (indirect_instrumentation_mode != II_AUTO)
599 {
600 return indirect_instrumentation_mode;
601 }
602 else
603 {
604 // default to the most performant mode which is II_GLOBAL
605#ifdef ARM64
606 return II_LOCAL;
607#else
608 return II_GLOBAL;
609#endif
610 }
611}
612
613// when an invalid instruction is encountered
614// emit a breakpoint followed by crashing the process

Callers 1

HandleBasicBlockEndMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected