Setting (Debugging with ROCGDB)

Next: Show, Up: Languages [Contents][Index]

### 15.1 Switching Between Source Languages

There are two ways to control the working language—either have ROCGDB set it automatically, or select it manually yourself. You can use the `set language` command for either purpose. On startup, ROCGDB defaults to setting the language automatically. The working language is used to determine how expressions you type are interpreted, how values are printed, etc.

In addition to the working language, every source file that ROCGDB knows about has its own working language. For some object file formats, the compiler might indicate which language a particular source file is in. However, most of the time ROCGDB infers the language from the name of the file. The language of a source file controls whether C`++` names are demangled—this way `backtrace` can show each frame appropriately for its own language. There is no way to set the language of a source file from within ROCGDB, but you can set the language associated with a filename extension. See Displaying the Language.

This is most commonly a problem when you use a program, such as `cfront` or `f2c`, that generates C but is written in another language. In that case, make the program use `#line` directives in its C output; that way ROCGDB will know the correct language of the source code of the original program, and will display that source code, not the generated C code.

Next: Show, Up: Languages [Contents][Index]