<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - unwind-on-error-in-expressions=false is broken"
   href="https://llvm.org/bugs/show_bug.cgi?id=22875">22875</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>unwind-on-error-in-expressions=false is broken
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>labath@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Attempting to evaluate an expression with unwind-on-error-in-expressions=false
results in an lldb(llvm) assertion:

labath ~/ll/goog/lldb/test/expression_command/call-function $ cat main.cpp 
#include <iostream>
#include <string>

struct Five
{
    int number;
    const char *name;
};

Five
returnsFive()
{
    Five my_five = { 5, "five" };
    return my_five;
}

int main (int argc, char const *argv[])
{
    std::string str = "Hello world";
    std::cout << str << std::endl;
    std::cout << str.c_str() << std::endl;
    Five main_five = returnsFive();
#if 0
    print str
    print str.c_str()
#endif
    return 0; // Please test these expressions while stopped at this line:
}
labath ~/ll/goog/lldb/test/expression_command/call-function $ make
clang++ -std=c++11 -g -O0 -m64  
-I/usr/local/google/home/labath/ll/goog/lldb/test/make/../../include   -c -o
main.o main.cpp
clang++  main.o -g -O0 -m64  
-I/usr/local/google/home/labath/ll/goog/lldb/test/make/../../include   -o
"a.out"
labath ~/ll/goog/lldb/test/expression_command/call-function $
~/ll/goog/build/host/bin/lldb ./a.out -o "br set -l 27" -o "set set
target.process.unwind-on-error-in-expressions false" -o "pr la" -o "print str"
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) br set -l 27
Breakpoint 1: where = a.out`main + 218 at main.cpp:27, address =
0x0000000000400cda
(lldb) set set target.process.unwind-on-error-in-expressions false
(lldb) pr la
Hello world
Hello world
Process 10135 stopped
* thread #1: tid = 10135, 0x0000000000400cda a.out`main(argc=1,
argv=0x00007fffffffdcc8) + 218 at main.cpp:27, name = 'a.out', stop reason =
breakpoint 1.1
    frame #0: 0x0000000000400cda a.out`main(argc=1, argv=0x00007fffffffdcc8) +
218 at main.cpp:27
   24          print str
   25          print str.c_str()
   26      #endif
-> 27          return 0; // Please test these expressions while stopped at this
line:
   28      }

Process 10135 launched: './a.out' (x86_64)
(lldb) print str
lldb: /usr/local/google/home/labath/ll/goog/llvm/lib/IR/Metadata.cpp:252:
static llvm::ValueAsMetadata *llvm::ValueAsMetadata::get(llvm::Value *):
Assertion `V && "Unexpected null Value"' failed.
Aborted (core dumped)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>