[NetBehaviour] side effects

James Morris james at jwm-art.net
Mon Aug 29 23:38:13 CEST 2011

[sirrom at scrapyard Projects]$ head side_effects.c -n15
/*  side_effects.c (save as)
 *  (previously known as apoo.c)
 *(within terminal)
 *  gcc side_effects.c -ggdb -o side_effects
 *  gdb ./side_effects
 *(within gdb now)
 *  run
 *  backtrace
 *  quit
 *  gcc side_effects.c -ggdb -DNDEBUG side_effects
 *  ./side_effects

[sirrom at scrapyard Projects]$ gcc side_effects.c -ggdb -o side_effects
[sirrom at scrapyard Projects]$ gdb --quiet ./side_effects
Reading symbols from /home/sirrom/Projects/side_effects...done.
(gdb) start
Temporary breakpoint 1 at 0x40053c: file side_effects.c, line 44.
Starting program: /home/sirrom/Projects/side_effects 

Temporary breakpoint 1, main (argc=1, argv=0x7fffffffe618) at
side_effects.c:44 44	    assert(("i hope you know",  a =
get_apoo()) == 0 (gdb) step
get_apoo () at side_effects.c:34
34	GET_VAR_TYPE( int,      a )
main (argc=1, argv=0x7fffffffe618) at side_effects.c:46
46	    assert(("in many ways",     b = get_bpoo()) == 0
get_bpoo () at side_effects.c:35
35	GET_VAR_TYPE( float,    b )
main (argc=1, argv=0x7fffffffe618) at side_effects.c:48
48	    assert(("to noticibly",     c = get_cpoo()) == 0
get_cpoo () at side_effects.c:36
36	GET_VAR_TYPE( char,     c )
main (argc=1, argv=0x7fffffffe618) at side_effects.c:50
50	    assert(you_are_a(("a construction",
you_are_a (_n=1) at side_effects.c:38
38	int you_are_a(int _n) { return _n; }
side_effects: side_effects.c:52: main: Assertion `you_are_a(("a
construction", (a++ ^ b ^ ++c))) == 0 && "that has always"' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff7ab2725 in raise () from /lib/libc.so.6
(gdb) backtrace
#0  0x00007ffff7ab2725 in raise () from /lib/libc.so.6
#1  0x00007ffff7ab3b9b in abort () from /lib/libc.so.6
#2  0x00007ffff7aab4de in ?? () from /lib/libc.so.6
#3  0x00007ffff7aab582 in __assert_fail () from /lib/libc.so.6
#4  0x00000000004005ef in main (argc=1, argv=0x7fffffffe618) at
side_effects.c:50 (gdb) quit
A debugging session is active.

	Inferior 1 [process 4219] will be killed.

Quit anyway? (y or n) y
[sirrom at scrapyard Projects]$ gcc side_effects.c -ggdb -DNDEBUG -o
side_effects [sirrom at scrapyard Projects]$ ./side_effects 
[sirrom at scrapyard Projects]$ 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: side_effects.c
Type: text/x-csrc
Size: 1136 bytes
Desc: not available
URL: <https://lists.netbehaviour.org/pipermail/netbehaviour/attachments/20110829/736cc812/attachment.c>

More information about the NetBehaviour mailing list