1. insighthttp: // response
1. insight http://sourceware.org/insight/downloads.php
2. decompress the package to Ubuntu. The decompressed directory is as follows:
/Home/haowei/Downloads/insights-6.8-1
3. Go to the insight-6-8-1 directory and run the./configure command.
4. When executing the make command, an exception occurs during compilation:
- C0: warning being treated as errors
- Linux-nat.c: In function'Linux _ nat_info_proc_cmd':
- Linux-nat.c: 2879: error: ignoringReturnValue'Fgets', Declared with attribute warn_unused_result
View the gdb/linux-nat.c function 'linux _ nat_info_proc_cmd ':
This is because the fgets method called in this function does not define the return value.
The source code is as follows:
- If(Procfile = fopen (fname1,"R"))! = NULL)
- {
- Fgets (buffer,Sizeof(Buffer), procfile );
- Printf_filtered ("Required line = '% s' \ n", Buffer );
- Fclose (procfile );
- }
Modified code:
- If(Procfile = fopen (fname1,"R"))! = NULL)
- {
- Char* P = fgets (buffer, sizeof (buffer), procfile );
- Printf_filtered ("Required line = '% s' \ n", Buffer );
- Fclose (procfile );
- }
There are several similar errors involved: write, getcwd, dup...
The specific file will be prompted when you execute make.
You can call these methods to define a return value during modification:
Int p = write (....);
Char * p = getcwd (....);
Int p = dup (...);
Note that the definitions of these variables should be placed at the beginning of the function.
There is also a gdb/eval. c class. The code compilation error is as follows:
IntSubscript_array [MAX_FORTRAN_DIMS];
This array is not initialized. You can initialize this array and compile it as follows:
- If(Nargs> MAX_FORTRAN_DIMS)
- Error (_("Too upload subscripts for F77 (% d Max )"), MAX_FORTRAN_DIMS );
-
- Memset (& subscript_array,0, Sizeof (subscript_array ));
5. After executing make, run sudo make install to complete the installation.
Appendix. This is what insight runs after I compile the program: