[lldb-dev] [Bug 44649] New: const char * summary providers don't respect the bounds of char[] arrays

2020-01-24 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=44649

Bug ID: 44649
   Summary: const char * summary providers don't respect the
bounds of char[] arrays
   Product: lldb
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: lab...@google.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

If I have a char[3] variable, it seems reasonable to have the summary provider
stop at the third character even if it did not encounter a nul character.

This is what gdb does. Lldb currently does not do that:

$ cat /tmp/a.cc 
struct A {
  char arr[3];
  char a, b, c;
} a;

int main() {
  a.arr[0] = 'a';
  a.arr[1] = 'r';
  a.arr[2] = 'r';
  a.a = 0x42;
  a.b = 0x47;
  a.c = 0x42;
  return 0;
}
$ bin/clang /tmp/a.cc -g -o /tmp/a.out
$ bin/lldb /tmp/a.out 
(lldb) target create "/tmp/a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) target stop-hook add -o "v a"
Stop hook #1 added.
(lldb) b main
Breakpoint 1: where = a.out`main + 13 at a.cc:7:12, address =
0x0040112d
(lldb) r
Process 15123 launched: '/tmp/a.out' (x86_64)
(A) ::a = (arr = "", a = '\0', b = '\0', c = '\0')

Process 15123 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x0040112d a.out`main at a.cc:7:12
   4} a;
   5
   6int main() {
-> 7  a.arr[0] = 'a';
   8  a.arr[1] = 'r';
   9  a.arr[2] = 'r';
   10 a.a = 0x42;
(lldb) n
(A) ::a = (arr = "a", a = '\0', b = '\0', c = '\0')

Process 15123 stopped
* thread #1, name = 'a.out', stop reason = step over
frame #0: 0x00401135 a.out`main at a.cc:8:12
   5
   6int main() {
   7  a.arr[0] = 'a';
-> 8  a.arr[1] = 'r';
   9  a.arr[2] = 'r';
   10 a.a = 0x42;
   11 a.b = 0x47;
(lldb) 
(A) ::a = (arr = "ar", a = '\0', b = '\0', c = '\0')

Process 15123 stopped
* thread #1, name = 'a.out', stop reason = step over
frame #0: 0x0040113d a.out`main at a.cc:9:12
   6int main() {
   7  a.arr[0] = 'a';
   8  a.arr[1] = 'r';
-> 9  a.arr[2] = 'r';
   10 a.a = 0x42;
   11 a.b = 0x47;
   12 a.c = 0x42;
(lldb) 
(A) ::a = (arr = "arr", a = '\0', b = '\0', c = '\0')

Process 15123 stopped
* thread #1, name = 'a.out', stop reason = step over
frame #0: 0x00401145 a.out`main at a.cc:10:7
   7  a.arr[0] = 'a';
   8  a.arr[1] = 'r';
   9  a.arr[2] = 'r';
-> 10 a.a = 0x42;
   11 a.b = 0x47;
   12 a.c = 0x42;
   13 return 0;
(lldb) 
(A) ::a = (arr = "arrB", a = 'B', b = '\0', c = '\0')

Process 15123 stopped
* thread #1, name = 'a.out', stop reason = step over
frame #0: 0x0040114d a.out`main at a.cc:11:7
   8  a.arr[1] = 'r';
   9  a.arr[2] = 'r';
   10 a.a = 0x42;
-> 11 a.b = 0x47;
   12 a.c = 0x42;
   13 return 0;
   14   }
(lldb) 
(A) ::a = (arr = "arrBG", a = 'B', b = 'G', c = '\0')

Process 15123 stopped
* thread #1, name = 'a.out', stop reason = step over
frame #0: 0x00401155 a.out`main at a.cc:12:7
   9  a.arr[2] = 'r';
   10 a.a = 0x42;
   11 a.b = 0x47;
-> 12 a.c = 0x42;
   13 return 0;
   14   }
(lldb) 
(A) ::a = (arr = "arrBGB", a = 'B', b = 'G', c = 'B')

Process 15123 stopped
* thread #1, name = 'a.out', stop reason = step over
frame #0: 0x0040115d a.out`main at a.cc:13:3
   10 a.a = 0x42;
   11 a.b = 0x47;
   12 a.c = 0x42;
-> 13 return 0;
   14   }

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 44659] New: Hardware breakpoints are not marked as such on arm/aarch64

2020-01-24 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=44659

Bug ID: 44659
   Summary: Hardware breakpoints are not marked as such on
arm/aarch64
   Product: lldb
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: jdevliegh...@apple.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

BreakpointSites know they're backed by hardware based on whether the "hardware
index" is set. This does not appear the to be done for arm/aarch64, which
caused the hardware breakpoints to appear as software breakpoints. 


2: name = 'hw_break_function'
2.1: 
  module =
/home/buildslave/buildslave/lldb-cmake-aarch64/build/lldb-test-build.noindex/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.test_hw_break_set_disable_multi_thread_linux/a.out
  compile unit = main.cpp
  function = hw_break_function(unsigned int)
  location =
/home/buildslave/buildslave/lldb-cmake-aarch64/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/main.cpp:21:57
  address = 0x00400d7c
  resolved = true
  hardware = false
  hit count = 2'

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev