1 /* Copyright (C) 2021-2024 Free Software Foundation, Inc.
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)
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. */
25 #include "dbe_structs.h"
26 #include "Experiment.h"
33 template <class ITEM
> class Vector
;
36 class Descendants
/* : public DbeLock */
41 CallStackNode
*find (Histable
*hi
, int *index
);
42 void append (CallStackNode
*item
);
43 void insert (int ind
, CallStackNode
*item
);
55 CallStackNode
*first_data
[4];
58 class CallStackNode
: public Descendants
61 CallStackNode (CallStackNode
*_ancestor
, Histable
*_instr
);
63 bool compare (long start
, long end
, Vector
<Histable
*> *objs
, CallStackNode
*mRoot
);
78 CallStackNode
*alt_node
;
80 CallStackNode
*ancestor
;
86 static CallStack
*getInstance (Experiment
*exp
);
87 virtual ~CallStack () { };
89 virtual void add_stack (DataDescriptor
*dDscr
, long idx
, FramePacket
*frp
,
90 cstk_ctx_chunk
* cstCtxChunk
) = 0;
92 // Creates a call stack representation for objs and
93 // returns an opaque pointer to it
94 virtual void *add_stack (Vector
<Histable
*> *objs
) = 0;
97 virtual void print (FILE *) = 0;
99 // Call stack inquiries
100 static int stackSize (void *stack
);
101 static Histable
*getStackPC (void *stack
, int n
);
102 static Vector
<Histable
*> *getStackPCs (void *stack
, bool get_hide_stack
= false);
103 static void setHideStack (void *stack
, void *hideStack
);
104 static int compare (void *stack1
, void *stack2
);
106 virtual CallStackNode
*
114 #endif /* _CALLSTACK_H */