summaryrefslogtreecommitdiffstats
path: root/tester/covoar/TraceList.cc
blob: a4e29e61efd5d3c405939eeebb37be79818743ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "TraceList.h"
#include <stdio.h>

namespace Trace {

    TraceList::TraceList()
    {
    }

    TraceList::~TraceList()
    {
    }

    void TraceList::add(
      uint32_t         lowAddressArg,
      uint32_t         highAddressArg,
      exitReason_t     why
    )
    {
      traceRange_t t;

      t.lowAddress = lowAddressArg;
      t.length = highAddressArg - lowAddressArg;
      t.exitReason = why;

      set.push_back( t );
    }

    void TraceList::ShowTrace( traceRange_t *t)
    {
      printf(
        "Start 0x%x, length 0x%03x Reason %d\n",
        t->lowAddress,
        t->length,
        t->exitReason
      );
    }

    void  TraceList::ShowList()
    {
      ranges_t::iterator   ritr;
      traceRange_t         t;

      for ( ritr=set.begin(); ritr != set.end(); ritr++ ) {
        t = *ritr;
        ShowTrace( &t );
      }
    }

}