[lldb-dev] [Bug 44864] lldb -python-path (with lldb installed using apt-get install lldb-9) returns an incorrect path

2020-02-11 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=44864

lab...@google.com changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from lab...@google.com ---
There's been a bunch of python changes since 9.0, and I believe this particular
problem should be fixed in newer versions. 9.0 is not getting any new releases,
so we can't do anything about that version. If you can reproduce this on newer
versions (particularly 10.0, which is at the rc stage now), then please reopen
this bug.

-- 
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 44872] New: Assertion `addr_size == 4 || addr_size == 8' failed when evaluating reference to a static array inside noinline static function in program compiled with -O2

2020-02-11 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=44872

Bug ID: 44872
   Summary: Assertion `addr_size == 4 || addr_size == 8' failed
when evaluating reference to a static array inside
noinline static function in program compiled with -O2
   Product: lldb
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: pierre.vanhoutr...@arm.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

OS: Ubuntu 18.04.3 LTS

lldb version 11.0.0
  clang revision e8c3a6c2606abdbf4f207c8b22e0f532d6247564
  llvm revision e8c3a6c2606abdbf4f207c8b22e0f532d6247564

clang version 11.0.0 (https://github.com/llvm/llvm-project.git
e8c3a6c2606abdbf4f207c8b22e0f532d6247564)
Target: x86_64-unknown-linux-gnu
Thread model: posix

This happens when evaluating 'array' inside the loop (line 5) in the
lldb-bug.cpp file.

Program compiled using "clang lldb-bug.cpp -O2 -g" and then ran using "lldb
a.out".

I've attached the reproducer. I also added a "output.txt" file with the
stacktrace.

-- 
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


Re: [lldb-dev] Moving lldbsuite API tests

2020-02-11 Thread Jordan Rupprecht via lldb-dev
I didn't actually get around to this yesterday. Landed minutes ago
as 99451b4453688a94c6014cac233d371ab4cc342d. I'll keep an eye out for
failures, but poke me if I miss something :)

On Mon, Feb 10, 2020 at 9:21 AM Jonas Devlieghere 
wrote:

> I'm very excited about this. Thank you for taking the time and effort
> to make this happen!
>
> On Mon, Feb 10, 2020 at 9:01 AM Jordan Rupprecht 
> wrote:
> >
> > Later today I'm planning to land D71151, which moves
> lldb/packages/Python/lldbsuite/test to lldb/test/API, and removes the
> lldb/test/API/testcases symlink. This is a large move, so I expect it will
> cause conflict for many outstanding patches with lldb tests. However, it
> should hopefully make testing the lldbsuite/test/api a little easier: for
> example, you can now run "ninja check-lldb-api-lang" to run that
> subdirectory of tests, which matches how ninja targets work for the rest of
> llvm testing. (Note: "ninja check-lldb" still works without re-invoking
> cmake, but you need to run cmake again to get all the sub targets). It also
> removes the symlink, which confuses some tools, and makes file navigation
> confusing.
> >
> > I have verified no tests got lost in the move via:
> > (cd /path/to/src/llvm-build/tools/lldb/test && /usr/bin/python
> /path/to/src/llvm-build/dev/./bin/llvm-lit -sv
> /path/to/src/llvm-project/lldb/test/API --show-tests)
> > which shows no diffs before/after my patch
>


smime.p7s
Description: S/MIME Cryptographic Signature
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] [llvm-dev] Why is lldb telling me "variable not available"?

2020-02-11 Thread Brian Gesiak via lldb-dev
Apologies for the slow response here Jeremy. Your reply has been incredibly
helpful so far, I just need to try adding 'llvm.dbg.addr' myself to confirm
that works. Thank you! - Brian Gesiak

On Thu, Feb 6, 2020 at 11:04 AM Jeremy Morse 
wrote:

> Hi Brian,
>
> Thanks for working on coroutines, the debugging experience, and in
> particular thanks for the comprehensive write-up!,
>
> On Thu, Feb 6, 2020 at 1:19 PM Brian Gesiak via llvm-dev
>  wrote:
> > Specifically, I’m trying to improve lldb’s behavior when showing
> > variables in the current stack frame, when that frame corresponds to a
> > coroutine function.
>
> [...]
>
> Everything in the IR appears correct to my eyes, although I know next
> to nothing about coroutines and might have missed something. The
> simplest explanation of why the variable location goes missing can be
> seen in the disassembly:
>
> > ```
> > 0x401885 <+373>: movq   -0x8(%rbp), %rax
> > 0x401889 <+377>: movl   $0x0, 0x40(%rax)
> > 0x401890 <+384>: X movl   0x28(%rax), %edx
> > 0x401893 <+387>: X addl   $0x1, %edx
> > 0x401896 <+390>: X movl   %edx, 0x28(%rax)
> > 0x401899 <+393>: X movl   0x40(%rax), %edx
> > 0x40189c <+396>: addl   $0x1, %edx
> > 0x40189f <+399>: movl   %edx, 0x40(%rax)
> > ->  0x4018a2 <+402>: movl   0x28(%rax), %esi
> > ```
>
> Where I've marked with 'X' before the mnemonic the instructions that
> the variable location list covers. The location of "i" is correctly
> given as edx from its load to its store, and ends when edx is
> overwritten with the value of "j". In all the rest of the code, the
> variables value is in memory, and the DWARF data doesn't record this.
>
> Ideally debug info would track variables when they're stored to memory
> -- however we don't automatically know whether any subsequent store to
> memory will overwrite that variable, and so we don't track locations
> into memory. PR40628 [0] is an example of what can go wrong, where we
> described a variable as being in memory, but didn't know when that
> location was overwritten.
>
> If whatever's producing the coroutine IR has guarantees about where
> and when variables are loaded/stored from/to memory, it should be
> possible to put more information into the IR, so that the rest of LLVM
> doesn't have to guess. For example, this portion of IR:
>
>   %15 = load i32, i32* %i.reload.addr62, align 4, !dbg !670
>   call void @llvm.dbg.value(metadata i32 %15, metadata !659, metadata
> !DIExpression()), !dbg !661
>   %inc19 = add nsw i32 %15, 1, !dbg !670
>   call void @llvm.dbg.value(metadata i32 %inc19, metadata !659,
> metadata !DIExpression()), !dbg !661
>   store i32 %inc19, i32* %i.reload.addr62, align 4, !dbg !670
>
> Could have a call to llvm.dbg.addr(metadata i32 *%i.reload.addr66,
> ...) inserted after the store, indicating that the variable is located
> in memory. This should work (TM) so long as that memory is never
> overwritten with something that isn't the current value of "i" on
> every path after the call to llvm.dbg.addr; and on every path after
> the call to llvm.dbg.addr, when the variable is loaded form memory,
> there's a call to llvm.dbg.value to indicate that the variable is
> located somewhere other than memory now.
>
> Providing that extra information should improve the location coverage
> for your example, certainly when unoptimised. However, I believe (80%)
> this method isn't safe against optimisation, because (for example)
> dead stores can be deleted by LLVM passes without deleting the call to
> llvm.dbg.addr, pointing the variable location at a stale value in
> memory. Unfortunately I'm not aware of a facility or technique that
> protects against this right now. (CC Reid who I think ran into this
> last?).
>
> Note that there's some support for tracking variables through stack
> spills in post-isel debug data passes, however those loads and stores
> operate in well defined ways, and general loads and stores might not.
>
> [0] https://bugs.llvm.org/show_bug.cgi?id=40628
>
> --
> Thanks,
> Jeremy
>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev