简体   繁体   中英

gdb C++ how to enable pretty-printer in a command list?

I have a break point like this:

b kuk.cpp:1803 if (v==644)
commands
p m_d.m_state[644]
end

I have noticed that the registered pretty-printers inside the command list are only:

global pretty-printers:
builtin
   mpx_bound128

Outside the command list I have:

(gdb) info pretty-printer
global pretty-printers:
  builtin
    mpx_bound128
  objfile /usr/bin/cygstdc++-6.dll pretty-printers:
  libstdc++-v6
    __gnu_cxx::_Slist_iterator
    __gnu_cxx::__7::_Slist_iterator
    __gnu_cxx::__7::__normal_iterator
    __gnu_cxx::__7::slist
    __gnu_cxx::__normal_iterator
    __gnu_cxx::slist
    __gnu_debug::_Safe_iterator
    std::_Deque_const_iterator
    std::_Deque_iterator
    std::_List_const_iterator
    std::_List_iterator
 ...
 ...

How do I enable all these pretty-printers in my command list?

As documentation says for enabling the following command can be used:

enable pretty-printer [object-regexp [name-regexp]]

but I am not sure you can enable some of them if it is not listed by info command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM