-Anyone know of any good basic GDB tutorials/resources?

Recommended Answers

All 6 Replies

Any? www.google.com/search?&q=GDB finds them and I didn't add the word tutorial.

That aside I rarely used GDB because I'm a bit old school which means I add debugging code to print variables at the point of failure which has worked well for me. I can't explain it but most of the time I work with another coder never knew of old school print statements. Their choice to setup GDB and more.

I find if you use a good modern IDE(Visual Studio, Visual Code, NetBeans, etc.), debugging is automatic and very easy to use

My apologizes for not being more clear on the requirement. I am seeing more of intermediate-expert level examples.
Lets say the requirement is to understand the cause of a simple SEGFAULT looking at a coredump using GDB for a beginner. Do you guys have any recommended paths to follow to reach there for a beginner?

Even I when I see a SIGFAULT as you noted would be inserting code to help me track down the line that faulted. Once I know the line that faulted I can printk or such what values are going into that line.

commented: In your opinion, What about situations when you dont have access to the source? +4

@extr3mex. Try to tell the full story. This is still a coding forum as well as a place to connect to others so if you find the author and work out a deal as to how to get it fixed.

Remember that we only know what you tell us.

@extr3mex, A good resource for learning more about gdb is the book "The Art of Debugging with GDB, DDD, and Eclipse". In this book there is a chapter (ch4), which covers how to find the location of a SEGFAULT, by dumping to the core file, loading it into GDB and examining the stack. The chapter also covers why SEGFAULTS occur and explains memory layout.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.