GDB: How do I set current source file for list and break commands
People who start using GDB after GUI debuggers often ask this question in the title. It is not obvious from the documentation and it is not googled easily either. So the trick I use is to specify a function that I want to debug like this.
list GetName
I can type Get and press tab. GDB suggests names. The command above will set the source file with GetName as its current source file.
If I don’t know the function name, I can specify the file name and line number directly.
list document.cpp:1
This is what most people look for. Then list command will output document.cpp and break 10 will set a breakpoint in document.cpp.
-
Recent
- OpenGL hardware acceleration through remote X11 SSH connection
- GDB: How do I set current source file for list and break commands
- How To Create and Seed a Torrent (Ubuntu server, Transmission)
- GIT TF: Undo shallow pull and pull squashed changeset
- Lynx on Windows 7 and lynx_bookmarks.html file problem
- Old MacBook Overheating and Installation of Mac OS 10.4 on New Hard Drives
- Memory Alignment Of Structures and Classes in C++
- Align label and input vertically
- Google Test Framework and Visual Studio 2010
- Convex Hull
- Run a bash script with sudo, nohup and in the background
- Contact database with web interface – EVPO Members
-
Links
-
Archives
- March 2017 (1)
- May 2015 (1)
- January 2015 (1)
- November 2014 (1)
- October 2014 (1)
- March 2014 (1)
- January 2014 (1)
- June 2013 (1)
- May 2013 (2)
- February 2012 (2)
- October 2010 (1)
- February 2010 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS