Ignore:
Timestamp:
Jul 15, 2009, 10:41:01 AM (15 years ago)
Author:
rosiere
Message:

1) valgrind fix
2) debug file on/off

Location:
trunk/IPs/systemC/Environment/Data/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/Environment/Data/src/Data_read.cpp

    r81 r134  
    66  bool Data::read (uint32_t address, uint32_t size, char * & data_dest)
    77  {
     8//     for (uint32_t i=0; i<size; ++i)
     9//       data_dest[i] = '\0';
     10   
    811    uint32_t num_seg = 0;
    9     bool     res     = false;
    10 
     12   
    1113    // Scan all segment
    12     for (num_seg = 0; num_seg < nb_seg; num_seg ++)
     14    for (; num_seg < nb_seg; num_seg ++)
    1315      if (segment[num_seg]->test (address,size) == true)
    1416        {
    1517          segment[num_seg]->read (address,size,data_dest);
    16           res = true;
    1718          break;
    1819        }
    1920   
    20     return res;
     21    return (num_seg < nb_seg);
    2122  }
    2223
  • trunk/IPs/systemC/Environment/Data/src/Segment.cpp

    r81 r134  
    44namespace data {
    55 
    6   Segment::Segment (void)
    7   {
    8     name     = "";
    9     base     = 0;
    10     size     = 0;
    11     uncached = false;
    12     data     = NULL;
    13     type     = TYPE_TARGET_MEMORY;
    14     index    = 0;
    15   }
     6//   Segment::Segment (void)
     7//   {
     8//     name     = "";
     9//     base     = 0;
     10//     size     = 0;
     11//     uncached = false;
     12//     data     = NULL;
     13//     type     = TYPE_TARGET_MEMORY;
     14//     index    = 0;
     15//   }
    1616
    1717  Segment::Segment (SEGMENT_TABLE_ENTRY * segment)
     
    2525    type     = TYPE_TARGET_MEMORY;
    2626    index    = 0;
     27    memset((void*)data,0,size * sizeof(char));
    2728  }
    2829
  • trunk/IPs/systemC/Environment/Data/src/Segment_read.cpp

    r81 r134  
    11#include "../include/Segment.h"
     2#include "../../Common/include/Debug.h"
    23
    34namespace environment {
     
    67  void Segment::read (uint32_t address, uint32_t size, char * & data_dest)
    78  {
     9//     _cout(true,"  * kane\n");
     10//     _cout(true,"    * address : %.8x\n",address);
    811    for (uint32_t it = 0; it < size ; it ++)
    9       data_dest [it] = data[address-base+it];
     12      {
     13        data_dest [it] = data[address-base+it];
     14//      _cout(true,"    * [%d] : %.8x\n",address-base+it,static_cast<uint32_t>(data_dest [it]));
     15      }
    1016  }
    1117 
  • trunk/IPs/systemC/Environment/Data/src/loadexec.c

    r122 r134  
    142142   *eoffset       = ringo.ladr;
    143143   ringo.mem      = malloc(*esize * sizeof(char));
     144
     145   memset((void *)ringo.mem,0,*esize * sizeof(char));
     146   
    144147   /* Start over again from the start of the memory */
    145148   bfd_map_over_sections(exec, bindsection, &ringo);
Note: See TracChangeset for help on using the changeset viewer.