• gdb 查看变量~p长串末尾省略号, 一个页面显示不完


    #0  MQClientAPIImpl::getTopicRouteInfoFromNameServer (this=0x63c3e0, topic="TBW102", timeoutMillis=3000) at MQClientAPIImpl.cpp:911
    #1  0x00007ffff780106f in MQClientFactory::updateTopicRouteInfoFromNameServer (this=0x653ba0, topic="TBW102", isDefault=false, pDefaultMQProducer=0x0) at MQClientFactory.cpp:250
    #2  0x00007ffff7800e28 in MQClientFactory::updateTopicRouteInfoFromNameServer (this=0x653ba0, topic="TBW102") at MQClientFactory.cpp:203
    #3  0x00007ffff7800d62 in MQClientFactory::updateTopicRouteInfoFromNameServer (this=0x653ba0) at MQClientFactory.cpp:197
    #4  0x00007ffff7862aba in DefaultMQProducerImpl::start (this=0x6452d0, startFactory=true) at producer/DefaultMQProducerImpl.cpp:172
    #5  0x00007ffff78624bd in DefaultMQProducerImpl::start (this=0x6452d0) at producer/DefaultMQProducerImpl.cpp:114
    #6  0x00007ffff78615b5 in DefaultMQProducer::start (this=0x647f40) at producer/DefaultMQProducer.cpp:62
    #7  0x00007ffff7b4966f in dmb::CDmbClient::start (this=0x647090) at dmb_client.cpp:1091
    #8  0x00007ffff7b4248a in dmb::CDMB::start (this=0x60ee20) at dmb.cpp:111
    #9  0x0000000000404d4d in main (argc=5, argv=0x7fffffffe578) at TestSyncConsumer.cpp:133
    
    (gdb) p *request
    $7 = {static s_configVersion = 21, m_code = 105, m_language = "CPP", m_version = 21, m_opaque = 0, m_flag = 0, m_remark = "", m_pCustomHeader = 0x6443b0, m_headLen = 136, m_pHead = 0x642bb0 "", m_bodyLen = 0, m_pBody = 0x0, m_releaseBody = false, static s_seqNumber = {va
    lue = 1}}
    
    (gdb) p /x *response
    $15 = {static s_configVersion = 0x15, m_code = 0x0, m_language = "JAVA", m_version = 0x89, m_opaque = 0x0, m_flag = 0x1, m_remark = "", m_pCustomHeader = 0x0, m_headLen = 0x5f, m_pHead = 0x7fffd0001230, m_bodyLen = 0x305, m_pBody = 0x7fffd00012a0, m_releaseBody = 0x1, st
    atic s_seqNumber = {value = 0x1}}
    
    p *response
    $4 = {static s_configVersion = 21, m_code = 0, m_language = "JAVA", m_version = 137, m_opaque = 0, m_flag = 1, m_remark = "", m_pCustomHeader = 0x0, m_headLen = 95, m_pHead = 0x7fffd0001230 "{"code":0,"flag":1,"language":"JAVA","opaque":0,"serializeTypeCurrent
    RPC":"JSON","version":137}", m_bodyLen = 773, m_pBody = 0x7fffd00012a0 "{"brokerDatas":[{"brokerAddrs":{0:"115.159.82.186:6609",1:"182.254.214.239:6609"},"brokerName":"broker-a"},{"brokerAddrs":{0:"123.206.119.48:6609",1:"115.159.88.166:6609"},"br
    okerName":"broker-c"},{"b"..., m_releaseBody = true, static s_seqNumber = {value = 1}}
                                                                                                                                                                                                                                                                                   
    (gdb) whatis response->GetBody()
        type = const char *
    
    (gdb) x /9s response->GetBody()
        0x7fffd00012a0: "{"brokerDatas":[{"brokerAddrs":{0:"115.159.82.186:6609",1:"182.254.214.239:6609"},"brokerName":"broker-a"},{"brokerAddrs":{0:"123.206.119.48:6609",1:"115.159.88.166:6609"},"brokerName":"broker-c"},{"b"...
        0x7fffd0001368: "rokerAddrs":{0:"123.206.119.193:6609",1:"182.254.243.31:6609"},"brokerName":"broker-b"},{"brokerAddrs":{0:"182.254.247.99:6609",1:"115.159.92.191:6609"},"brokerName":"broker-d"}],"filterServerTable":{"...
        0x7fffd0001430: "},"queueDatas":[{"brokerName":"broker-d","perm":6,"readQueueNums":4,"topicSynFlag":0,"writeQueueNums":4},{"brokerName":"broker-c","perm":6,"readQueueNums":4,"topicSynFlag":0,"writeQueueNums":4},{"brok"...
        0x7fffd00014f8: "erName":"broker-b","perm":6,"readQueueNums":4,"topicSynFlag":0,"writeQueueNums":4},{"brokerName":"broker-a","perm":6,"readQueueNums":4,"topicSynFlag":0,"writeQueueNums":4}]}"
        0x7fffd00015a6: ""
        0x7fffd00015a7: ""
        0x7fffd00015a8: "a37201"
        0x7fffd00015ac: ""
        0x7fffd00015ad: ""

    一个页面显示不完:

    ESC进入命令模式, 按s 就可以滚动命令窗口查看了。

    cgdb里面还可以 ESC 命令模式下, Ctr+W 切换做vertical分屏。

  • 相关阅读:
    Android官方数据绑定框架DataBinding*
    Application 使用分析*
    Android HandlerThread与IntentService*
    Android中SQLite应用详解*
    Android开发中,那些让您觉得相见恨晚的方法、类或接口*
    巧用ViewPager 打造不一样的广告轮播切换效果*
    Android-Universal-Image-Loader的缓存处理机制与使用 LruCache 缓存图片*
    Android Volley完全解析*
    Android 蓝牙*
    Android自定义View
  • 原文地址:https://www.cnblogs.com/sanghai/p/6677121.html
Copyright © 2020-2023  润新知