If a source file name ends in one of the following extensions, then GDB infers that its language is the one indicated.
.ada
.ads
.adb
.a
.c
.C
.cc
.cp
.cpp
.cxx
.c++
.f
.F
.mod
.s
.S
In addition, you may set the language associated with a filename extension. See Displaying the language.