英文:
GDB crashes trying to display pretty-printed std::vector
问题
如何在逐步进入函数并进行GDB漂亮打印时避免GDB崩溃或挂起,例如STL向量,该向量未被跨越以进行初始化。
例如,漂亮地打印未在函数中初始化的向量可能显示数百万个元素,但由于向量内部的未初始化值,尚未越过。当我越过该行时,向量保持0个元素。
有没有办法避免这种情况?
英文:
how to avoid GDB crashing or hanging when entering a function step by step and GDB pretty printing for example STL vector which has not been stepped over to be initialized.
For example pretty printing a vector that is not initialized in function can show over millions of elements, but that due to uninitialized value inside a vector, which hasn't been stepped over. Immediately when i step over line the vector holds 0 elements.
Any way to avoid this?
答案1
得分: 0
The best way to avoid this is by not displaying contents of a vector
until it has been initialized.
If you are doing it via display
GDB command, don't.
If this is happening because your GUI does it, don't use that GUI.
英文:
> Any way to avoid this?
The best way to avoid this is by not displaying contents of a vector
until it has been initialized.
If you are doing it via display
GDB command, don't.
If this is happening because your GUI does it, don't use that GUI.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论