diff options
Diffstat (limited to 'lldb/test/functionalities')
4 files changed, 38 insertions, 1 deletions
diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/Makefile b/lldb/test/functionalities/breakpoint/breakpoint_command/Makefile index b09a579159d..a6376f9b165 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/Makefile +++ b/lldb/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/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py index b96d20d37df..616464e2104 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ b/lldb/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/lldb/test/functionalities/breakpoint/breakpoint_command/a.c b/lldb/test/functionalities/breakpoint/breakpoint_command/a.c new file mode 100644 index 00000000000..870e4a6ab16 --- /dev/null +++ b/lldb/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/lldb/test/functionalities/breakpoint/breakpoint_command/b.c b/lldb/test/functionalities/breakpoint/breakpoint_command/b.c new file mode 100644 index 00000000000..02b78e7bd85 --- /dev/null +++ b/lldb/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; +} |