student1@506-55:~$ vim ex7_2.c
student1@506-55:~$ gcc -O0 ex7_2.c -m32 -g -o ex7_2
student1@506-55:~$ objdump -S ex7_2>ex7_2.txt
student1@506-55:~$ gdb ex7_2
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5)7.11.1
Copyright (C)2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
Type "show configuration"for configuration details.
For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ex7_2...done.(gdb)break12
Breakpoint 1 at 0x8048495: file ex7_2.c, line 12.(gdb) run
Starting program:/home/student1/ex7_2
ix=-152626,iy=-152626
fx=-nan,fy=-152626.000000
Breakpoint 1, main () at ex7_2.c:1212}(gdb) x/1xw &ix
0xbfffef70:0xfffdabce(gdb) x/1xw &iy
0xbfffef74:0xfffdabce(gdb) x/1xw &fx
0xbfffef78:0xfffdabce(gdb) x/1xw &fy
0xbfffef7c:0xc8150c80
student1@506-55:~$ gdb ex8
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5)7.11.1
Copyright (C)2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
Type "show configuration"for configuration details.
For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ex8...done.(gdb)break7
Breakpoint 1 at 0x8048414: file ex8.c, line 7.(gdb) run
Starting program:/home/student1/ex8
Breakpoint 1, add (x=2147483647, y=1) at ex8.c:77return x+y;(gdb) i r ebp
ebp 0xbfffef400xbfffef40(gdb) x/1xw $ebp+80xbfffef48:0x7fffffff(gdb) x/1xw $ebp+120xbfffef4c:0x00000001(gdb) i r eax
eax 0x80000000-2147483648(gdb) r
The program being debugged has been started already.
Start it from the beginning?(y or n) n
Program not restarted.(gdb) c
Continuing.
Breakpoint 1, add (x=2147483646, y=2) at ex8.c:77return x+y;(gdb) i r eax ebp
eax 0x80000000-2147483648
ebp 0xbfffef400xbfffef40(gdb) x/1xw $ebp+120xbfffef4c:0x00000002(gdb) x/1xw $ebp+80xbfffef48:0x7ffffffe(gdb)break16
Breakpoint 2 at 0x804842d: file ex8.c, line 16.(gdb) run
The program being debugged has been started already.
Start it from the beginning?(y or n) n
Program not restarted.(gdb) c
Continuing.2147483647+1=-2147483648,2147483646+2=2147483648
Breakpoint 2, sub (x=3, y=4) at ex8.c:1616}(gdb) i r eax ebp
eax 0xffffffff-1
ebp 0xbfffef380xbfffef38(gdb) x/1xw $ebp+80xbfffef40:0x00000003(gdb) x/1xw $ebp+120xbfffef44:0x00000004(gdb) c
Continuing.
Breakpoint 2, sub (x=5, y=6) at ex8.c:1616}(gdb) x/1xw $ebp+80xbfffef40:0x00000005(gdb) i r eax ebp
eax 0xffffffff-1
ebp 0xbfffef380xbfffef38(gdb) x/1xw $ebp+120xbfffef44:0x00000006(gdb)break29
Breakpoint 3 at 0x804850a: file ex8.c, line 29.(gdb) c
Continuing.3-4=-1,5-6=4294967295
Breakpoint 3, main () at ex8.c:2929return0;(gdb) x/1xw &az
0xbfffef70:0x80000000(gdb) x/1xw &auz
0xbfffef74:0x80000000(gdb) x/1xw &sz
0xbfffef78:0xffffffff(gdb) x/1xw &suz
0xbfffef7c:0xffffffff(gdb) q