summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-01-20 02:10:52 +0000
committerGreg Clayton <gclayton@apple.com>2012-01-20 02:10:52 +0000
commit415c72cbfbf108c8bdbb42f879226f1c3d7054cc (patch)
treeea3fdaf1b59ac5732ad27c41faf7bf08d5fc5e6c
parentb359e67d2db61a369b7854a20b4da61fdc5eeb6e (diff)
downloadbcm5719-llvm-415c72cbfbf108c8bdbb42f879226f1c3d7054cc.tar.gz
bcm5719-llvm-415c72cbfbf108c8bdbb42f879226f1c3d7054cc.zip
Add some usage documentation to the top of the source file.
llvm-svn: 148527
-rw-r--r--lldb/examples/darwin/heap_find/heap_find.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/lldb/examples/darwin/heap_find/heap_find.c b/lldb/examples/darwin/heap_find/heap_find.c
index 1ea4590af5b..ae1424f0af7 100644
--- a/lldb/examples/darwin/heap_find/heap_find.c
+++ b/lldb/examples/darwin/heap_find/heap_find.c
@@ -1,3 +1,36 @@
+//===-- head_find.c ---------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file compiles into a dylib and can be used on darwin to find data that
+// is contained in active malloc blocks. To use this make the project, then
+// load the shared library in a debug session while you are stopped:
+//
+// (lldb) process load /path/to/libheap.dylib
+//
+// Now you can use the "find_pointer_in_heap" and "find_cstring_in_heap"
+// functions in the expression parser.
+//
+// This will grep everything in all active allocation blocks and print and
+// malloc blocks that contain the pointer 0x112233000000:
+//
+// (lldb) expression find_pointer_in_heap (0x112233000000)
+//
+// This will grep everything in all active allocation blocks and print and
+// malloc blocks that contain the C string "hello" (as a substring, no
+// NULL termination included):
+//
+// (lldb) expression find_cstring_in_heap ("hello")
+//
+// The results will be printed to the STDOUT of the inferior program.
+//
+//===----------------------------------------------------------------------===//
+
#include <assert.h>
#include <ctype.h>
#include <mach/mach.h>
OpenPOWER on IntegriCloud