Changeset 609 for branches/GNU/src/binutils/bfd/hpux-core.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/hpux-core.c
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 1 /* BFD back-end for HP/UX core files. 2 Copyright 1993, 1994, 1996, 1998, 1999, 2001 2 Copyright 1993, 1994, 1996, 1998, 1999, 2001 3 3 Free Software Foundation, Inc. 4 4 Written by Stu Grossman, Cygnus Support. … … 101 101 #define core_user_thread_id(bfd) (core_hdr(bfd)->user_tid) 102 102 103 static void swap_abort PARAMS ((void)); 103 static asection *make_bfd_asection 104 PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, 105 unsigned int)); 106 static const bfd_target *hpux_core_core_file_p 107 PARAMS ((bfd *)); 108 static char *hpux_core_core_file_failing_command 109 PARAMS ((bfd *)); 110 static int hpux_core_core_file_failing_signal 111 PARAMS ((bfd *)); 112 static bfd_boolean hpux_core_core_file_matches_executable_p 113 PARAMS ((bfd *, bfd *)); 114 static void swap_abort 115 PARAMS ((void)); 104 116 105 117 static asection * 106 118 make_bfd_asection (abfd, name, flags, _raw_size, vma, alignment_power) 107 119 bfd *abfd; 108 CONSTchar *name;120 char *name; 109 121 flagword flags; 110 122 bfd_size_type _raw_size; … … 115 127 char *newname; 116 128 117 newname = bfd_alloc (abfd, strlen (name) + 1);129 newname = bfd_alloc (abfd, strlen (name) + 1); 118 130 if (!newname) 119 131 return NULL; … … 132 144 133 145 return asect; 134 }135 136 static asymbol *137 hpux_core_make_empty_symbol (abfd)138 bfd *abfd;139 {140 asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));141 if (new)142 new->the_bfd = abfd;143 return new;144 146 } 145 147 … … 161 163 162 164 core_hdr (abfd) = (struct hpux_core_struct *) 163 bfd_zalloc (abfd, sizeof (struct hpux_core_struct));165 bfd_zalloc (abfd, sizeof (struct hpux_core_struct)); 164 166 if (!core_hdr (abfd)) 165 167 return NULL; … … 170 172 struct corehead core_header; 171 173 172 val = bfd_read ((void *) &core_header, 1, sizeof core_header, abfd); 174 val = bfd_bread ((void *) &core_header, 175 (bfd_size_type) sizeof core_header, abfd); 173 176 if (val <= 0) 174 177 break; … … 177 180 case CORE_KERNEL: 178 181 case CORE_FORMAT: 179 bfd_seek (abfd, core_header.len, SEEK_CUR); /* Just skip this */ 182 /* Just skip this. */ 183 bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR); 180 184 good_sections++; 181 185 break; … … 183 187 { 184 188 struct proc_exec proc_exec; 185 if (bfd_ read ((void *) &proc_exec, 1, core_header.len, abfd)186 != core_header.len)189 if (bfd_ 190 != core_header.len) 187 191 break; 188 192 strncpy (core_command (abfd), proc_exec.cmd, MAXCOMLEN + 1); … … 198 202 whether the core-dumped app was threaded before we create 199 203 any .reg sections. */ 200 if (bfd_ read (&proc_info, 1,core_header.len, abfd)204 if (bfd_ core_header.len, abfd) 201 205 != core_header.len) 202 206 break; … … 204 208 /* However, we also want to create those sections with the 205 209 file positioned at the start of the record, it seems. */ 206 if (bfd_seek (abfd, -core_header.len, SEEK_CUR) != 0)210 if (bfd_seek (abfd, -core_header.len, SEEK_CUR) != 0) 207 211 break; 208 212 … … 234 238 (int) &proc_info - (int) & proc_info.hw_regs, 235 239 2)) 236 return NULL;240 ; 237 241 } 238 242 else … … 247 251 (int) &proc_info - (int) & proc_info.hw_regs, 248 252 2)) 249 return NULL;253 ; 250 254 } 251 255 /* We always make one of these sections, for every thread. */ … … 256 260 (int) &proc_info - (int) & proc_info.hw_regs, 257 261 2)) 258 return NULL;262 ; 259 263 } 260 264 core_signal (abfd) = proc_info.sig; 261 if (bfd_seek (abfd, core_header.len, SEEK_CUR) != 0)265 if (bfd_seek (abfd, core_header.len, SEEK_CUR) != 0) 262 266 break; 263 267 good_sections++; … … 274 278 SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, 275 279 core_header.len, core_header.addr, 2)) 276 return NULL;277 278 bfd_seek (abfd, core_header.len, SEEK_CUR);280 ; 281 282 bfd_seek (abfd, core_header.len, SEEK_CUR); 279 283 good_sections++; 280 284 break; … … 290 294 break; 291 295 292 default: return 0; /*unrecognized core file type */ 296 default: 297 goto fail; /*unrecognized core file type */ 293 298 } 294 299 } … … 308 313 309 314 return abfd->xvec; 315 316 317 318 319 320 310 321 } 311 322 … … 326 337 327 338 /* ARGSUSED */ 328 static b oolean339 static boolean 329 340 hpux_core_core_file_matches_executable_p (core_bfd, exec_bfd) 330 bfd *core_bfd, *exec_bfd; 331 { 332 return true; /* FIXME, We have no way of telling at this point */ 333 } 334 335 336 #define hpux_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound 337 #define hpux_core_get_symtab _bfd_nosymbols_get_symtab 338 #define hpux_core_print_symbol _bfd_nosymbols_print_symbol 339 #define hpux_core_get_symbol_info _bfd_nosymbols_get_symbol_info 340 #define hpux_core_bfd_is_local_label_name \ 341 _bfd_nosymbols_bfd_is_local_label_name 342 #define hpux_core_get_lineno _bfd_nosymbols_get_lineno 343 #define hpux_core_find_nearest_line _bfd_nosymbols_find_nearest_line 344 #define hpux_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol 345 #define hpux_core_read_minisymbols _bfd_nosymbols_read_minisymbols 346 #define hpux_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol 341 bfd *core_bfd ATTRIBUTE_UNUSED; 342 bfd *exec_bfd ATTRIBUTE_UNUSED; 343 { 344 return TRUE; /* FIXME, We have no way of telling at this point */ 345 } 346 347 347 348 348 /* If somebody calls any byte-swapping routines, shoot them. */ 349 349 static void 350 swap_abort ()350 swap_abort() 351 351 { 352 352 abort(); /* This way doesn't require any declaration for ANSI to fuck up */ … … 392 392 }, 393 393 394 BFD_JUMP_TABLE_GENERIC (_bfd_generic),395 BFD_JUMP_TABLE_COPY (_bfd_generic),396 BFD_JUMP_TABLE_CORE (hpux_core),397 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),398 BFD_JUMP_TABLE_SYMBOLS (hpux_core),399 BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),400 BFD_JUMP_TABLE_WRITE (_bfd_generic),401 BFD_JUMP_TABLE_LINK (_bfd_nolink),402 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),394 BFD_JUMP_TABLE_GENERIC (_bfd_generic), 395 BFD_JUMP_TABLE_COPY (_bfd_generic), 396 BFD_JUMP_TABLE_CORE (hpux_core), 397 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), 398 ), 399 BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), 400 BFD_JUMP_TABLE_WRITE (_bfd_generic), 401 BFD_JUMP_TABLE_LINK (_bfd_nolink), 402 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), 403 403 404 404 NULL, -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
