aboutsummaryrefslogtreecommitdiff
path: root/gdb/default-dep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/default-dep.c')
-rw-r--r--gdb/default-dep.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/default-dep.c b/gdb/default-dep.c
index b38c205..a20d567 100644
--- a/gdb/default-dep.c
+++ b/gdb/default-dep.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
@@ -26,7 +27,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/types.h>
#endif
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -525,10 +525,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
@@ -565,7 +567,8 @@ exec_file_command (filename, from_tty)
data_start = exec_data_start;
data_end += exec_data_start;
- fstat (execchan, &st_exec);
+ if (fstat (execchan, &st_exec) < 0)
+ perror_with_name (filename);
exec_mtime = st_exec.st_mtime;
}
#endif /* not COFF_FORMAT */