gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 09:10:57 25 4
gpt4 key购买 nike

如何让 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 的上下文或将 range 行添加到 l

最佳答案

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

(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,如果您正在使用该命令,则传递给“list”的源代码行。

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

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

或您喜欢在 ~/.lldbinit 中的任何数字来更改此行为。

关于lldb - 如何在LLDB中列出更多行代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52274360/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com