C ++ main debugging question

Do I need to learn assembly language so that I can optimally use the debugger? I noticed that during debugging sessions I see these crypto codes and processor registers ... (eax ... blah blah). I suppose this is a meeting, and I must somehow decipher the cause of the problem from it.

Is there a shortcut to understanding the debugger without learning assembly language?

PS: I saw the assembly book, which was almost 1000 pages, and I donโ€™t have a stomach to go through it. Please, help.
Edited: **** I am using codeBlocks ide. But I think the question still stands even for MSVC ++

+4
source share
8 answers

Although some ASM knowledge can sometimes come in handy when debugging, the more valuable thing is probably in your case to get the debugging symbols on the right .

In the case of gcc, pass the -g flag to it. In the case of the Visual Studio compiler, enable the generation of debugging symbols (yes, even for release versions) in the project settings. If you are using a different compiler, read its documentation on this subject.

Last but not least, if you're working on Windows, consider loading debugging symbols for your binaries, as this can make your life a lot easier. Find it here: microsoft website

+11
source

It seems that the management has moved to a library whose source you do not have or was not created with debugging information.

At the very least, getting to know your machine architecture and assembly language can help, but you don't have to use a good debugger.

+5
source

Yes. For optimal debugging, you should understand the assembly, which is nothing more than the language the processor speaks.

This is not scary. Programming languages โ€‹โ€‹are not simplified than assembly.

+2
source

You do not have to be an expert in assembly, but I would say that understanding assembly code is important for debugging. Find a โ€œenough to go throughโ€ study guide, like this one .

+2
source

Visual Studio on Windows or the Data Debugger on Unix will do a very decent job of compiling with debugging symbols and allow you to step through your C ++ code without assembly knowledge. Being familiar with machine architecture at hand, a basic understanding of asm syntax and building a C ++ map on this will lead you even more.

+1
source

You do not need to understand assembler for effective debugging. The only time you really need to worry about assembly code is an optimization problem, but even then you are better off working with high-level code than trying to code a more efficient assembly procedure.

0
source

What is your platform? VS2010 will greatly improve the debugging process.

0
source

C ++ does not require metadata storage applications to facilitate debugging. And if such metadata cannot be found, the debugger does not have much difficulty working. All he sees is the machine code that runs, so he should back off, showing you a simple assembler code.

However, compilers can usually create debugging information that the debugger can use. They basically tell the compiler what the source code looks like (or where to look for the source files), and what instructions match the lines of source code, allowing you to debug the actual C ++ code you wrote.

You did not specify which compiler or debugger you are using, so I cannot tell you how to use this in your particular case.

In GCC, you should compile with -g , as far as I remember, in order to generate debugging information for using GDB.

In Visual Studio, it should work only in most cases (although I believe that if you start an "Empty C ++ project", you should include debugging information yourself in the project properties)

0
source

All Articles