110 Chapter 14. Using gdb with Different Languages.f.FFortran source file.modModula-2 source file.s.SAssembler source file. This actually behaves almost like C, but gdb does not skip over functionprologues when stepping.In addition, you may set the language associated with a filename extension. Refer to Section 14.2Displaying the language.14.1.2. Setting the working languageIf you allow gdb to set the language automatically, expressions are interpreted the same way in yourdebugging session and your program.If you wish, you may set the language manually. To do this, issue the command set languagelang, where lang is the name of a language, such as c or modula-2. For a list of the supportedlanguages, type set language.Setting the language manually prevents gdb from updating the working language automatically. Thiscan lead to confusion if you try to debug a program when the working language is not the same as thesource language, when an expression is acceptable to both languages--but means different things. Forinstance, if the current source file were written in C, and gdb was parsing Modula-2, a command suchas:print a = b + cmight not have the effect you intended. In C, this means to add b and c and place the result in a. Theresult printed would be the value of a. In Modula-2, this means to compare a to the result of b+c,yielding a BOOLEAN value.14.1.3. Having gdb infer the source languageTo have gdb set the working language automatically, use set language local or set languageauto. gdb then infers the working language. That is, when your program stops in a frame (usually byencountering a breakpoint), gdb sets the working language to the language recorded for the functionin that frame. If the language for a frame is unknown (that is, if the function or block corresponding tothe frame was defined in a source file that does not have a recognized extension), the current workinglanguage is not changed, and gdb issues a warning.This may not seem necessary for most programs, which are written entirely in one source language.However, program modules and libraries written in one source language can be used by a main pro-gram written in a different source language. Using set language auto in this case frees you fromhaving to set the working language manually.