Update year range in gprofng copyright notices
[binutils-gdb.git] / gprofng / src / DataObject.h
blobaffdaf59afe2d46332c65dfb7d5d854dc824db16
1 /* Copyright (C) 2021-2023 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 _DATAOBJECT_H
22 #define _DATAOBJECT_H
24 // A DataObject object represents a distinct dataobject.
26 #include "dbe_structs.h"
27 #include "Histable.h"
29 extern char *DOBJ_UNSPECIFIED;
30 extern char *DOBJ_UNIDENTIFIED;
31 extern char *DOBJ_UNDETERMINED;
32 extern char *DOBJ_ANON;
33 extern char *DOBJ_UNASCERTAINABLE;
34 extern char *DOBJ_UNVERIFIABLE;
35 extern char *DOBJ_UNRESOLVABLE;
37 class DataObject : public Histable
39 public:
40 DataObject ();
41 ~DataObject ();
43 static const unsigned UNSPECIFIED_ID = 0xFFFFFFFF;
45 int64_t size; // size of the dataobject in bytes
46 int64_t offset; // offset of dataobject from parent
47 DataObject *parent; // this dataobject's parent (if any)
48 Histable *scope; // scope of this dataobject
49 DataObject *master; // this dataobject's master (if any)
51 Histable_type get_type () { return DOBJECT; }
52 int64_t get_size () { return size; }
53 int64_t get_offset () { return offset; }
54 DataObject *get_parent () { return parent; }
55 DataObject *get_master () { return master; }
56 char *get_typename () { return _typename; }
57 char *get_instname () { return _instname; }
58 Histable *get_scope () { return scope; }
60 char *get_unannotated_name ()
61 { // name without a <Scalar> or <Unknown> prefix
62 if (_unannotated_name)
63 return _unannotated_name;
64 return get_name ();
67 uint64_t get_addr ();
68 char get_offset_mark ();
69 char *get_offset_name ();
70 void set_dobjname (char *type_name, char *inst_name); // dobj->parent must already be set
71 void set_name (char *);
72 Histable *convertto (Histable_type type, Histable *obj = NULL);
73 DbeEA *find_dbeEA (Vaddr EA);
75 private:
76 char *_unannotated_name; // name without a <Scalar> or <Unknown> prefix
77 char *_typename; // name of this dataobject's type
78 char *_instname; // name of this dataobject instance
79 Vector<DbeEA*> *EAs;
82 #endif /* _DATAOBJECT_H */