Repository navigation
Expand file tree
/
Copy pathp01debug.txt
More file actions
55 lines (53 loc) · 1.62 KB
/
Copy pathp01debug.txt
File metadata and controls
55 lines (53 loc) · 1.62 KB
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
gcc -g p01.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 0x822: file p01.c, line 16.
(gdb) r
Starting program: /home/runner/TwoProgramsadayassignment/a.out
warning: Error disabling address space randomization: Operation not permitted
Breakpoint 1, main () at p01.c:16
16 {
(gdb) n
18 input(&b,&h);
(gdb) s
input (base=0x7ffcd19b540c, height=0x7ffcd19b5410) at p01.c:4
4 printf("enter the lengths in the format base height\n");
(gdb) n
enter the lengths in the format base height
5 scanf("%f %f",base,height);
(gdb) n
6 7
6 }
(gdb) n
main () at p01.c:19
19 find_area(b,h,&ar);
(gdb) s
find_area (base=6, height=7, area=0x7ffcd19b5414) at p01.c:9
9 *area = 0.5 * base * height;
(gdb) n
10 }
(gdb) n
main () at p01.c:20
20 output(b,h,ar);
(gdb) n
the area of the triangle with base 6.000000 and height 7.000000 is 21.000000
21 return 0;
(gdb) n
22 }(gdb)