[gdb/testsuite] Fix license text in gdb.reverse/map-to-same-line.{c,exp}
[binutils-gdb.git] / gprofng / src / MemorySpace.h
blob480d1a6c8876eefeeb6a72cfc7e204616a161f2c
1 /* Copyright (C) 2021-2024 Free Software Foundation, Inc.
2 Contributed by Oracle.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
21 #ifndef _MEMORYSPACE_H
22 #define _MEMORYSPACE_H
24 #include <stdio.h>
26 #include "dbe_structs.h"
27 #include "vec.h"
28 #include "Exp_Layout.h"
29 #include "Histable.h"
30 #include "Hist_data.h"
31 #include "Metric.h"
32 #include "HashMap.h"
34 class Experiment;
35 class Expression;
36 class DataView;
37 class DbeView;
38 class MemObj;
40 class MemObjType_t
42 public:
43 MemObjType_t ();
44 ~MemObjType_t ();
45 int type;
46 char *name;
47 char *index_expr;
48 char *machmodel;
49 char mnemonic;
50 char *short_description;
51 char *long_description;
54 class MemorySpace
56 public:
58 MemorySpace (DbeView *_dbev, int subtype);
59 ~MemorySpace ();
61 void reset (void);
63 int
64 getMemObjType (void)
66 return mstype;
69 char *
70 getMemObjTypeName (void)
72 return msname;
75 Expression *
76 getMemObjDef (void)
78 return msindex_exp;
81 // static members, used to define or fetch the various MemorySpaces
82 static void get_filter_keywords (Vector <void*> *res);
83 static Vector<void*> *getMemObjects (void);
84 static void set_MemTabOrder (Vector<int> *);
85 static char *mobj_define (char *, char *, char *, char *, char *);
86 static char *mobj_delete (char *);
87 static MemObjType_t *findMemSpaceByName (const char *mname);
88 static MemObjType_t *findMemSpaceByIndex (int index);
89 static char pickMnemonic (char *name);
90 static Vector<char *> *getMachineModelMemObjs (char *);
92 private:
93 HashMap<uint64_t, MemObj*> *objs;
94 int findMemObject (uint64_t indx);
95 MemObj *lookupMemObject (Experiment *exp, DataView*, long);
96 MemObj *createMemObject (uint64_t, char *moname);
98 int mstype; // type of this memory space
99 char *msname; // name of this memory space
100 Expression *msindex_exp; // index-expression for this memory space
101 char *msindex_exp_str; // string for index-expression
102 Hist_data *hist_data_all; // the cached data for mode=Hist_Data::ALL
103 uint64_t selected_mo_index; // which page, cacheline, etc.
104 int sel_ind; // index of selected object in list
105 DbeView *dbev;
106 int phaseIdx;
107 uint64_t idx_min;
108 uint64_t idx_max;
109 MemObj *unk_memobj;
110 MemObj *total_memobj;
113 #endif /* _MEMORYSPACE_H */