[Lldb-commits] [lldb] r321271 - Work around test failures on red-hat linux

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 2 12:02:48 PST 2018


This is a trivial thing, but you can use:

   lldbutil.run_break_set_by_source_regexp

rather than having to capture the line number matching the regex and setting a line breakpoint from that.  You are setting them in different source files, so you'll have to pass:

extra_options = "-f 'One/One.c'"

etc.    But that's still a lot more readable.

Jim

> On Dec 21, 2017, at 6:40 AM, Pavel Labath via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> 
> +        self.One_line = line_number('One/One.c', '// break here')
> +        self.Two_line = line_number('Two/Two.c', '// break here')
> +        self.main_line = line_number('main.c', '// break here')
> +
>     def test_conflicting_symbols(self):
>         self.build()
>         exe = os.path.join(os.getcwd(), "a.out")
> @@ -27,15 +34,12 @@ class TestConflictingSymbols(TestBase):
>         environment = self.registerSharedLibrariesWithTarget(
>             target, ['One', 'Two'])
> 
> -        One_line = line_number('One/One.c', '// break here')
> -        Two_line = line_number('Two/Two.c', '// break here')
> -        main_line = line_number('main.c', '// break here')
>         lldbutil.run_break_set_command(
> -            self, 'breakpoint set -f One.c -l %s' % (One_line))
> +            self, 'breakpoint set -f One.c -l %s' % (self.One_line))
>         lldbutil.run_break_set_command(
> -            self, 'breakpoint set -f Two.c -l %s' % (Two_line))
> +            self, 'breakpoint set -f Two.c -l %s' % (self.Two_line))
>         lldbutil.run_break_set_by_file_and_line(
> -            self, 'main.c', main_line, num_expected_locations=1, loc_exact=True)
> +            self, 'main.c', self.main_line, num_expected_locations=1, loc_exact=True)
> 



More information about the lldb-commits mailing list