Back to index

cell-binutils  2.17cvs20070401
Functions
corefile.c File Reference
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"

Go to the source code of this file.

Functions

const char * bfd_core_file_failing_command (bfd *abfd)
int bfd_core_file_failing_signal (bfd *abfd)
bfd_boolean core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
bfd_boolean generic_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)

Function Documentation

Definition at line 51 of file corefile.c.

{
  if (abfd->format != bfd_core)
    {
      bfd_set_error (bfd_error_invalid_operation);
      return NULL;
    }
  return BFD_SEND (abfd, _core_file_failing_command, (abfd));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 74 of file corefile.c.

{
  if (abfd->format != bfd_core)
    {
      bfd_set_error (bfd_error_invalid_operation);
      return 0;
    }
  return BFD_SEND (abfd, _core_file_failing_signal, (abfd));
}

Here is the call graph for this function:

bfd_boolean core_file_matches_executable_p ( bfd core_bfd,
bfd exec_bfd 
)

Definition at line 99 of file corefile.c.

{
  if (core_bfd->format != bfd_core || exec_bfd->format != bfd_object)
    {
      bfd_set_error (bfd_error_wrong_format);
      return FALSE;
    }

  return BFD_SEND (core_bfd, _core_file_matches_executable_p,
                 (core_bfd, exec_bfd));
}

Here is the call graph for this function:

bfd_boolean generic_core_file_matches_executable_p ( bfd core_bfd,
bfd exec_bfd 
)

Definition at line 133 of file corefile.c.

{
  char *exec;
  char *core;
  char *last_slash;

  if (exec_bfd == NULL || core_bfd == NULL)
    return TRUE;

  /* The cast below is to avoid a compiler warning due to the assignment
     of the const char * returned by bfd_core_file_failing_command to a
     non-const char *.  In this case, the assignement does not lead to
     breaking the const, as we're only reading the string.  */
     
  core = (char *) bfd_core_file_failing_command (core_bfd);
  if (core == NULL)
    return TRUE;

  exec = bfd_get_filename (exec_bfd);
  if (exec == NULL)
    return TRUE;

  last_slash = strrchr (core, '/');
  if (last_slash != NULL)
    core = last_slash + 1;

  last_slash = strrchr (exec, '/');
  if (last_slash != NULL)
    exec = last_slash + 1;
  
  return strcmp (exec, core) == 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: