[lldb-dev] LLDB gcc std lib data formatters

2018-02-19 Thread Bryan Bennetts via lldb-dev
Hi,

Apologies if this is  the wrong forum for this question - redirection to
the correct place would be appreciated...

I am running

lldb --version
lldb-900.0.64
  Swift-4.0

with binaries compiled using g++

g++-5 --version
g++-5 (Homebrew GCC 5.5.0_2) 5.5.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.(although I have tried a build from repo as well)


The website  implies that gcc std
library formatters should be available:

By default, several categories are created in LLDB:

   - default: this is the category where every formatter ends up, unless
   another category is specified
   - objc: formatters for basic and common Objective-C types that do not
   specifically depend on Mac OS X
   - gnu-libstdc++: formatters for std::string, std::vector, std::list and
   std::map as implemented by libstdcpp

However I see:

(lldb) type category list

   Category: default (enabled)
Category: VectorTypes (enabled, applicable for language(s): objective-c++)
Category: runtime-synthetics (enabled, applicable for language(s):
objective-c++, swift)
Category: system (enabled, applicable for language(s): objective-c++)
(lldb) type category enable gnu-libstdc++

   warning: empty category enabled (typo?)

And the std containers do not print nicely:

containerTest: cat main.cpp
#include 
#include 

using namespace std;

int main()
{
auto v = vector< unsigned >{ 0, 1, 2, 3, 4, 5, 6, 7, 9 };

for( auto i : v )
{
cout << i << "\n";
}

return( 0 );
}
 containerTest: g++-5 -g -std=c++11  main.cpp
/var/folders/2_/07xjgwq904376gst9m3ddb10gn/T//cctjpiwL.s:157:11:
warning: section "__textcoal_nt" is deprecated
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
 ^  ~
/var/folders/2_/07xjgwq904376gst9m3ddb10gn/T//cctjpiwL.s:157:11: note:
change section name to "__text"
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
 ^  ~
/var/folders/2_/07xjgwq904376gst9m3ddb10gn/T//cctjpiwL.s:386:11:
warning: section "__textcoal_nt" is deprecated
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
 ^  ~
/var/folders/2_/07xjgwq904376gst9m3ddb10gn/T//cctjpiwL.s:386:11: note:
change section name to "__text"
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
 ^  ~
/var/folders/2_/07xjgwq904376gst9m3ddb10gn/T//cctjpiwL.s:430:11:
warning: section "__textcoal_nt" is deprecated
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
 ^  ~
/var/folders/2_/07xjgwq904376gst9m3ddb10gn/T//cctjpiwL.s:430:11: note:
change section name to "__text"
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
 ^  ~
/var/folders/2_/07xjgwq904376gst9m3ddb10gn/T//cctjpiwL.s:683:11:
warning: section "__textcoal_nt" is deprecated
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
 ^  ~
/var/folders/2_/07xjgwq904376gst9m3ddb10gn/T//cctjpiwL.s:683:11: note:
change section name to "__text"
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
 ^  ~
 containerTest: lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 13 at main.cpp:8, address =
0x00011673
(lldb) run
Process 98294 launched: './a.out' (x86_64)
Process 98294 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00011673 a.out`main at main.cpp:8
   5
   6int main()
   7{
-> 8auto v = vector< unsigned >{ 0, 1, 2, 3, 4, 5, 6, 7, 9 };
   9
   10  for( auto i : v )
   11  {
Target 0: (a.out) stopped.
(lldb) n
Process 98294 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
frame #0: 0x000116bd a.out`main at main.cpp:10
   7{
   8auto v = vector< unsigned >{ 0, 1, 2, 3, 4, 5, 6, 7, 9 };
   9
-> 10  for( auto i : v )
   11  {
   12  cout << i << "\n";
   13  }
Target 0: (a.out) stopped.
(lldb) p v
(vector >) $0 = {
  _Vector_base > = {
_M_impl = {
  _M_start = 0x000100402050
  _M_finish = 0x000100402074
  _M_end_of_storage = 0x000100402074
}
  }
}
(lldb)

Anyone able to point me at either a python pretty printer or solution to
this?

Cheers, Bryan.
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 36435] New: Unexpected conditional breakpoint hit

2018-02-19 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=36435

Bug ID: 36435
   Summary: Unexpected conditional breakpoint hit
   Product: lldb
   Version: 6.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: danti...@nvidia.com
CC: llvm-b...@lists.llvm.org

Created attachment 19898
  --> https://bugs.llvm.org/attachment.cgi?id=19898&action=edit
Sample program

In GDB:

$ gdb -q t-thread3
Reading symbols from t-thread3...done.
(gdb) b f if v > 1
Breakpoint 1 at 0x400a4c: file t-thread3.cc, line 14.
(gdb) r
Starting program: /home/dantipov/tmp/t-thread3 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x76edf700 (LWP 16244)]
[New Thread 0x766de700 (LWP 16245)]
[New Thread 0x75edd700 (LWP 16246)]
[New Thread 0x756dc700 (LWP 16247)]
[Switching to Thread 0x75edd700 (LWP 16246)]

Thread 4 "t-thread3" hit Breakpoint 1, f (v=2) at t-thread3.cc:14
14g (v);
(gdb) c
Continuing.
[Switching to Thread 0x756dc700 (LWP 16247)]

Thread 5 "t-thread3" hit Breakpoint 1, f (v=3) at t-thread3.cc:14
14g (v);
(gdb) c
Continuing.
[Switching to Thread 0x75edd700 (LWP 16246)]

Thread 4 "t-thread3" hit Breakpoint 1, f (v=2) at t-thread3.cc:14
14g (v);
(gdb) c
Continuing.
[Switching to Thread 0x756dc700 (LWP 16247)]

Thread 5 "t-thread3" hit Breakpoint 1, f (v=3) at t-thread3.cc:14
14g (v);
(gdb) c
Continuing.
[Switching to Thread 0x75edd700 (LWP 16246)]

Thread 4 "t-thread3" hit Breakpoint 1, f (v=2) at t-thread3.cc:14
14g (v);
(gdb) c
Continuing.
[Switching to Thread 0x756dc700 (LWP 16247)]

Thread 5 "t-thread3" hit Breakpoint 1, f (v=3) at t-thread3.cc:14
14g (v);
(gdb) c
Continuing.
[Switching to Thread 0x75edd700 (LWP 16246)]

Thread 4 "t-thread3" hit Breakpoint 1, f (v=2) at t-thread3.cc:14
14g (v);

In LLDB:

$ /home/dantipov/.local/llvm-6.0.0/bin/lldb t-thread3
(lldb) target create "t-thread3"
Current executable set to 't-thread3' (x86_64).
(lldb) breakpoint set -n f -c 'v > 1'
Breakpoint 1: where = t-thread3`f(int) + 11 at t-thread3.cc:14, address =
0x00400a4c
(lldb) run
Process 16274 launched: '/home/dantipov/tmp/t-thread3' (x86_64)
Process 16274 stopped
* thread #2, name = 't-thread3', stop reason = breakpoint 1.1
frame #0: 0x00400a4c t-thread3`f(v=0) at t-thread3.cc:14
   11   {
   12 while (true)
   13   {
-> 14 g (v);  ;; 0 > 1
?
   15   }
   16   }
   17   
  thread #3, name = 't-thread3', stop reason = breakpoint 1.1
frame #0: 0x00400a4c t-thread3`f(v=1) at t-thread3.cc:14
   11   {
   12 while (true)
   13   {
-> 14 g (v);  ;; 1 > 1
?
   15   }
   16   }
   17   
  thread #4, name = 't-thread3', stop reason = breakpoint 1.1
frame #0: 0x00400a4c t-thread3`f(v=2) at t-thread3.cc:14
   11   {
   12 while (true)
   13   {
-> 14 g (v);  ;; OK
   15   }
   16   }
   17   
(lldb) process continue
Process 16274 resuming
Process 16274 stopped
* thread #2, name = 't-thread3', stop reason = breakpoint 1.1
frame #0: 0x00400a4c t-thread3`f(v=0) at t-thread3.cc:14
   11   {
   12 while (true)
   13   {
-> 14 g (v);  ;; 0 > 1
?
   15   }
   16   }
   17   
  thread #3, name = 't-thread3', stop reason = breakpoint 1.1
frame #0: 0x00400a4c t-thread3`f(v=1) at t-thread3.cc:14
   11   {
   12 while (true)
   13   {
-> 14 g (v);  ;; 1 > 1
?
   15   }
   16   }
   17   
  thread #4, name = 't-thread3', stop reason = breakpoint 1.1
frame #0: 0x00400a4c t-thread3`f(v=2) at t-thread3.cc:14
   11   {
   12 while (true)
   13   {
-> 14 g (v);  ;; OK
   15   }
   16   }
   17

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


[lldb-dev] [Bug 36436] New: Incorrect size of std::array

2018-02-19 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=36436

Bug ID: 36436
   Summary: Incorrect size of std::array
   Product: lldb
   Version: 6.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: danti...@nvidia.com
CC: llvm-b...@lists.llvm.org

Created attachment 19899
  --> https://bugs.llvm.org/attachment.cgi?id=19899&action=edit
Sample program

$ /home/dantipov/.local/llvm-6.0.0/bin/lldb t-array
(lldb) target create "t-array"
Current executable set to 't-array' (x86_64).
(lldb) b t-array.cc:10
Breakpoint 1: where = t-array`main + 92 at t-array.cc:10, address =
0x00400573
(lldb) r
Process 16720 launched: '/home/dantipov/tmp/t-array' (x86_64)
Process 16720 stopped
* thread #1, name = 't-array', stop reason = breakpoint 1.1
frame #0: 0x00400573 t-array`main(argc=1, argv=0x7fffe318)
at t-array.cc:10
   7  std::array y { 1., 2., 3. };
   8  (void) x;
   9  (void) y;
-> 10 return 0;
   11   }
(lldb) fr v -a
(std::array) x = {;; Why 8?
  _M_elems = ([0] = 1, [1] = 2, [2] = 3, [3] = 4, [4] = 5, [5] = 6)
}
(std::array) y = {  ;;
Likewise
  _M_elems = ([0] = 1.11109996, [1] = 2.22219992, [2] = 3.0011)
}

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


[lldb-dev] [Bug 36438] New: Unable to step into __cxa_allocate_exception

2018-02-19 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=36438

Bug ID: 36438
   Summary: Unable to step into __cxa_allocate_exception
   Product: lldb
   Version: 6.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: danti...@nvidia.com
CC: llvm-b...@lists.llvm.org

Created attachment 19902
  --> https://bugs.llvm.org/attachment.cgi?id=19902&action=edit
Sample program

$ /home/dantipov/.local/llvm-6.0.0/bin/lldb t-throw
(lldb) target create "t-throw"
Current executable set to 't-throw' (x86_64).
(lldb) b t-throw.cc:10
Breakpoint 1: where = t-throw`main + 18 at t-throw.cc:10, address =
0x004009a9
(lldb) r
Process 22330 launched: '/home/dantipov/tmp/t-throw' (x86_64)
Process 22330 stopped
* thread #1, name = 't-throw', stop reason = breakpoint 1.1
frame #0: 0x004009a9 t-throw`main(argc=1, argv=0x7fffe2f8)
at t-throw.cc:10
   7try {
   8  try {
   9try {
-> 10 throw new T ();
   11   } catch (...) {
   12 throw;
   13   }
(lldb) step
gotcha
Process 22330 exited with status = 1 (0x0001) 

vs:

$ gdb -q t-throw 
Reading symbols from t-throw...done.
(gdb) b t-throw.cc:10
Breakpoint 1 at 0x4009a9: file t-throw.cc, line 10.
(gdb) r
Starting program: /home/dantipov/tmp/t-throw 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main (argc=1, argv=0x7fffe2f8) at t-throw.cc:10
10throw new T ();
(gdb) s
__cxxabiv1::__cxa_allocate_exception (thrown_size=8) at
../../../../libstdc++-v3/libsupc++/eh_alloc.cc:280
280 {
(gdb) bt
#0  __cxxabiv1::__cxa_allocate_exception (thrown_size=8) at
../../../../libstdc++-v3/libsupc++/eh_alloc.cc:280
#1  0x004009b3 in main (argc=1, argv=0x7fffe2f8) at t-throw.cc:10

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


[lldb-dev] [6.0.0 Release] TIme to wrap it up

2018-02-19 Thread Hans Wennborg via lldb-dev
Dear everyone,

The release schedule has snuck up on me again, and it's time to wrap
up the release.

We won't make it to the final tag on the 21st as per the schedule, but
I would like to get all outstanding blockers fixed and rc3 tagged by
Friday. Hopefully this would be the last rc and we could go to final
soon after.

If you're involved in a release-blocking bug (see
http://llvm.org/PR35804), please try to get it resolved as soon as
possible.

If you were planning to run some additional testing before the
release, it's high time.

I would also like to get the release notes ready this week. If you've
been meaning to write something but didn't get around to it yet, now
is the time.

Thanks,
Hans
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 36013] LLDB: StandardStartupTest.TestStopReplyContainsThreadPcs fails on (32-bit) x86

2018-02-19 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=36013

lab...@google.com changed:

   What|Removed |Added

   Assignee|lldb-dev@lists.llvm.org |lab...@google.com
 CC||lab...@google.com

--- Comment #3 from lab...@google.com ---
Fixed by r325511 (there was nothing wrong with the debugger, just the test was
not 32bit-compatible).

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