forked from srinirad/IA2-Test1-Session2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp7debuglog.txt
74 lines (72 loc) · 2.13 KB
/
p7debuglog.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
69
70
71
72
73
74
gcc -g p7final.c
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 0x86b: file p7final.c, line 22.
(gdb) r
Starting program: /home/runner/IA2-Test1-Session2-9/a.out
warning: Error disabling address space randomization: Operation not permitted
Breakpoint 1, main () at p7final.c:22
22 {
(gdb) n
23 Triangle t=input_triangle();
(gdb) s
input_triangle () at p7final.c:7
7 {
(gdb) n
9 printf("enter the base and height of triangle\n");
(gdb) n
enter the base and height of triangle
10 scanf("%f%f",&t.base,&t.altitude);
(gdb) n
2
3
11 return t;
(gdb) n
12 }
(gdb) n
main () at p7final.c:24
24 find_area(&t);
(gdb) s
find_area (t=0x7ffc5501269c) at p7final.c:15
15 t->area=(t->base * t->altitude)/2;
(gdb) n
16 }
(gdb) n
main () at p7final.c:25
25 output(t);
(gdb) s
output (t=...) at p7final.c:19
19 printf("ther area of triangle with base=%.2f and altitude=%.2f is %.2f",t.base,t.altitude,t.area);
(gdb) n
20 }
(gdb) p base
No symbol "base" in current context.
(gdb) n
main () at p7final.c:26
26 return 0;
(gdb) n
27 }(gdb) n
__libc_start_main (main=0x55fa8f400863 <main>,
argc=1, argv=0x7ffc55012798,
init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>,
stack_end=0x7ffc55012788)
at ../csu/libc-start.c:344
344 ../csu/libc-start.c: No such file or directory.
(gdb) n
ther area of triangle with base=2.00 and altitude=3.00 is 3.00