aaldeshash@odin:~/4510/lab1$ g++ -g -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ ./lab1 Enter size of array: 5 Enter 5 elements: 1 2 3 4 5 Segmentation fault (core dumped) aaldeshash@odin:~/4510/lab1$ ls -lh core -rw------- 1 aaldeshash student 480K Sep 3 05:41 core aaldeshash@odin:~/4510/lab1$ gdb lab1 core GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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 lab1...done. [New LWP 14247] Core was generated by `./lab1'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f548f6baed0 in std::istream::operator>>(int&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (gdb) bt #0 0x00007f548f6baed0 in std::istream::operator>>(int&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x0000555ba0521226 in main () at lab1.cpp:22 (gdb) frame 1 #1 0x0000555ba0521226 in main () at lab1.cpp:22 22 cin >> a[i]; (gdb) info locals i = 0 a = 0x0 size = 5 (gdb) print size $1 = 5 (gdb) quit aaldeshash@odin:~/4510/lab1$ gdb lab1 GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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 lab1...done. (gdb) break main Breakpoint 1 at 0x118d: file lab1.cpp, line 14. (gdb) break 20 Breakpoint 2 at 0x11f4: file lab1.cpp, line 20. (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x000000000000118d in main() at lab1.cpp:14 2 breakpoint keep y 0x00000000000011f4 in main() at lab1.cpp:20 (gdb) run Starting program: /home/stu/aaldeshash/4510/lab1/lab1 Breakpoint 1, main () at lab1.cpp:14 14 int *a = NULL, size = 0; (gdb) step 16 cout << "Enter size of array: "; (gdb) next 17 cin >> size; (gdb) continue Continuing. Enter size of array: 5 Breakpoint 2, main () at lab1.cpp:20 20 for(int i = 0; i < size; i++) (gdb) quit A debugging session is active. Inferior 1 [process 19619] will be killed. Quit anyway? (y or n) y aaldeshash@odin:~/4510/lab1$ g++ -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ gdb lab1 GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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 lab1...(no debugging symbols found)...done. (gdb) break main Breakpoint 1 at 0x1189 (gdb) break 22 No symbol table is loaded. Use the "file" command. (gdb) run Starting program: /home/stu/aaldeshash/4510/lab1/lab1 Breakpoint 1, 0x0000555555555189 in main () (gdb) quit A debugging session is active. Inferior 1 [process 25248] will be killed. Quit anyway? (y or n) y aaldeshash@odin:~/4510/lab1$ ./lab1 Enter size of array: 4 Enter 4 elements: 1 2 3 4 Segmentation fault (core dumped) aaldeshash@odin:~/4510/lab1$ gdb lab1 core GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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 lab1...(no debugging symbols found)...done. [New LWP 26129] Core was generated by `./lab1'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f8c23db7ed0 in std::istream::operator>>(int&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (gdb) bt #0 0x00007f8c23db7ed0 in std::istream::operator>>(int&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x0000559bffb7a226 in main () (gdb) quit aaldeshash@odin:~/4510/lab1$ g++ -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ strip lab1 aaldeshash@odin:~/4510/lab1$ file lab1 lab1: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=02b2441693aff64cd5829f70cdc3b0c6f28bee8c, stripped aaldeshash@odin:~/4510/lab1$ gdb lab1 GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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 lab1...(no debugging symbols found)...done. (gdb) break main Function "main" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) quit aaldeshash@odin:~/4510/lab1$ g++ -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ file lab1 lab1: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=02b2441693aff64cd5829f70cdc3b0c6f28bee8c, not stripped aaldeshash@odin:~/4510/lab1$ g++ -g -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ file lab1 lab1: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=0ff46551f52f4827c405d1237e087da54df8f03c, with debug_info, not stripped aaldeshash@odin:~/4510/lab1$ g++ -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ gdb lab1.cpp GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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"... "/home/stu/aaldeshash/4510/lab1/lab1.cpp": not in executable format: file format not recognized (gdb) break main No symbol table is loaded. Use the "file" command. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) quit aaldeshash@odin:~/4510/lab1$ g++ -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ ls -al total 260 drwxr-xr-x 2 aaldeshash student 4096 Sep 3 05:54 . drwxr-xr-x 3 aaldeshash student 4096 Sep 3 05:02 .. -rw------- 1 aaldeshash student 491520 Sep 3 05:49 core -rwxr-xr-x 1 aaldeshash student 17448 Sep 3 05:54 lab1 -rw-r--r-- 1 aaldeshash student 671 Apr 2 2012 lab1.cpp aaldeshash@odin:~/4510/lab1$ rm core aaldeshash@odin:~/4510/lab1$ rm lab1 aaldeshash@odin:~/4510/lab1$ g++ -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ gdb lab1 GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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 lab1...(no debugging symbols found)...done. (gdb) break main Breakpoint 1 at 0x1189 (gdb) run Starting program: /home/stu/aaldeshash/4510/lab1/lab1 Breakpoint 1, 0x0000555555555189 in main () (gdb) info registers rax 0x555555555185 93824992235909 rbx 0x0 0 rcx 0xa0 160 rdx 0x7fffffffe378 140737488348024 rsi 0x7fffffffe368 140737488348008 rdi 0x1 1 rbp 0x7fffffffe280 0x7fffffffe280 rsp 0x7fffffffe280 0x7fffffffe280 r8 0x7ffff7c7fd80 140737350466944 r9 0x0 0 r10 0xfffffffffffff658 -2472 r11 0x7ffff7afd1b0 140737348882864 r12 0x5555555550a0 93824992235680 r13 0x7fffffffe360 140737488348000 r14 0x0 0 r15 0x0 0 rip 0x555555555189 0x555555555189 eflags 0x246 [ PF ZF IF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 (gdb) x/i $rip => 0x555555555189 : sub $0x20,%rsp (gdb) print $rip $1 = (void (*)()) 0x555555555189 (gdb) print $rbp $2 = (void *) 0x7fffffffe280 (gdb) print $eax $3 = 1431654789 (gdb) print $rax $4 = 93824992235909 (gdb) disassemble Dump of assembler code for function main: 0x0000555555555185 <+0>: push %rbp 0x0000555555555186 <+1>: mov %rsp,%rbp => 0x0000555555555189 <+4>: sub $0x20,%rsp 0x000055555555518d <+8>: movq $0x0,-0x10(%rbp) 0x0000555555555195 <+16>: movl $0x0,-0x14(%rbp) 0x000055555555519c <+23>: lea 0xe62(%rip),%rsi # 0x555555556005 0x00005555555551a3 <+30>: lea 0x2eb6(%rip),%rdi # 0x555555558060 <_ZSt4cout@@GLIBCXX_3.4> 0x00005555555551aa <+37>: callq 0x555555555050 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt> 0x00005555555551af <+42>: lea -0x14(%rbp),%rax 0x00005555555551b3 <+46>: mov %rax,%rsi 0x00005555555551b6 <+49>: lea 0x2fc3(%rip),%rdi # 0x555555558180 <_ZSt3cin@@GLIBCXX_3.4> 0x00005555555551bd <+56>: callq 0x555555555030 <_ZNSirsERi@plt> 0x00005555555551c2 <+61>: lea 0xe52(%rip),%rsi # 0x55555555601b 0x00005555555551c9 <+68>: lea 0x2e90(%rip),%rdi # 0x555555558060 <_ZSt4cout@@GLIBCXX_3.4> 0x00005555555551d0 <+75>: callq 0x555555555050 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt> 0x00005555555551d5 <+80>: mov %rax,%rdx 0x00005555555551d8 <+83>: mov -0x14(%rbp),%eax 0x00005555555551db <+86>: mov %eax,%esi 0x00005555555551dd <+88>: mov %rdx,%rdi 0x00005555555551e0 <+91>: callq 0x555555555080 <_ZNSolsEi@plt> 0x00005555555551e5 <+96>: lea 0xe36(%rip),%rsi # 0x555555556022 0x00005555555551ec <+103>: mov %rax,%rdi 0x00005555555551ef <+106>: callq 0x555555555050 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt> 0x00005555555551f4 <+111>: movl $0x0,-0x4(%rbp) 0x00005555555551fb <+118>: mov -0x14(%rbp),%eax 0x00005555555551fe <+121>: cmp %eax,-0x4(%rbp) 0x0000555555555201 <+124>: jge 0x55555555522c 0x0000555555555203 <+126>: mov -0x4(%rbp),%eax 0x0000555555555206 <+129>: cltq 0x0000555555555208 <+131>: lea 0x0(,%rax,4),%rdx 0x0000555555555210 <+139>: mov -0x10(%rbp),%rax 0x0000555555555214 <+143>: add %rdx,%rax 0x0000555555555217 <+146>: mov %rax,%rsi 0x000055555555521a <+149>: lea 0x2f5f(%rip),%rdi # 0x555555558180 <_ZSt3cin@@GLIBCXX_3.4> 0x0000555555555221 <+156>: callq 0x555555555030 <_ZNSirsERi@plt> 0x0000555555555226 <+161>: addl $0x1,-0x4(%rbp) 0x000055555555522a <+165>: jmp 0x5555555551fb 0x000055555555522c <+167>: lea 0xdfb(%rip),%rsi # 0x55555555602e 0x0000555555555233 <+174>: lea 0x2e26(%rip),%rdi # 0x555555558060 <_ZSt4cout@@GLIBCXX_3.4> --Type for more, q to quit, c to continue without paging-- 0x000055555555523a <+181>: callq 0x555555555050 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt> 0x000055555555523f <+186>: mov -0x14(%rbp),%edx 0x0000555555555242 <+189>: mov -0x10(%rbp),%rax 0x0000555555555246 <+193>: mov %edx,%esi 0x0000555555555248 <+195>: mov %rax,%rdi 0x000055555555524b <+198>: callq 0x55555555526d <_Z10printArrayPii> 0x0000555555555250 <+203>: mov 0x2d79(%rip),%rax # 0x555555557fd0 0x0000555555555257 <+210>: mov %rax,%rsi 0x000055555555525a <+213>: lea 0x2dff(%rip),%rdi # 0x555555558060 <_ZSt4cout@@GLIBCXX_3.4> 0x0000555555555261 <+220>: callq 0x555555555060 <_ZNSolsEPFRSoS_E@plt> 0x0000555555555266 <+225>: mov $0x0,%eax 0x000055555555526b <+230>: leaveq 0x000055555555526c <+231>: retq End of assembler dump. (gdb) stepi 0x000055555555518d in main () (gdb) print $rip $5 = (void (*)()) 0x55555555518d (gdb) x/i $rip => 0x55555555518d : movq $0x0,-0x10(%rbp) (gdb) nexti 0x0000555555555195 in main () (gdb) x/i $rip => 0x555555555195 : movl $0x0,-0x14(%rbp) (gdb) quit A debugging session is active. Inferior 1 [process 2664] will be killed. Quit anyway? (y or n) y aaldeshash@odin:~/4510/lab1$ strip lab1 aaldeshash@odin:~/4510/lab1$ gdb lab1 GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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 lab1...(no debugging symbols found)...done. (gdb) break main Function "main" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) info file Symbols from "/home/stu/aaldeshash/4510/lab1/lab1". Local exec file: `/home/stu/aaldeshash/4510/lab1/lab1', file type elf64-x86-64. Entry point: 0x10a0 0x00000000000002a8 - 0x00000000000002c4 is .interp 0x00000000000002c4 - 0x00000000000002e4 is .note.ABI-tag 0x00000000000002e4 - 0x0000000000000308 is .note.gnu.build-id 0x0000000000000308 - 0x0000000000000338 is .gnu.hash 0x0000000000000338 - 0x00000000000004b8 is .dynsym 0x00000000000004b8 - 0x0000000000000651 is .dynstr 0x0000000000000652 - 0x0000000000000672 is .gnu.version 0x0000000000000678 - 0x00000000000006b8 is .gnu.version_r 0x00000000000006b8 - 0x00000000000007f0 is .rela.dyn 0x00000000000007f0 - 0x0000000000000880 is .rela.plt 0x0000000000001000 - 0x0000000000001017 is .init 0x0000000000001020 - 0x0000000000001090 is .plt 0x0000000000001090 - 0x0000000000001098 is .plt.got 0x00000000000010a0 - 0x0000000000001391 is .text 0x0000000000001394 - 0x000000000000139d is .fini 0x0000000000002000 - 0x000000000000203d is .rodata 0x0000000000002040 - 0x0000000000002094 is .eh_frame_hdr 0x0000000000002098 - 0x0000000000002200 is .eh_frame 0x0000000000003da0 - 0x0000000000003db0 is .init_array 0x0000000000003db0 - 0x0000000000003db8 is .fini_array 0x0000000000003db8 - 0x0000000000003fc8 is .dynamic 0x0000000000003fc8 - 0x0000000000004000 is .got 0x0000000000004000 - 0x0000000000004048 is .got.plt 0x0000000000004048 - 0x0000000000004058 is .data 0x0000000000004060 - 0x00000000000042a0 is .bss (gdb) set stop-on-solib-events 1 (gdb) run Starting program: /home/stu/aaldeshash/4510/lab1/lab1 Stopped due to shared library event (no libraries added or removed) (gdb) info file Symbols from "/home/stu/aaldeshash/4510/lab1/lab1". Native process: Using the running image of child process 16460. While running this, GDB does not access memory from... Local exec file: `/home/stu/aaldeshash/4510/lab1/lab1', file type elf64-x86-64. Entry point: 0x5555555550a0 0x00005555555542a8 - 0x00005555555542c4 is .interp 0x00005555555542c4 - 0x00005555555542e4 is .note.ABI-tag 0x00005555555542e4 - 0x0000555555554308 is .note.gnu.build-id 0x0000555555554308 - 0x0000555555554338 is .gnu.hash 0x0000555555554338 - 0x00005555555544b8 is .dynsym 0x00005555555544b8 - 0x0000555555554651 is .dynstr 0x0000555555554652 - 0x0000555555554672 is .gnu.version 0x0000555555554678 - 0x00005555555546b8 is .gnu.version_r 0x00005555555546b8 - 0x00005555555547f0 is .rela.dyn 0x00005555555547f0 - 0x0000555555554880 is .rela.plt 0x0000555555555000 - 0x0000555555555017 is .init 0x0000555555555020 - 0x0000555555555090 is .plt 0x0000555555555090 - 0x0000555555555098 is .plt.got 0x00005555555550a0 - 0x0000555555555391 is .text 0x0000555555555394 - 0x000055555555539d is .fini 0x0000555555556000 - 0x000055555555603d is .rodata 0x0000555555556040 - 0x0000555555556094 is .eh_frame_hdr 0x0000555555556098 - 0x0000555555556200 is .eh_frame 0x0000555555557da0 - 0x0000555555557db0 is .init_array 0x0000555555557db0 - 0x0000555555557db8 is .fini_array 0x0000555555557db8 - 0x0000555555557fc8 is .dynamic 0x0000555555557fc8 - 0x0000555555558000 is .got 0x0000555555558000 - 0x0000555555558048 is .got.plt 0x0000555555558048 - 0x0000555555558058 is .data 0x0000555555558060 - 0x00005555555582a0 is .bss 0x00007ffff7fd5238 - 0x00007ffff7fd525c is .note.gnu.build-id in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd5260 - 0x00007ffff7fd5334 is .hash in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd5338 - 0x00007ffff7fd5430 is .gnu.hash in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd5430 - 0x00007ffff7fd5760 is .dynsym in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd5760 - 0x00007ffff7fd5984 is .dynstr in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd5984 - 0x00007ffff7fd59c8 is .gnu.version in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd59c8 - 0x00007ffff7fd5a6c is .gnu.version_d in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd5a70 - 0x00007ffff7fd5e60 is .rela.dyn in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd5e60 - 0x00007ffff7fd5f08 is .rela.plt in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd6000 - 0x00007ffff7fd6080 is .plt in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd6080 - 0x00007ffff7fd6088 is .plt.got in /lib64/ld-linux-x86-64.so.2 0x00007ffff7fd6090 - 0x00007ffff7ff3b20 is .text in /lib64/ld-linux-x86-64.so.2 0x00007ffff7ff4000 - 0x00007ffff7ff8620 is .rodata in /lib64/ld-linux-x86-64.so.2 0x00007ffff7ff8620 - 0x00007ffff7ff8cf4 is .eh_frame_hdr in /lib64/ld-linux-x86-64.so.2 0x00007ffff7ff8cf8 - 0x00007ffff7ffb3dc is .eh_frame in /lib64/ld-linux-x86-64.so.2 0x00007ffff7ffc640 - 0x00007ffff7ffce74 is .data.rel.ro in /lib64/ld-linux-x86-64.so.2 0x00007ffff7ffce78 - 0x00007ffff7ffcfe8 is .dynamic in /lib64/ld-linux-x86-64.so.2 0x00007ffff7ffcfe8 - 0x00007ffff7ffcff8 is .got in /lib64/ld-linux-x86-64.so.2 --Type for more, q to quit, c to continue without paging--q Quit (gdb) break *0x5555555550a0 Breakpoint 1 at 0x5555555550a0 (gdb) set stop-on-solib-events 0 (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /home/stu/aaldeshash/4510/lab1/lab1 Breakpoint 1, 0x00005555555550a0 in ?? () (gdb) disassemble No function contains program counter for selected frame. (gdb) x/i $rip => 0x5555555550a0: xor %ebp,%ebp (gdb) x/20i 0x5555555550a2: mov %rdx,%r9 0x5555555550a5: pop %rsi 0x5555555550a6: mov %rsp,%rdx 0x5555555550a9: and $0xfffffffffffffff0,%rsp 0x5555555550ad: push %rax 0x5555555550ae: push %rsp 0x5555555550af: lea 0x2da(%rip),%r8 # 0x555555555390 0x5555555550b6: lea 0x273(%rip),%rcx # 0x555555555330 0x5555555550bd: lea 0xc1(%rip),%rdi # 0x555555555185 0x5555555550c4: callq *0x2f16(%rip) # 0x555555557fe0 0x5555555550ca: hlt 0x5555555550cb: nopl 0x0(%rax,%rax,1) 0x5555555550d0: lea 0x2f81(%rip),%rdi # 0x555555558058 0x5555555550d7: lea 0x2f7a(%rip),%rax # 0x555555558058 0x5555555550de: cmp %rdi,%rax 0x5555555550e1: je 0x5555555550f8 0x5555555550e3: mov 0x2eee(%rip),%rax # 0x555555557fd8 0x5555555550ea: test %rax,%rax 0x5555555550ed: je 0x5555555550f8 0x5555555550ef: jmpq *%rax (gdb) quit A debugging session is active. Inferior 1 [process 21988] will be killed. Quit anyway? (y or n) y aaldeshash@odin:~/4510/lab1$ g++ -no-pie -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ strip lab1 aaldeshash@odin:~/4510/lab1$ gdb lab1 GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 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 lab1...(no debugging symbols found)...done. (gdb) info file Symbols from "/home/stu/aaldeshash/4510/lab1/lab1". Local exec file: `/home/stu/aaldeshash/4510/lab1/lab1', file type elf64-x86-64. Entry point: 0x401090 0x00000000004002a8 - 0x00000000004002c4 is .interp 0x00000000004002c4 - 0x00000000004002e4 is .note.ABI-tag 0x00000000004002e4 - 0x0000000000400308 is .note.gnu.build-id 0x0000000000400308 - 0x0000000000400330 is .gnu.hash 0x0000000000400330 - 0x0000000000400468 is .dynsym 0x0000000000400468 - 0x00000000004005bc is .dynstr 0x00000000004005bc - 0x00000000004005d6 is .gnu.version 0x00000000004005d8 - 0x0000000000400618 is .gnu.version_r 0x0000000000400618 - 0x00000000004006a8 is .rela.dyn 0x00000000004006a8 - 0x0000000000400738 is .rela.plt 0x0000000000401000 - 0x0000000000401017 is .init 0x0000000000401020 - 0x0000000000401090 is .plt 0x0000000000401090 - 0x0000000000401381 is .text 0x0000000000401384 - 0x000000000040138d is .fini 0x0000000000402000 - 0x000000000040203d is .rodata 0x0000000000402040 - 0x0000000000402094 is .eh_frame_hdr 0x0000000000402098 - 0x00000000004021f8 is .eh_frame 0x0000000000403dc8 - 0x0000000000403dd8 is .init_array 0x0000000000403dd8 - 0x0000000000403de0 is .fini_array 0x0000000000403de0 - 0x0000000000403fe0 is .dynamic 0x0000000000403fe0 - 0x0000000000404000 is .got 0x0000000000404000 - 0x0000000000404048 is .got.plt 0x0000000000404048 - 0x0000000000404058 is .data 0x0000000000404060 - 0x00000000004042a0 is .bss (gdb) break *0x401090 Breakpoint 1 at 0x401090 (gdb) run Starting program: /home/stu/aaldeshash/4510/lab1/lab1 Breakpoint 1, 0x0000000000401090 in ?? () (gdb) x/20i $rip => 0x401090: xor %ebp,%ebp 0x401092: mov %rdx,%r9 0x401095: pop %rsi 0x401096: mov %rsp,%rdx 0x401099: and $0xfffffffffffffff0,%rsp 0x40109d: push %rax 0x40109e: push %rsp 0x40109f: mov $0x401380,%r8 0x4010a6: mov $0x401320,%rcx 0x4010ad: mov $0x401172,%rdi 0x4010b4: callq *0x2f2e(%rip) # 0x403fe8 0x4010ba: hlt 0x4010bb: nopl 0x0(%rax,%rax,1) 0x4010c0: retq 0x4010c1: nopw %cs:0x0(%rax,%rax,1) 0x4010cb: nopl 0x0(%rax,%rax,1) 0x4010d0: mov $0x404058,%eax 0x4010d5: cmp $0x404058,%rax 0x4010db: je 0x4010f0 0x4010dd: mov $0x0,%eax (gdb) quit A debugging session is active. Inferior 1 [process 26702] will be killed. Quit anyway? (y or n) y aaldeshash@odin:~/4510/lab1$ info lab1 -bash: info: command not found aaldeshash@odin:~/4510/lab1$ file lab1 lab1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=ad9c7583dad5c7da4291b26ec98ad795a52a7716, stripped aaldeshash@odin:~/4510/lab1$ g++ -o lab1 lab1.cpp aaldeshash@odin:~/4510/lab1$ file lab1 lab1: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=02b2441693aff64cd5829f70cdc3b0c6f28bee8c, not stripped aaldeshash@odin:~/4510/lab1$