Menu

macos_debug_howto Log in to Edit

Debugging fldigi, flrig, etc. on OS-X / macOS

After building fldigi, flrig, flmsg, etc. from source you may find it necessary to run from the Xcode debugger, lldb. Each of the code snippets assumes that you are in the top level source directory for the application, for example: /Users/dave/dev/fldigi-4.0.15/

fldigi:
If you already have a fldigi files folder, create a duplicate in the current working directory, pwd.

$ cp -r ~/.fldigi fldigi.test
$ ./configure && make
$ lldb src/fldigi
(lldb) process handle SIGUSR2 -n false -p true -s false
(lldb)run --config-dir fldigi.test

flrig:

$ cp -r ~/.flrig flrig.test
$ ./configure && make
$ lldb src/flrig
(lldb) process handle SIGUSR2 -n false -p true -s false
(lldb) run --config-dir flrig.test

flmsg:

$ cp -r ~/.nbems flmsg.test
$ ./configure && make
$ lldb src/flmsg
(lldb) process handle SIGUSR2 -n false -p true -s false
(lldb) run --flmsg-dir flmsg.test

You will be returned to the lldb prompt if a segmentation fault occurs during testing. You can determine the fault location and the code path to the fault using the lldb back trace command:

(lldb) bt

You can force an interrupt in the target program by issuing a control-C from the terminal window that is running lldb. This may be useful if the program enters a loop in a thread that interferes with the general program flow. The back trace command will indicate where the program was interrupted.

Quit lldb with the 'q'uit command

(lldb) q

Related

Wiki: build_howto

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.