With the latest version of gdb (version 7 and above), one can easily map the source code and the assembly listing. The /m switch when used with the disassemble command gives the assembly listing along with the source code when available.
(gdb) help disassemble
Disassemble a specified section of memory.
Default is [...] Continue Reading…
Debugging Tip – Use gdb To Map Assembly With Source Code
gdb – Assembly Language Debugging 101
This article introduces the basic commands required to debug assembly language in gdb.
Note: If you would like to understand an assembly language listing, jump to this article first.
Disassemble
The disassemble command provides the assembly language listing of a program and works even when a program is not running. The command works [...] Continue Reading…
Tips For Investigating Performance Issues
Performance and profiling do go together but it helps to execute a few steps and to setup some processes in a development cycle that quickly and accurately help in narrowing down the source of the problem. [...] Continue Reading…
Debugging – Modifying Code At Runtime
Introduction
The build and debug cycle can be tedious especially when you are unsure whether the change you have in mind solves your problem or not. Sometimes it is good to be able to tweak the logic of your code during a debugging session. This article explains how [...] Continue Reading…
Assembly And The Art Of Debugging
Debugging in assembly is not an optional skill to have. Every developer encounters a situation where there is no other alternative other than cracking open the assembly code. Here are a few reasons why a developer should get their hands dirty with this skill – [...] Continue Reading…
Cross-platform Debugging Cheat Sheet
If you work on multiple platforms and use different debuggers, you are expected to know the debugger’s user interfaces well enough. At times this gets confusing especially if you have one primary platform and you work on other platforms rather infrequently.
I have compiled a list of my favorite [...] Continue Reading…
Debugging – Types Of Data Breakpoints In GDB
Data breakpoints are now becoming a part of common breakpoint vocabulary. They help in detecting heap corruption, inadvertent data overwrites and writing past buffer boundaries.
Most programmer’s restrict the definition of data breakpoints to breakpoints that help halting the execution of code in the debugger when memory is written [...] Continue Reading…
Software Breakpoints
It is very useful to be able to break execution of code at a line number of your choice. Breakpoints are provided in debuggers to do exactly that. It is fun getting to the root of the problem by setting breakpoints in a debug session. It is even more fun to know how do breakpoints work in the first place. [...] Continue Reading…
Profiling with procexp (process explorer)
While running your program in memory intensive workflows, you may often run into a situation where the low memory condition starts to thrash the system. Such a program usually exhibits a performance problem as it has consumed most of its available virtual memory. Developers often use their favorite profilers [...] Continue Reading…
strace Those Crashes On Linux
strace is a great tool on Linux that every developer should be aware of. It helps trace system APIs – the APIs used, parameters passed and the error value returned. It does not require root permissions to run. You can generate a system call trace on a command that [...] Continue Reading…