MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / FindTryItem

Method FindTryItem

Bcore/src/main/cpp/dex/dex_file.cc:489–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487}
488
489int32_t DexFile::FindTryItem(const TryItem* try_items, uint32_t tries_size, uint32_t address) {
490 uint32_t min = 0;
491 uint32_t max = tries_size;
492 while (min < max) {
493 const uint32_t mid = (min + max) / 2;
494
495 const art_lkchan::DexFile::TryItem& ti = try_items[mid];
496 const uint32_t start = ti.start_addr_;
497 const uint32_t end = start + ti.insn_count_;
498
499 if (address < start) {
500 max = mid;
501 } else if (address >= end) {
502 min = mid + 1;
503 } else { // We have a winner!
504 return mid;
505 }
506 }
507 // No match.
508 return -1;
509}
510
511bool DexFile::LineNumForPcCb(void* raw_context, const PositionInfo& entry) {
512 LineNumFromPcContext* context = reinterpret_cast<LineNumFromPcContext*>(raw_context);

Callers 1

CatchHandlerIteratorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected