Changeset 609 for branches/GNU/src/binutils/bfd/rs6000-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/rs6000-core.c
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r608 r609 1 1 /* IBM RS/6000 "XCOFF" back-end for BFD. 2 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 3 2001 3 2001 4 4 Free Software Foundation, Inc. 5 5 FIXME: Can someone provide a transliteration of this name into ASCII? … … 12 12 Contributed by IBM Corporation and Cygnus Support. 13 13 14 This file is part of BFD, the Binary File Descriptor library.15 16 This program is free software; you can redistribute it and/or modify17 it under the terms of the GNU General Public License as published by18 the Free Software Foundation; either version 2 of the License, or19 (at your option) any later version.20 21 This program is distributed in the hope that it will be useful,22 but WITHOUT ANY WARRANTY; without even the implied warranty of23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the24 GNU General Public License for more details.25 26 You should have received a copy of the GNU General Public License27 along with this program; if not, write to the Free Software28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */14 This file is part of BFD, the Binary File Descriptor library. 15 16 This program is free software; you can redistribute it and/or modify 17 it under the terms of the GNU General Public License as published by 18 the Free Software Foundation; either version 2 of the License, or 19 (at your option) any later version. 20 21 This program is distributed in the hope that it will be useful, 22 but WITHOUT ANY WARRANTY; without even the implied warranty of 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 GNU General Public License for more details. 25 26 You should have received a copy of the GNU General Public License 27 along with this program; if not, write to the Free Software 28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 29 29 30 30 /* This port currently only handles reading object files, except when … … 183 183 /* Return the c_impl field from struct core_dumpx C. */ 184 184 185 #if def AIX_CORE_DUMPX_CORE185 #if 186 186 # define CNEW_IMPL(c) (c).c_impl 187 187 #else … … 254 254 Return success. */ 255 255 256 static b oolean256 static boolean 257 257 read_hdr (bfd *abfd, CoreHdr *core) 258 258 { 259 259 bfd_size_type size; 260 260 261 if (bfd_seek (abfd, 0, SEEK_SET) != 0)262 return false;261 if (bfd_seek (abfd, 0, SEEK_SET) != 0) 262 return ; 263 263 264 264 /* Read the leading portion that old and new core dump structures have in 265 265 common. */ 266 if (bfd_read (core, CORE_COMMONSZ, 1, abfd) != CORE_COMMONSZ) 267 return false; 266 size = CORE_COMMONSZ; 267 if (bfd_bread (core, size, abfd) != size) 268 return FALSE; 268 269 269 270 /* Read the trailing portion of the structure. */ 270 size = CORE_NEW (*core) ? sizeof (core->new) : sizeof (core->old) 271 - CORE_COMMONSZ; 272 return bfd_read ((char *) core + CORE_COMMONSZ, size, 1, abfd) == size; 271 if (CORE_NEW (*core)) 272 size = sizeof (core->new); 273 else 274 size = sizeof (core->old); 275 size -= CORE_COMMONSZ; 276 return bfd_bread ((char *) core + CORE_COMMONSZ, size, abfd) == size; 273 277 } 274 278 … … 276 280 make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos) 277 281 bfd *abfd; 278 CONSTchar *name;282 char *name; 279 283 flagword flags; 280 284 bfd_size_type _raw_size; … … 425 429 /* Allocate core file header. */ 426 430 size = CORE_NEW (core) ? sizeof (core.new) : sizeof (core.old); 427 tmpptr = (char *) bfd_zalloc (abfd, size);431 tmpptr = (char *) bfd_zalloc (abfd, size); 428 432 if (!tmpptr) 429 433 return NULL; … … 459 463 SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, 460 464 c_size, c_stackend - c_size, c_stack)) 461 return NULL;465 ; 462 466 463 467 /* .reg section for all registers. */ … … 465 469 SEC_HAS_CONTENTS, 466 470 c_regsize, (bfd_vma) 0, c_regoff)) 467 return NULL;471 ; 468 472 469 473 /* .ldinfo section. … … 474 478 SEC_HAS_CONTENTS, 475 479 c_lsize, (bfd_vma) 0, c_loader)) 476 return NULL;480 ; 477 481 478 482 #ifndef CORE_VERSION_1 … … 491 495 CDATA_ADDR (core.old.c_u.u_dsize), 492 496 c_stack + c_size)) 493 return NULL;497 ; 494 498 } 495 499 #endif … … 533 537 (bfd_vma) CDATA_ADDR (c_datasize), 534 538 c_data)) 535 return NULL;539 ; 536 540 } 537 541 … … 545 549 { 546 550 if (bfd_seek (abfd, c_loader, SEEK_SET) != 0) 547 return NULL;548 if (bfd_ read (&ldinfo, size, 1, abfd) != size)549 return NULL;551 ; 552 if (bfd_, abfd) != size) 553 ; 550 554 551 555 if (proc64) … … 568 572 SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, 569 573 ldi_datasize, ldi_dataorg, ldi_core)) 570 return NULL;574 ; 571 575 572 576 if (ldi_next == 0) … … 581 585 582 586 if (bfd_seek (abfd, c_vmm, SEEK_SET) != 0) 583 return NULL;587 ; 584 588 585 589 for (i = 0; i < c_vmregions; i++) … … 591 595 592 596 size = CORE_NEW (core) ? sizeof (vminfo.new) : sizeof (vminfo.old); 593 if (bfd_ read (&vminfo, size, 1, abfd) != size)594 return NULL;597 if (bfd_, abfd) != size) 598 ; 595 599 596 600 if (CORE_NEW (core)) … … 612 616 vminfo_size, vminfo_addr, 613 617 vminfo_offset)) 614 return NULL;618 ; 615 619 } 616 620 } … … 619 623 620 624 return abfd->xvec; /* This is garbage for now. */ 625 626 627 628 629 630 621 631 } 622 632 623 /* Return ` true' if given core is from the given executable. */624 625 b oolean633 /* Return `' if given core is from the given executable. */ 634 635 boolean 626 636 rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) 627 637 bfd *core_bfd; … … 633 643 size_t alloc; 634 644 const char *str1, *str2; 635 b oolean ret;645 boolean ret; 636 646 file_ptr c_loader; 637 647 638 648 if (!read_hdr (core_bfd, &core)) 639 return false;649 return ; 640 650 641 651 if (CORE_NEW (core)) … … 650 660 651 661 if (bfd_seek (core_bfd, c_loader + size, SEEK_SET) != 0) 652 return false;662 return ; 653 663 654 664 alloc = 100; 655 path = bfd_malloc ( alloc);665 path = bfd_malloc (alloc); 656 666 if (path == NULL) 657 return false;667 return ; 658 668 s = path; 659 669 660 670 while (1) 661 671 { 662 if (bfd_ read (s, 1,1, core_bfd) != 1)672 if (bfd_ 1, core_bfd) != 1) 663 673 { 664 674 free (path); 665 return false;675 return ; 666 676 } 667 677 if (*s == '\0') … … 673 683 674 684 alloc *= 2; 675 n = bfd_realloc (path, alloc);685 n = bfd_realloc (path, alloc); 676 686 if (n == NULL) 677 687 { 678 688 free (path); 679 return false;689 return ; 680 690 } 681 691 s = n + (path - s); … … 692 702 693 703 if (strcmp (str1, str2) == 0) 694 ret = true;704 ret = ; 695 705 else 696 ret = false;706 ret = ; 697 707 698 708 free (path); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
