日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

GDB中遍历art::Thread打印local reference的脚本

發布時間:2025/3/20 54 豆豆
生活随笔 收集整理的這篇文章主要介紹了 GDB中遍历art::Thread打印local reference的脚本 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

#打印所有線程對應的local reference

def dump_all_local_refernce
??? set $list_head = &art::Runtime::instance_.thread_list_.list_.__end_
??? set $list_node = $list_head->__next_
??? while $list_node != $list_head
??????? set $tid =? $list_node->__value_->tls32_.tid
??????? set $top_index = $list_node->__value_->tlsPtr_.jni_env->locals.segment_state_.parts.topIndex
??????? printf "tid = %d, top_index = %d\n",$tid,$top_index
??????? set $list_node = $list_node->__next_
??? end
end

?

#打印指定線程的local reference

def dump_local_refernce_by_tid
??? set $list_head = &art::Runtime::instance_.thread_list_.list_.__end_
??? set $list_node = $list_head->__next_
??? while $list_node != $list_head
??????? if? $list_node->__value_->tls32_.tid == $arg0
??????????? set $local_table =? $list_node->__value_->tlsPtr_.jni_env->locals
??????????? set $top_index = $local_table.segment_state_.parts.topIndex
??????????? p $top_index
??????????? set $index = 0
??????????? while $index < $top_index
??????????????? set $irt_entry =? $local_table.table_[$index]
??????????????? set $serial = $irt_entry.serial_
??????????????? set $obj = (unsigned int *)$irt_entry.references_[$serial].root_.reference_
??????????????? if $obj != 0
??????????????????? p /x *$obj
??????????????? else
??????????????????? p /x 0x0
??????????????? end
??????????????? set $index += 1
??????????? end
??????????? loop_break
??????? end
??????? set $list_node = $list_node->__next_
??? end

轉載于:https://www.cnblogs.com/YYPapa/p/7002040.html

總結

以上是生活随笔為你收集整理的GDB中遍历art::Thread打印local reference的脚本的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。