This file is indexed.

/usr/include/srecord/memory/walker/compare.h is in libsrecord-dev 1.56-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//
// srecord - manipulate eprom load files
// Copyright (C) 2000, 2002, 2005-2008, 2010 Peter Miller
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see
// <http://www.gnu.org/licenses/>.
//

#ifndef SRECORD_MEMORY_WALKER_COMPARE_H
#define SRECORD_MEMORY_WALKER_COMPARE_H

#include <srecord/interval.h>
#include <srecord/memory/walker.h>

namespace srecord
{

class memory; // forward

/**
  * The srecord::memory_walker_compare class is used to represent a memory
  * walker which compares memory data with another memory instance.
  *
  * Note that this is strictly an improper subset comparison.  I.e. that
  * all bytes passed to the observe method exists in the other memory
  * instance.
  *
  * For a complete equality test, you need to use this comparison both
  * ways round.
  */
class memory_walker_compare:
    public memory_walker
{
public:
    typedef boost::shared_ptr<memory_walker_compare> pointer;

    /**
      * The destructor.
      */
    virtual ~memory_walker_compare();

private:
    /**
      * The constructor.  It is private on purpose, use thr #create
      * class method instead.
      *
      * @param other
      *     The other memory instance to be checked against this one.
      * @param check_wrong
      *     Whether or not to check that the data agrees as well as the
      *     address ranges.
      */
    memory_walker_compare(const memory &other, bool check_wrong);

public:
    /**
      * The create class method is used to create new dynamically
      * allocated instances of this class.
      *
      * @param other
      *     The other memory instance to be checked against this one.
      * @param check_wrong
      *     Whether or not to check that the data agrees as well as the
      *     address ranges.
      */
    static pointer create(const memory &other, bool check_wrong);

    // See base class for documentation.
    virtual void observe(unsigned long, const void *, int);

    /**
      * The print method is used to print the results of the comparison
      * on the standard output.
      *
      * @param caption
      *     The text to place at the start of the listing.
      */
    void print(const char *caption) const;

    /**
      * The same method is used to discover whether the result of the
      * comparison indicate that the two memory instances are the same.
      */
    bool same() const;

private:
    /**
      * The other instance variable is used to remember the other memory
      * instance to be checked against this one.
      */
    const memory &other;

    /**
      * The check_wrong instance variable is used to remember whether or
      * not to check that the data agrees as well as the address ranges.
      */
    bool check_wrong;

    /**
      * The unset instance variable is used to remember which bytes of
      * data given to the observe method are NOT present in the other
      * memory instance.
      */
    interval unset;

    /**
      * The wrong instance variable is used to remember which bytes of
      * data given to the observer method were different than the ones
      * in the other memory instance.
      */
    interval wrong;

    /**
      * The default constructor.  Do not use.
      */
    memory_walker_compare();

    /**
      * The copy constructor.  Do not use.
      */
    memory_walker_compare(const memory_walker_compare &);

    /**
      * The assignment operator.  Do not use.
      */
    memory_walker_compare &operator=(const memory_walker_compare &);
};

};

#endif // SRECORD_MEMORY_WALKER_COMPARE_H