Pick a Free OS

User login

Navigation

Introducing Motor, Part 2: Advanced usage

editor or just Ctrl-D to close the window.

Inspecting Code

Call stack

A backtrace, a summary of how your program got to where it is, or call

stack, can be viewed with Alt-S key. It allows you to open an appropriate

part of the source code in the editor and view information about each

function call, such as parameters, file name and line number. Very

useful when you want to find out how long the way to the current

line in the source was.

Examining core dump files

Sometimes programs crash with "core dumped" message. Every time you

see this message a file named "core" is created in current directory.

Program can crash this way due to run-time problems ("segmentation

fault" is the most frequent cause) or it can be forced to dump core

and terminate with SIGQUIT (usually generated by the SysRq key), for

example. So what is core? It's a file that holds all the information

about your program before it crashed. It can be loaded then and all

the code around the line that crashed as well as the variables can be

inspected. Motor also allows you to load a core dump. All you need is

to select "Load core dump" in the "Debug" sub-menu and point it to the

'core' file. The information window will be displayed then and if

everything went ok, the point in source where the program crashed will

be highlighted. Now you can invoke a call stack viewer, etc. Note that

you're inspecting a core dump, a still image of your program state, so

no further program execution is possible.

Library Projects

All the IDEs I've seen before have had the same problem. If you

want to connect your own written library to a project and you are also

going to debug it along with your program, you had to include all the

library source files into your project. This I will say, is not a very

good way. So I decided to solve that inconvenience in Motor. With it,

you can easily add the whole library, which is built if needed, every

time you recompile a project. It can be easily removed from the project.

A Quick Example