Back to index

cell-binutils  2.17cvs20070401
Functions
dis-buf.c File Reference
#include "sysdep.h"
#include "dis-asm.h"
#include <errno.h>
#include "opintl.h"

Go to the source code of this file.

Functions

int buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info)
void perror_memory (int status, bfd_vma memaddr, struct disassemble_info *info)
void generic_print_address (bfd_vma addr, struct disassemble_info *info)
int generic_symbol_at_address (bfd_vma addr ATTRIBUTE_UNUSED, struct disassemble_info *info ATTRIBUTE_UNUSED)
bfd_boolean generic_symbol_is_valid (asymbol *sym ATTRIBUTE_UNUSED, struct disassemble_info *info ATTRIBUTE_UNUSED)

Function Documentation

int buffer_read_memory ( bfd_vma  memaddr,
bfd_byte myaddr,
unsigned int  length,
struct disassemble_info info 
)

Definition at line 28 of file dis-buf.c.

{
  unsigned int opb = info->octets_per_byte;
  unsigned int end_addr_offset = length / opb;
  unsigned int max_addr_offset = info->buffer_length / opb; 
  unsigned int octets = (memaddr - info->buffer_vma) * opb;

  if (memaddr < info->buffer_vma
      || memaddr - info->buffer_vma + end_addr_offset > max_addr_offset)
    /* Out of bounds.  Use EIO because GDB uses it.  */
    return EIO;
  memcpy (myaddr, info->buffer + octets, length);

  return 0;
}

Here is the caller graph for this function:

Definition at line 78 of file dis-buf.c.

{
  char buf[30];

  sprintf_vma (buf, addr);
  (*info->fprintf_func) (info->stream, "0x%s", buf);
}

Here is the caller graph for this function:

int generic_symbol_at_address ( bfd_vma addr  ATTRIBUTE_UNUSED,
struct disassemble_info *info  ATTRIBUTE_UNUSED 
)

Definition at line 89 of file dis-buf.c.

{
  return 1;
}
bfd_boolean generic_symbol_is_valid ( asymbol *sym  ATTRIBUTE_UNUSED,
struct disassemble_info *info  ATTRIBUTE_UNUSED 
)

Definition at line 98 of file dis-buf.c.

{
  return TRUE;
}
void perror_memory ( int  status,
bfd_vma  memaddr,
struct disassemble_info info 
)

Definition at line 51 of file dis-buf.c.

{
  if (status != EIO)
    /* Can't happen.  */
    info->fprintf_func (info->stream, _("Unknown error %d\n"), status);
  else
    {
      char buf[30];

      /* Actually, address between memaddr and memaddr + len was
        out of bounds.  */
      sprintf_vma (buf, memaddr);
      info->fprintf_func (info->stream,
                       _("Address 0x%s is out of bounds.\n"), buf);
    }
}

Here is the caller graph for this function: