Appendix B. Advanced debugging

简介: We never debug our code, because we don't put bugs破坏正常运转能力的问题或者缺陷 in. Okay, you want some real stuff.

We never debug our code, because we don't put bugs破坏正常运转能力的问题或者缺陷 in. Okay, you want some real stuff. Sam still uses printf() to find out where it crashes崩溃. For real programmers, here is a summary wps_clip_image1 of what you can do if you have problems.

Where does it crash ?

The best way to know that is to use gdb. You can start using it with good chances by configuring with --enable-debug . It will add -g to the compiler CFLAGS, and activatewps_clip_image2 some additional safety checks. Just run gdb vlc, type run myfile.vob, and wait until it crashes. You can view where it stopped with bt, and print variables with print .

If you run into troubles, you may want to turn the optimizationswps_clip_image3wps_clip_image4 off. Optimizations (especially inline functions) may confuse混淆 the debugger(调试器). Use --disable-optimizations in that casewps_clip_image5.

Other problems

It may be more complicatedwps_clip_image6 than that, for instance unpredictablewps_clip_image7 behaviour, random bug or performance issue. You have several options to deal with this. If you experience unpredictable behaviour, I hope you don't have a heap or stack corruptionwps_clip_image8 (eg. writing in an unallocated space), because they are hard to find. If you are really desperatewps_clip_image9, have a look at something like ElectricFence障碍 or dmalloc. Under GNU/Linux, an easy check is to type export MALLOC_CHECK_=2 before launching vlc (see malloc(3) for more information).

VLC offerswps_clip_image10 a "trace-mode". It can create a log file with very accurate dates and messages of what it does, so it is useful to detect performance issues or lock-ups. Compile with --enable-trace and tune the TRACE_* flags in include/config.h to enable certain某些 types of messages (log file writing can take up(占用) a lot of time, and will have side effects).

Prev

Next

Appendix A.  Ports 

Home

Appendix C.  Project history

相关文章
|
5月前
Usage Notes for Advanced Redo Transport Settings
Usage Notes for Advanced Redo Transport Settings
28 3
PAT (Advanced Level) Practice:1~3题
​ ✨欢迎您的订阅✨ PAT乙级专栏(更新完毕): 👉🏻【Basic Level】👈🏻 PAT甲级专栏(更新ing): 👉🏻【Advanced Level】👈🏻 ​
PAT (Advanced Level) Practice:1~3题
PAT (Advanced Level) Practice - 1022 Digital Library(30 分)
PAT (Advanced Level) Practice - 1022 Digital Library(30 分)
125 0
|
SQL 编译器 API
Efficiently Compiling Efficient Query Plans for Modern Hardware 论文解读
这应该是SQL查询编译的一篇经典文章了,作者是著名的Thomas Neumann,主要讲解了TUM的HyPer数据库中对于CodeGen的应用。 在morsel-driven那篇paper 中,介绍了HyPer的整个执行框架,会以task为单位处理一个morsel的数据,而执行的处理逻辑(一个pipeline job)就被编译为一个函数。这篇paper则具体讲如何实现动态编译。
452 0
Efficiently Compiling Efficient Query Plans for Modern Hardware 论文解读
|
JavaScript 内存技术 前端开发