Skip to main content
SMoor.6
Associate
May 7, 2022
Solved

How do I get GDB debug output to a file?

  • May 7, 2022
  • 2 replies
  • 3926 views

I'm debugging a problem on the target. The data I want to examine is in an array and can be easily seen in the Debugger console using "print output_data". I'd like this in a file to facilitate further host processing. When using gdb standalone I can do this with "set logging file my_log.txt" but this doesn't appear to work with GDB within STM32CubeIDE. I'm having to resort to copy and paste which works but is a bit tedious.

This topic has been closed for replies.
Best answer by KnarfB

add a command

set logging on

to make logging to the file active.

hth

KnarfB

2 replies

KnarfB
KnarfBBest answer
Super User
May 7, 2022

add a command

set logging on

to make logging to the file active.

hth

KnarfB

SMoor.6
SMoor.6Author
Associate
May 8, 2022

Thank you. That works. I'd assumed that setting the log file name turned logging on.

Just to be clear for anyone else...

set logging file my_log.txt

set logging on

.

.

set logging off