aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2011-09-23 00:54:11 +0000
committerJim Ingham <jingham@apple.com>2011-09-23 00:54:11 +0000
commitd6d47976b71187907c1cdeea86fabf7d5534314f (patch)
treeacc6ada295eba06fa909e96fec3e7563bb4774c5 /test
parent850ac6ede90a64408746be4b962a6ab1d1fc4864 (diff)
downloadlldb-d6d47976b71187907c1cdeea86fabf7d5534314f.tar.gz
Added the ability to restrict breakpoints by function name, function regexp, selector
etc to specific source files. Added SB API's to specify these source files & also more than one module. Added an "exact" option to CompileUnit's FindLineEntry API. git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/functionalities/breakpoint/breakpoint_command/Makefile2
-rw-r--r--test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py19
-rw-r--r--test/functionalities/breakpoint/breakpoint_command/a.c9
-rw-r--r--test/functionalities/breakpoint/breakpoint_command/b.c9
4 files changed, 38 insertions, 1 deletions
diff --git a/test/functionalities/breakpoint/breakpoint_command/Makefile b/test/functionalities/breakpoint/breakpoint_command/Makefile
index b09a57915..a6376f9b1 100644
--- a/test/functionalities/breakpoint/breakpoint_command/Makefile
+++ b/test/functionalities/breakpoint/breakpoint_command/Makefile
@@ -1,5 +1,5 @@
LEVEL = ../../../make
-C_SOURCES := main.c
+C_SOURCES := main.c a.c b.c
include $(LEVEL)/Makefile.rules
diff --git a/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index b96d20d37..616464e21 100644
--- a/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ b/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -77,6 +77,25 @@ class BreakpointCommandTestCase(TestBase):
"print >> here",
"here.close()"])
+ # Next lets try some other breakpoint kinds. First break with a regular expression
+ # and then specify only one file. The first time we should get two locations,
+ # the second time only one:
+ self.expect ("break set -r ._MyFunction",
+ patterns = ["Breakpoint created: [0-9]+: regex = '\._MyFunction', locations = 2"])
+
+ self.expect ("break set -r ._MyFunction -f a.c",
+ patterns = ["Breakpoint created: [0-9]+: regex = '\._MyFunction', locations = 1"])
+
+ self.expect ("break set -r ._MyFunction -f a.c -f b.c",
+ patterns = ["Breakpoint created: [0-9]+: regex = '\._MyFunction', locations = 2"])
+
+ # Now try a source regex breakpoint:
+ self.expect ("break set -p \"is about to return [12]0\" -f a.c -f b.c",
+ patterns = ["Breakpoint created: [0-9]+: source regex = \"is about to return \[12\]0\", locations = 2"])
+
+ self.expect ("break set -p \"is about to return [12]0\" -f a.c",
+ patterns = ["Breakpoint created: [0-9]+: source regex = \"is about to return \[12\]0\", locations = 1"])
+
# Run the program. Remove 'output.txt' if it exists.
if os.path.exists('output.txt'):
os.remove('output.txt')
diff --git a/test/functionalities/breakpoint/breakpoint_command/a.c b/test/functionalities/breakpoint/breakpoint_command/a.c
new file mode 100644
index 000000000..870e4a6ab
--- /dev/null
+++ b/test/functionalities/breakpoint/breakpoint_command/a.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int
+a_MyFunction ()
+{
+ // Set a breakpoint here.
+ printf ("a is about to return 10.\n");
+ return 10;
+}
diff --git a/test/functionalities/breakpoint/breakpoint_command/b.c b/test/functionalities/breakpoint/breakpoint_command/b.c
new file mode 100644
index 000000000..02b78e7bd
--- /dev/null
+++ b/test/functionalities/breakpoint/breakpoint_command/b.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int
+b_MyFunction ()
+{
+ // Set a breakpoint here.
+ printf ("b is about to return 20.\n");
+ return 20;
+}