Error:
C0: warnings being treated as errors
.././GDB/CLI/cli-cmds.c: In function 'pwd _ command ':
.././GDB/CLI/cli-cmds.c: 323: Error: Ignoring return value of 'getcwd ', declared with attribute warn_unused_result
Make [2]: *** [cli-cmds.o] Error 1
Make [2]: leaving the directory '/home/Qiang/tools/insight-6.8-1/GDB'
Make [1]: *** [All-GDB] Error 2
Make [1]: Leaving directory '/home/Qiang/tools/insight-6.8-1'
Make: *** [all] Error 2
Solution:
Method 1. Modify the source code,
Linux-nat.c: 2879: Error: Ignoring return value of 'fgets', declared with attribute warn_unused_result
Old Code
Fgets (buffer, MAXPATHLEN, procfile );
The solution is:
Char * temp_p = fgets (buffer, MAXPATHLEN, procfile );
There are several other similar problems, basically all of which are GDB problems. Just solve them as needed, so I will not talk about them one by one.
Method 2: Go to the insight-6.8-1/GDB directory and open the MAKEFILE file to search for-werror
Old Code
Werror_cflags =-werror
New Code
Werror_cflags = #-werror
Both methods can be compiled to use insight.