LLDB中如何列出多行代码代码
How to list more lines of code code in LLDB
如何让 LLDB 列出当前帧中的更多代码行。默认情况下它只执行 7。这是我目前能做的最好的:
(lldb) f
frame #9: 0x000000010001fce0 DualIssueInstructionSchedulerTest`void std::__1::random_shuffle<std::__1::__wrap_iter<exchange::ExchangeMessage*>, ExchangeWithLotsOfMessages::test_method()::$_5&>(__first=__wrap_iter<exchange::ExchangeMessage *> @ 0x00007ffeefbf5298, __last=__wrap_iter<exchange::ExchangeMessage *> @ 0x00007ffeefbf5290, __rand=0x00007ffeefbf56e0)::$_5&&&) at algorithm:3203
3200 for (--__last; __first < __last; ++__first, --__d)
3201 {
3202 difference_type __i = __rand(__d);
-> 3203 swap(*__first, *(__first + __i));
3204 }
3205 }
3206 }
(lldb) l 3100
3100 result_type max() const {return b();}
3101
3102 friend bool operator==(const uniform_int_distribution& __x,
3103 const uniform_int_distribution& __y)
3104 {return __x.__p_ == __y.__p_;}
3105 friend bool operator!=(const uniform_int_distribution& __x,
3106 const uniform_int_distribution& __y)
3107 {return !(__x == __y);}
3108 };
3109
(lldb) l
3110 template<class _IntType>
3111 template<class _URNG>
3112 typename uniform_int_distribution<_IntType>::result_type
3113 uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p)
3114 {
3115 typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t),
3116 uint32_t, uint64_t>::type _UIntType;
3117 const _UIntType _Rp = __p.b() - __p.a() + _UIntType(1);
3118 if (_Rp == 1)
3119 return __p.a();
(lldb) l
3120 const size_t _Dt = numeric_limits<_UIntType>::digits;
3121 typedef __independent_bits_engine<_URNG, _UIntType> _Eng;
3122 if (_Rp == 0)
3123 return static_cast<result_type>(_Eng(__g, _Dt)());
3124 size_t __w = _Dt - __clz(_Rp) - 1;
3125 if ((_Rp & (std::numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)
3126 ++__w;
3127 _Eng __e(__g, __w);
3128 _UIntType __u;
3129 do
(lldb) l
3130 {
3131 __u = __e();
3132 } while (__u >= _Rp);
3133 return static_cast<result_type>(__u + __p.a());
3134 }
3135
3136 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
3137 || defined(_LIBCPP_BUILDING_LIBRARY)
3138 class _LIBCPP_TYPE_VIS __rs_default;
3139
有没有办法增加 f
的上下文或减少 范围 行到 l
?
如果您只想扩大 window 一个来源列表,请执行:
(lldb) source list -c 40 -l 3100
然后只需点击 return(自动重复命令)将继续此计数。
还有两个 lldb 设置控制打印多少源的默认值:
(lldb) help settings set
...
stop-line-count-after -- The number of sources lines to display that come after the current source line when displaying a stopped context.
stop-line-count-before -- The number of sources lines to display that come before the current source line when displaying a stopped context.
如果您正在查看停止列表,"current source line" 是 pc,如果您正在使用该命令,则 "list" 是您传递给 "list" 的源代码行。
重复调用 "l"(或只需按自动重复)将只打印两个行数的总和。所以你会输入:
settings set stop-line-count-before 10
settings set stop-line-count-after 10
或您在 ~/.lldbinit
中喜欢的任何数字来更改此行为。
如何让 LLDB 列出当前帧中的更多代码行。默认情况下它只执行 7。这是我目前能做的最好的:
(lldb) f
frame #9: 0x000000010001fce0 DualIssueInstructionSchedulerTest`void std::__1::random_shuffle<std::__1::__wrap_iter<exchange::ExchangeMessage*>, ExchangeWithLotsOfMessages::test_method()::$_5&>(__first=__wrap_iter<exchange::ExchangeMessage *> @ 0x00007ffeefbf5298, __last=__wrap_iter<exchange::ExchangeMessage *> @ 0x00007ffeefbf5290, __rand=0x00007ffeefbf56e0)::$_5&&&) at algorithm:3203
3200 for (--__last; __first < __last; ++__first, --__d)
3201 {
3202 difference_type __i = __rand(__d);
-> 3203 swap(*__first, *(__first + __i));
3204 }
3205 }
3206 }
(lldb) l 3100
3100 result_type max() const {return b();}
3101
3102 friend bool operator==(const uniform_int_distribution& __x,
3103 const uniform_int_distribution& __y)
3104 {return __x.__p_ == __y.__p_;}
3105 friend bool operator!=(const uniform_int_distribution& __x,
3106 const uniform_int_distribution& __y)
3107 {return !(__x == __y);}
3108 };
3109
(lldb) l
3110 template<class _IntType>
3111 template<class _URNG>
3112 typename uniform_int_distribution<_IntType>::result_type
3113 uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p)
3114 {
3115 typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t),
3116 uint32_t, uint64_t>::type _UIntType;
3117 const _UIntType _Rp = __p.b() - __p.a() + _UIntType(1);
3118 if (_Rp == 1)
3119 return __p.a();
(lldb) l
3120 const size_t _Dt = numeric_limits<_UIntType>::digits;
3121 typedef __independent_bits_engine<_URNG, _UIntType> _Eng;
3122 if (_Rp == 0)
3123 return static_cast<result_type>(_Eng(__g, _Dt)());
3124 size_t __w = _Dt - __clz(_Rp) - 1;
3125 if ((_Rp & (std::numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)
3126 ++__w;
3127 _Eng __e(__g, __w);
3128 _UIntType __u;
3129 do
(lldb) l
3130 {
3131 __u = __e();
3132 } while (__u >= _Rp);
3133 return static_cast<result_type>(__u + __p.a());
3134 }
3135
3136 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
3137 || defined(_LIBCPP_BUILDING_LIBRARY)
3138 class _LIBCPP_TYPE_VIS __rs_default;
3139
有没有办法增加 f
的上下文或减少 范围 行到 l
?
如果您只想扩大 window 一个来源列表,请执行:
(lldb) source list -c 40 -l 3100
然后只需点击 return(自动重复命令)将继续此计数。
还有两个 lldb 设置控制打印多少源的默认值:
(lldb) help settings set
...
stop-line-count-after -- The number of sources lines to display that come after the current source line when displaying a stopped context.
stop-line-count-before -- The number of sources lines to display that come before the current source line when displaying a stopped context.
如果您正在查看停止列表,"current source line" 是 pc,如果您正在使用该命令,则 "list" 是您传递给 "list" 的源代码行。
重复调用 "l"(或只需按自动重复)将只打印两个行数的总和。所以你会输入:
settings set stop-line-count-before 10
settings set stop-line-count-after 10
或您在 ~/.lldbinit
中喜欢的任何数字来更改此行为。