forked from srinirad/Test2Session1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp1output.txt
68 lines (67 loc) · 2.12 KB
/
p1output.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
gcc -g p1original.c -lm
gdb a.out
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 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 "x86_64-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 a.out...done.
(gdb) b main
Breakpoint 1 at 0x8dc: file p1original.c, line 20.
(gdb) r
Starting program: /home/runner/Test2Session1-1/a.out
warning: Error disabling address space randomization: Operation not permitted
Breakpoint 1, main () at p1original.c:20
20 {
(gdb) n
22 input(&x1,&y1,&x2,&y2);
(gdb) s
input (x1=0x7fff99d972b4, y1=0x7fff99d972b8, x2=0x7fff99d972bc,
y2=0x7fff99d972c0) at p1original.c:6
6 printf("enter 4 numbers\n");
(gdb) n
enter 4 numbers
7 scanf("%f%f%f%f",x1,y1,x2,y2);
(gdb) n
1
1
2
2
8 }
(gdb) n
main () at p1original.c:23
23 find_distance(x1,y1,x2,y2,&area);
(gdb) s
find_distance (x1=1, y1=1, x2=2, y2=2, area=0x7fff99d972c4) at p1original.c:12
12 *area=sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
(gdb) n
14 }
(gdb) n
main () at p1original.c:24
24 output(x1,y1,x2,y2,area);
(gdb) s
output (x1=1, y1=1, x2=2, y2=2, area=1.41421354) at p1original.c:17
17 printf("distance is %f",area);
(gdb) n
18 }
(gdb) n
main () at p1original.c:25
25 return 0;
(gdb) n
26 }
(gdb) n
__libc_start_main (main=0x5638702008d4 <main>, argc=1, argv=0x7fff99d973b8,
init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
stack_end=0x7fff99d973a8) at ../csu/libc-start.c:344
344 ../csu/libc-start.c: No such file or directory.
(gdb) n
distance is 1.414214[Inferior 1 (process 1067) exited normally]