1 |
/* BFD back-end for CISCO crash dumps. |
/* BFD back-end for CISCO crash dumps. |
2 |
Copyright 1994, 1997, 1999, 2000, 2001, 2002 |
Copyright 1994, 1997, 1999, 2000, 2001, 2002, 2004 |
3 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of BFD, the Binary File Descriptor library. |
This file is part of BFD, the Binary File Descriptor library. |
75 |
static const bfd_target *cisco_core_file_p PARAMS ((bfd *)); |
static const bfd_target *cisco_core_file_p PARAMS ((bfd *)); |
76 |
char *cisco_core_file_failing_command PARAMS ((bfd *)); |
char *cisco_core_file_failing_command PARAMS ((bfd *)); |
77 |
int cisco_core_file_failing_signal PARAMS ((bfd *)); |
int cisco_core_file_failing_signal PARAMS ((bfd *)); |
78 |
boolean cisco_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); |
bfd_boolean cisco_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); |
79 |
|
|
80 |
/* Examine the file for a crash info struct at the offset given by |
/* Examine the file for a crash info struct at the offset given by |
81 |
CRASH_INFO_LOC. */ |
CRASH_INFO_LOC. */ |
246 |
goto error_return; |
goto error_return; |
247 |
asect->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; |
asect->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; |
248 |
/* The size of memory is the size of the core file itself. */ |
/* The size of memory is the size of the core file itself. */ |
249 |
asect->_raw_size = statbuf.st_size; |
asect->size = statbuf.st_size; |
250 |
asect->vma = rambase; |
asect->vma = rambase; |
251 |
asect->filepos = 0; |
asect->filepos = 0; |
252 |
|
|
259 |
asect->flags = SEC_HAS_CONTENTS; |
asect->flags = SEC_HAS_CONTENTS; |
260 |
asect->vma = 0; |
asect->vma = 0; |
261 |
asect->filepos = crashinfo_offset; |
asect->filepos = crashinfo_offset; |
262 |
asect->_raw_size = sizeof (crashinfo); |
asect->size = sizeof (crashinfo); |
263 |
|
|
264 |
/* Create a ".reg" section to allow access to the saved |
/* Create a ".reg" section to allow access to the saved |
265 |
registers. */ |
registers. */ |
274 |
choose a register section size that is either the remaining part |
choose a register section size that is either the remaining part |
275 |
of the file, or 1024, whichever is smaller. */ |
of the file, or 1024, whichever is smaller. */ |
276 |
nread = statbuf.st_size - asect->filepos; |
nread = statbuf.st_size - asect->filepos; |
277 |
asect->_raw_size = (nread < 1024) ? nread : 1024; |
asect->size = (nread < 1024) ? nread : 1024; |
278 |
|
|
279 |
return abfd->xvec; |
return abfd->xvec; |
280 |
|
|
318 |
return abfd->tdata.cisco_core_data->sig; |
return abfd->tdata.cisco_core_data->sig; |
319 |
} |
} |
320 |
|
|
321 |
boolean |
bfd_boolean |
322 |
cisco_core_file_matches_executable_p (core_bfd, exec_bfd) |
cisco_core_file_matches_executable_p (core_bfd, exec_bfd) |
323 |
bfd *core_bfd ATTRIBUTE_UNUSED; |
bfd *core_bfd ATTRIBUTE_UNUSED; |
324 |
bfd *exec_bfd ATTRIBUTE_UNUSED; |
bfd *exec_bfd ATTRIBUTE_UNUSED; |
325 |
{ |
{ |
326 |
return true; |
return TRUE; |
327 |
} |
} |
328 |
|
|
329 |
extern const bfd_target cisco_core_little_vec; |
extern const bfd_target cisco_core_little_vec; |