GDB is getting slower over time

When debugging with GDB during one debugging session over time, it becomes slower and slower. Even the simplest operations, such as switching and switching for a few seconds, can take several seconds, and sometimes minutes.

I debugged a rather large project (Chromium browser). The only reason I could think of is because gdb is getting slower over time, because it loads more and more characters, and it takes longer to work. However, Chromium compiles all the code into one huge executable file that contains all the characters that must be loaded at the very beginning. Thus, the character database will not grow during debugging. Also, why do you need to search for characters just to complete a step or take effect?

During testing, I tried using gdb with interfaces (Eclipse, QtCreator, Emacs) and from the command line to make sure that this is not an IDE problem. Both use cases demonstrate the same problem, however it seems to start appearing earlier in the IDE (probably because the IDE also loads characters to view the clock, call stack, list of threads, etc.).

Why is GDB getting slower? Is it a design error, a mistake, or some specific problem on my computer? Are there any free alternatives to GDB that are faster?

+4
source share
1 answer

Why is GDB getting slower?

This is mistake. Try the new version of GDB (preferably the current CVS snapshot). If the problem still exists, report this to GDB bugzilla with instructions for reproducing it.

all characters that should be loaded at the very beginning.

GDB loads partial characters ( psymbols ) at startup and reads more on demand, so some growth is expected.

why do you need to search for symbols only in order to complete a step or go to

In order to jump or jump, GDB probably needs string tables for the current translation unit (TU). If your step-by-step operation leads you to a new TU, then new lines will need to be loaded.

However, it should not take GDB anywhere around minutes before step or next .

+3
source

Source: https://habr.com/ru/post/1386033/


All Articles