Debugging

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Notes on C++ tools

Coding Efficiently
• While the goal is to write perfect, bug-free code, on the first try, this
sometimes does not happten.
• Test-driven development: Write tests first!
• https://github.com/google/googletest
• Start with the primer:
https://github.com/google/googletest/blob/master/googletest/docs/Primer.
md
• Debugging …
Two main debuggers
CS Linux boxes
• GDB: works with the gcc ecosystem
• http://sourceware.org/gdb/current/onlinedocs/gdb/ have gcc/g++

• LLDB: works with the clang ecosystem


• https://lldb.llvm.org/tutorial.html
• https://lldb.llvm.org/lldb-gdb.html
Example used in class
• Used quicksort code from
https://gsamaras.wordpress.com/code/quicksort-c/

• Compile: g++ -g -o qksort qksort.cpp


(note the use of –g to generate debug symbols)

• Run the debugger using: gdb qksort

• Search for ”GDB cheat sheet” on the web. Several nice summaries.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy