Skip to content

How to debug program when there's a TUI? #639

Answered by gyscos
Squirrelcoding asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

To debug, you have a few main options:

  • Debug from inside the application itself. This means print messages to a popup layer or something. You can also use cursive's own basic debug console, or flexi logger, a third-party library with much more features.
  • You can debug the application in gdb or similar debuggers like you would a non-TUI application. You can then set breakpoints and debug the logic step by step, looking at the values or variables, ...
  • You can redirect the standard error stream to a file, and check this file from a separate terminal. To do that, you would do something like cargo run 2> error_file.txt, and tail -F error_file.txt in another terminal.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Squirrelcoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants