[lldb-dev] [Bug 48382] New: lldb wrongly stopped at an unexecuted statement

via lldb-dev lldb-dev at lists.llvm.org
Thu Dec 3 17:45:58 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48382

            Bug ID: 48382
           Summary: lldb wrongly stopped at an unexecuted statement
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: yangyibiao at nju.edu.cn
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

Created attachment 24233
  --> https://bugs.llvm.org/attachment.cgi?id=24233&action=edit
the binary 'a.out'

$ cat small.c
/* { dg-options "-O2" } */
/* { dg-do run } */

static const long long int TagTypeNumber = 0xffff000000000000ll;

long long int x;

void foo(void)
{
  x = TagTypeNumber + 1;
}

int main(int argc, char **argv)
{
  if (argc > 0)
    foo ();

  if ((x & TagTypeNumber) == TagTypeNumber)
  {
    unsigned y = (unsigned)x;
    __builtin_printf ("v: %u\n", y);
    if (y != 1)
      __builtin_abort ();
  }

  return 0;
}

$ clang -O2 -g small.c

$ lldb a.out
(lldb) target create "a.out"
Current executable set to '/root/DeVIL/a.out' (x86_64).
(lldb) b 16
Breakpoint 1: where = a.out`main + 45 at small.c:18:8, address =
0x000000000040058d
(lldb) r
Process 45445 launched: '/root/DeVIL/a.out' (x86_64)
v: 1
Process 45445 exited with status = 0 (0x00000000)
(lldb)



########################################
# when step by step, lldb is wrongly stopped at line 16 as follows.
########################################

$ lldb a.out
(lldb) target create "a.out"
Current executable set to '/root/DeVIL/a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 11 at small.c:15:12, address =
0x000000000040056b
(lldb) r
   13   int main(int argc, char **argv)
   14   {
-> 15     if (argc > 0)
   16       foo ();
   17
(lldb) s
   13   int main(int argc, char **argv)
   14   {
   15     if (argc > 0)
-> 16       foo ();
   17
(lldb) s
   8    void foo(void)
   9    {
-> 10     x = TagTypeNumber + 1;
   11   }


##########################
# clang and lldb versin

$ clang --version
Ubuntu clang version
12.0.0-++20201202063839+f0193623297-1~exp1~20201202174527.2077
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ lldb --version
lldb version 12.0.0

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20201204/847f694b/attachment.html>


More information about the lldb-dev mailing list