$ gdb d_ifelse GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from d_ifelse...done. (gdb) b main Breakpoint 1 at 0x728: file ifelse.cpp, line 4. (gdb) r Starting program: /home/stu/jreyes/cs4510/lab3/d_ifelse Breakpoint 1, main () at ifelse.cpp:4 4 int var = 2; (gdb) info registers rax 0x555555554720 93824992233248 rbx 0x0 0 rcx 0xa0 160 rdx 0x7fffffffe568 140737488348520 rsi 0x7fffffffe558 140737488348504 rdi 0x1 1 rbp 0x7fffffffe470 0x7fffffffe470 rsp 0x7fffffffe460 0x7fffffffe460 r8 0x5555555547d0 93824992233424 r9 0x7ffff7de8c60 140737351945312 r10 0x7ffff7536b58 140737342827352 r11 0x0 0 r12 0x5555555545f0 93824992232944 r13 0x7fffffffe550 140737488348496 r14 0x0 0 r15 0x0 0 rip 0x555555554728 0x555555554728 eflags 0x206 [ PF IF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 (gdb) disassemble Dump of assembler code for function main(): 0x0000555555554720 <+0>: push %rbp 0x0000555555554721 <+1>: mov %rsp,%rbp 0x0000555555554724 <+4>: sub $0x10,%rsp => 0x0000555555554728 <+8>: movl $0x2,-0x4(%rbp) 0x000055555555472f <+15>: cmpl $0x2,-0x4(%rbp) 0x0000555555554733 <+19>: jne 0x55555555474d 0x0000555555554735 <+21>: mov -0x4(%rbp),%eax 0x0000555555554738 <+24>: mov %eax,%esi 0x000055555555473a <+26>: lea 0xa3(%rip),%rdi # 0x5555555547e4 0x0000555555554741 <+33>: mov $0x0,%eax 0x0000555555554746 <+38>: callq 0x5555555545c0 0x000055555555474b <+43>: jmp 0x555555554759 0x000055555555474d <+45>: lea 0xa5(%rip),%rdi # 0x5555555547f9 0x0000555555554754 <+52>: callq 0x5555555545d0 0x0000555555554759 <+57>: mov $0x0,%eax 0x000055555555475e <+62>: leaveq 0x000055555555475f <+63>: retq End of assembler dump. (gdb) quit A debugging session is active. Inferior 1 [process 1214] will be killed. Quit anyway? (y or n) y 17:01:02  jreyes@odin  ~/cs4510/lab3  1m1s  $ gdb d_for GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from d_for...done. (gdb) b main Breakpoint 1 at 0x6d8: file for.cpp, line 4. (gdb) r Starting program: /home/stu/jreyes/cs4510/lab3/d_for Breakpoint 1, main () at for.cpp:4 4 int var = 0; (gdb) disassemble Dump of assembler code for function main(): 0x00005555555546d0 <+0>: push %rbp 0x00005555555546d1 <+1>: mov %rsp,%rbp 0x00005555555546d4 <+4>: sub $0x10,%rsp => 0x00005555555546d8 <+8>: movl $0x0,-0x8(%rbp) 0x00005555555546df <+15>: movl $0x32,-0x4(%rbp) 0x00005555555546e6 <+22>: mov -0x4(%rbp),%eax 0x00005555555546e9 <+25>: cmp -0x8(%rbp),%eax 0x00005555555546ec <+28>: jle 0x55555555470a 0x00005555555546ee <+30>: mov -0x4(%rbp),%eax 0x00005555555546f1 <+33>: mov %eax,%esi 0x00005555555546f3 <+35>: lea 0xaa(%rip),%rdi # 0x5555555547a4 0x00005555555546fa <+42>: mov $0x0,%eax 0x00005555555546ff <+47>: callq 0x555555554580 0x0000555555554704 <+52>: subl $0x1,-0x4(%rbp) 0x0000555555554708 <+56>: jmp 0x5555555546e6 0x000055555555470a <+58>: mov $0x0,%eax 0x000055555555470f <+63>: leaveq 0x0000555555554710 <+64>: retq End of assembler dump. (gdb) quit A debugging session is active. Inferior 1 [process 2376] will be killed. Quit anyway? (y or n) y 17:02:06  jreyes@odin  ~/cs4510/lab3  59s  $ gdb d_while GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from d_while...done. (gdb) b main Breakpoint 1 at 0x6d8: file while.cpp, line 4. (gdb) r Starting program: /home/stu/jreyes/cs4510/lab3/d_while Breakpoint 1, main () at while.cpp:4 4 int var = 0; (gdb) disassemble Dump of assembler code for function main(): 0x00005555555546d0 <+0>: push %rbp 0x00005555555546d1 <+1>: mov %rsp,%rbp 0x00005555555546d4 <+4>: sub $0x10,%rsp => 0x00005555555546d8 <+8>: movl $0x0,-0x4(%rbp) 0x00005555555546df <+15>: movb $0x1,-0x5(%rbp) 0x00005555555546e3 <+19>: cmpb $0x0,-0x5(%rbp) 0x00005555555546e7 <+23>: je 0x555555554705 0x00005555555546e9 <+25>: addl $0x2,-0x4(%rbp) 0x00005555555546ed <+29>: mov -0x4(%rbp),%eax 0x00005555555546f0 <+32>: mov %eax,%esi 0x00005555555546f2 <+34>: lea 0x9b(%rip),%rdi # 0x555555554794 0x00005555555546f9 <+41>: mov $0x0,%eax 0x00005555555546fe <+46>: callq 0x555555554580 0x0000555555554703 <+51>: jmp 0x5555555546e3 0x0000555555554705 <+53>: mov $0x0,%eax 0x000055555555470a <+58>: leaveq 0x000055555555470b <+59>: retq End of assembler dump. (gdb) quit A debugging session is active. Inferior 1 [process 3395] will be killed. Quit anyway? (y or n) y 17:02:39  jreyes@odin  ~/cs4510/lab3  24s  $ gdb d_void GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from d_void...done. (gdb) b main Breakpoint 1 at 0x6d4: file void.cpp, line 6. (gdb) r Starting program: /home/stu/jreyes/cs4510/lab3/d_void Breakpoint 1, main () at void.cpp:6 6 msg(); (gdb) disassemble Dump of assembler code for function main(): 0x00005555555546d0 <+0>: push %rbp 0x00005555555546d1 <+1>: mov %rsp,%rbp => 0x00005555555546d4 <+4>: callq 0x5555555546e0 0x00005555555546d9 <+9>: mov $0x0,%eax 0x00005555555546de <+14>: pop %rbp 0x00005555555546df <+15>: retq End of assembler dump. (gdb) step msg () at void.cpp:10 10 printf("This message is from the void function!\n"); (gdb) x/10i $rbp 0x7fffffffe460: jo 0x7fffffffe446 0x7fffffffe462: (bad) 0x7fffffffe463: (bad) 0x7fffffffe464: (bad) 0x7fffffffe465: jg 0x7fffffffe467 0x7fffffffe467: add %bl,%cl 0x7fffffffe469: rex.RX push %rbp 0x7fffffffe46b: push %rbp 0x7fffffffe46c: push %rbp 0x7fffffffe46d: push %rbp (gdb) print $eax $1 = 1431652048 (gdb) b msg Breakpoint 2 at 0x5555555546e4: file void.cpp, line 10. (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /home/stu/jreyes/cs4510/lab3/d_void Breakpoint 1, main () at void.cpp:6 6 msg(); (gdb) disassemble Dump of assembler code for function main(): 0x00005555555546d0 <+0>: push %rbp 0x00005555555546d1 <+1>: mov %rsp,%rbp => 0x00005555555546d4 <+4>: callq 0x5555555546e0 0x00005555555546d9 <+9>: mov $0x0,%eax 0x00005555555546de <+14>: pop %rbp 0x00005555555546df <+15>: retq End of assembler dump. (gdb) next Breakpoint 2, msg () at void.cpp:10 10 printf("This message is from the void function!\n"); (gdb) x/i 0x00005555555546d4 0x5555555546d4 : callq 0x5555555546e0 (gdb) step _IO_puts (str=0x555555554788 "This message is from the void function!") at ioputs.c:33 33 ioputs.c: No such file or directory. (gdb) step 35 in ioputs.c (gdb) step strlen () at ../sysdeps/x86_64/strlen.S:66 66 ../sysdeps/x86_64/strlen.S: No such file or directory. (gdb) step15i Undefined command: "step15i". Try "help". (gdb) c Continuing. This message is from the void function! [Inferior 1 (process 5015) exited normally] (gdb) q 17:05:32  jreyes@odin  ~/cs4510/lab3  2m48s  $ gdb return GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from return...(no debugging symbols found)...done. (gdb) b main Function "main" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) quit 17:05:59  jreyes@odin  ~/cs4510/lab3  17s  $ gdb d_return GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from d_return...done. (gdb) b main Breakpoint 1 at 0x7ba: file return.cpp, line 10. (gdb) r Starting program: /home/stu/jreyes/cs4510/lab3/d_return Breakpoint 1, main () at return.cpp:10 10 srand(time(NULL)); (gdb) disassemble Dump of assembler code for function main(): 0x00005555555547b2 <+0>: push %rbp 0x00005555555547b3 <+1>: mov %rsp,%rbp 0x00005555555547b6 <+4>: sub $0x10,%rsp => 0x00005555555547ba <+8>: mov $0x0,%edi 0x00005555555547bf <+13>: callq 0x555555554650 0x00005555555547c4 <+18>: mov %eax,%edi 0x00005555555547c6 <+20>: callq 0x555555554630 0x00005555555547cb <+25>: callq 0x555555554640 0x00005555555547d0 <+30>: mov %eax,%ecx 0x00005555555547d2 <+32>: mov $0x51eb851f,%edx 0x00005555555547d7 <+37>: mov %ecx,%eax 0x00005555555547d9 <+39>: imul %edx 0x00005555555547db <+41>: sar $0x5,%edx 0x00005555555547de <+44>: mov %ecx,%eax 0x00005555555547e0 <+46>: sar $0x1f,%eax 0x00005555555547e3 <+49>: sub %eax,%edx 0x00005555555547e5 <+51>: mov %edx,%eax 0x00005555555547e7 <+53>: imul $0x64,%eax,%eax 0x00005555555547ea <+56>: sub %eax,%ecx 0x00005555555547ec <+58>: mov %ecx,%eax 0x00005555555547ee <+60>: add $0x1,%eax 0x00005555555547f1 <+63>: mov %eax,-0x4(%rbp) 0x00005555555547f4 <+66>: mov -0x4(%rbp),%eax 0x00005555555547f7 <+69>: mov %eax,%esi 0x00005555555547f9 <+71>: lea 0xc4(%rip),%rdi # 0x5555555548c4 0x0000555555554800 <+78>: mov $0x0,%eax 0x0000555555554805 <+83>: callq 0x555555554620 0x000055555555480a <+88>: mov -0x4(%rbp),%eax 0x000055555555480d <+91>: mov %eax,%edi 0x000055555555480f <+93>: callq 0x5555555547a0 0x0000555555554814 <+98>: mov %eax,-0x8(%rbp) 0x0000555555554817 <+101>: mov -0x8(%rbp),%eax 0x000055555555481a <+104>: mov %eax,%esi 0x000055555555481c <+106>: lea 0xbb(%rip),%rdi # 0x5555555548de 0x0000555555554823 <+113>: mov $0x0,%eax 0x0000555555554828 <+118>: callq 0x555555554620 0x000055555555482d <+123>: mov $0x0,%eax 0x0000555555554832 <+128>: leaveq 0x0000555555554833 <+129>: retq End of assembler dump. (gdb) s _dl_vdso_vsym (name=name@entry=0x7ffff72ffd86 "__vdso_time", vers=vers@entry=0x7fffffffe070) at ../sysdeps/unix/sysv/linux/dl-vdso.c:27 27 ../sysdeps/unix/sysv/linux/dl-vdso.c: No such file or directory. (gdb) p count No symbol "count" in current context. (gdb) p x No symbol "x" in current context. (gdb) info registers rax 0x3ae75f6 61765110 rbx 0x555555755030 93824994332720 rcx 0x7ffff72fe2d1 140737340498641 rdx 0x0 0 rsi 0x7fffffffe070 140737488347248 rdi 0x7ffff72ffd86 140737340505478 rbp 0x7fffffffe470 0x7fffffffe470 rsp 0x7fffffffe068 0x7fffffffe068 r8 0x7ffff7ff7390 140737354101648 r9 0x7 7 r10 0x1b7 439 r11 0x7ffff719f150 140737339060560 r12 0x555555554670 93824992233072 r13 0x7fffffffe550 140737488348496 r14 0x0 0 r15 0x0 0 rip 0x7ffff72bc840 0x7ffff72bc840 <_dl_vdso_vsym> eflags 0x246 [ PF ZF IF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 (gdb) rax 0x3ae75f6 61765110 rbx 0x555555755030 93824994332720 rcx 0x7ffff72fe2d1 140737340498641 rdx 0x0 0 rsi 0x7fffffffe070 140737488347248 rdi 0x7ffff72ffd86 140737340505478 rbp 0x7fffffffe470 0x7fffffffe470 rsp 0x7fffffffe068 0x7fffffffe068 r8 0x7ffff7ff7390 140737354101648 r9 0x7 7 r10 0x1b7 439 r11 0x7ffff719f150 140737339060560 r12 0x555555554670 93824992233072 r13 0x7fffffffe550 140737488348496 r14 0x0 0 r15 0x0 0 rip 0x7ffff72bc840 0x7ffff72bc840 <_dl_vdso_vsym> eflags 0x246 [ PF ZF IF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 (gdb) s 31 in ../sysdeps/unix/sysv/linux/dl-vdso.c (gdb) 26 in ../sysdeps/unix/sysv/linux/dl-vdso.c (gdb) 41 in ../sysdeps/unix/sysv/linux/dl-vdso.c (gdb) 35 in ../sysdeps/unix/sysv/linux/dl-vdso.c (gdb) 36 in ../sysdeps/unix/sysv/linux/dl-vdso.c (gdb) 40 in ../sysdeps/unix/sysv/linux/dl-vdso.c (gdb) 39 in ../sysdeps/unix/sysv/linux/dl-vdso.c (gdb) 40 in ../sysdeps/unix/sysv/linux/dl-vdso.c (gdb) q A debugging session is active. Inferior 1 [process 6962] will be killed. Quit anyway? (y or n) y