from Hacker News

Print is your best debugging tool

by Hamatti on 6/8/22, 11:14 AM with 4 comments

  • by Bostonian on 6/8/22, 11:49 AM

    You can add a line of code to print a few variables, but it may be easier to add a breakpoint at the same place and use the "info locals" and "info args" commands of gdb to display local variables and arguments.

    When do people use print statements vs. gdb? I use print statements out of inertia but wonder if I should gdb more.

  • by pseingatl on 6/8/22, 12:02 PM

    How would you use this for LaTeX?