diff --git a/interfaces/innerkits/unwinder/unwinder.cpp b/interfaces/innerkits/unwinder/unwinder.cpp index b603d213749abdf8595df6b4f1e332635d4a4651..3abf2c683886be1d93a987ec0d79b5b2d0ded0b6 100644 --- a/interfaces/innerkits/unwinder/unwinder.cpp +++ b/interfaces/innerkits/unwinder/unwinder.cpp @@ -567,7 +567,7 @@ bool Unwinder::Impl::UnwindLocalWithTid(const pid_t tid, size_t maxFrameNum, siz #if defined(__aarch64__) if (threadContext != nullptr && threadContext->frameSz > 0) { pcs_.clear(); - for (size_t i = 0; i < threadContext->frameSz; i++) { + for (size_t i = skipFrameNum; i < threadContext->frameSz && i < skipFrameNum + maxFrameNum; i++) { pcs_.emplace_back(threadContext->pcs[i]); } firstFrameSp_ = threadContext->firstFrameSp;