summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/hwasan/hwasan.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/hwasan/hwasan.cc')
-rw-r--r--compiler-rt/lib/hwasan/hwasan.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler-rt/lib/hwasan/hwasan.cc b/compiler-rt/lib/hwasan/hwasan.cc
index 02aee4d61c6..518cd11ff30 100644
--- a/compiler-rt/lib/hwasan/hwasan.cc
+++ b/compiler-rt/lib/hwasan/hwasan.cc
@@ -220,6 +220,22 @@ void UpdateMemoryUsage() {
void UpdateMemoryUsage() {}
#endif
+struct FrameDescription {
+ uptr PC;
+ const char *Descr;
+};
+
+void InitFrameDescriptors(uptr b, uptr e) {
+ FrameDescription *beg = reinterpret_cast<FrameDescription *>(b);
+ FrameDescription *end = reinterpret_cast<FrameDescription *>(e);
+ // Must have at least one entry, which we can use for a linked list.
+ CHECK_GE(end - beg, 1U);
+ if (Verbosity()) {
+ for (FrameDescription *frame_descr = beg; frame_descr < end; frame_descr++)
+ Printf("Frame: %p %s\n", frame_descr->PC, frame_descr->Descr);
+ }
+}
+
} // namespace __hwasan
// Interface.
@@ -238,6 +254,10 @@ void __hwasan_shadow_init() {
hwasan_shadow_inited = 1;
}
+void __hwasan_init_frames(uptr beg, uptr end) {
+ InitFrameDescriptors(beg, end);
+}
+
void __hwasan_init() {
CHECK(!hwasan_init_is_running);
if (hwasan_inited) return;
OpenPOWER on IntegriCloud