The Linux Page

Debug a package crashing while being compiled on a PPA.

I have a CMakeLists.txt file and I run a command while building and if one of my libraries has an issue, then it will crash and it becomes close to impossible to debug unless you can run the debugger.

The fact is that I could tweak my CMakeLists.txt to run the command with gdb and get a stacktrace which helped much.

Here is the command I ran:





That's it!

With that script, instead of running my atomic-names command as is, it ran inside gdb and the result is that I get a stack trace (the "bt" command).

The options are:

-batch -- run as a batch (i.e. execute commands and then exit)

-ex run -- run the command

-ex bt -- display the stack trace

--args ... -- the command and its arguments