如何在LLDB中列出更多代码行

时间:2018-09-11 10:58:53

标签: lldb

如何使LLDB在当前帧中列出更多代码行。默认情况下,它只会执行7。这是到目前为止我能做的最好的事情:

Private Sub Foo_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed

是否有一种方法可以增加(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的行的 range 范围?

1 个答案:

答案 0 :(得分:4)

如果您只想扩大一个源清单的窗口,请执行以下操作:

(lldb) source list -c 40 -l 3100

然后按回车键(以自动重复该命令)将继续执行此计数。

还有两个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.

如果您正在查看停止清单,则“当前源代码行”是pc,如果使用该命令,则是传递到“列表”的源代码行。

重复调用“ l”(或仅按一下以自动重复)将只打印两个行的总和。所以你会放:

settings set stop-line-count-before 10
settings set stop-line-count-after 10

或您希望在~/.lldbinit中使用任何数字更改此行为。