printf-debugging Questions

11

Solved

When I'm running a simple Ruby script, what's the easiest way to dump an object's fields to the console? I'm looking for something similar to PHP's print_r() that will work with arrays as well.
Fabrizio asked 9/12, 2008 at 22:55

2

I have some code #define DEBUG_PRINT(x,...) \ do \ {\ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wunused-value\"") \ __typeof__((0,x)) _x = x; \ _Pragma("GCC diagnos...

6

Solved

I'm sure it's a silly question to those who know, but I can't find an explanation of what it does or what it is. CSV.open('data.csv', 'r') do |row| p row end What does "p row" do?
Aforesaid asked 18/11, 2009 at 19:3

2

Solved

I am trying to understand a Linux kernel module and would like to see the output of pr_debug and printk. I am using GNU Make. I understand that to get pr_debug messages, we have to use DDEBUG. So...
Milamilady asked 26/2, 2011 at 11:35

19

Solved

There are many ways of doing debugging, using a debugger is one, but the simple one for the humble, lazy, programmer is to just add a bunch of print statements to your code. i.e. def foo(x...
Involucrum asked 9/10, 2008 at 23:19

11

Solved

I remember when I was in some course of C programming, a teacher once suggested that I use printf to watch the execution of a program that I was trying to debug. This program had a segmentation fau...
Arithmetic asked 24/6, 2010 at 14:9

1

Solved

in c code I frequently use printf debugging macros like #define DPRINT_INT(i) fprintf(stderr,"%s has the value %i at line %i", #i,i, __LINE__) and then i can do things like DPRINT_INT(height) wh...

3

Solved

I have a bunch of printf debug helper macros and it would be pretty cool to have to not specify the type, is there anything you can do to allow something like macro overloading in c(can be gcc spec...
Saltpeter asked 12/4, 2011 at 10:13

6

Solved

coming from the Ocaml community, I'm trying to learn a bit of Haskell. The transition goes quite well but I'm a bit confused with debugging. I used to put (lots of) "printf" in my ocaml code, to in...
Poock asked 23/8, 2010 at 10:15

7

Solved

As many young programmers do, I learned the usefulness of inserting numerous print-to-console statements of "here1," "here2," and so on at different points in code to figure out when my progr...
Pycnidium asked 10/6, 2009 at 13:7
1

© 2022 - 2024 — McMap. All rights reserved.