Is there is any way to switch to assembly when debugging a C or C++ program in gdb ? (Given that all source files and their corresponding assembly files are available)
Using the disas command will probably do what you want.
According to the internal help, the disas command does the following:
Disassemble a specified section of memory.
Default is the function surrounding the pc of the selected frame.
With a single argument, the function surrounding that address is dumped.
Two arguments are taken as a range of memory to dump.