zoukankan      html  css  js  c++  java
  • 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 ",$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

  • 相关阅读:
    [hdu-2048] 神、上帝以及老天爷
    or1200中IMMU分析(续)
    Java Applet读写client串口——终极篇
    树莓派_Linux串口编程_实现自发自收
    2014百度实习生面试题(部分)具体解释
    Leetcode
    eclipse+webservice开发实例
    现有一些开源ESB总线的比較
    《HTML5 从入门到精通--7.6.3 单元格垂直跨度——rowspan》
    百度究竟是哪国的公司
  • 原文地址:https://www.cnblogs.com/YYPapa/p/7002040.html
Copyright © 2011-2022 走看看