Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot show expression values #112

Open
marcrasi opened this issue Sep 17, 2020 · 1 comment
Open

Cannot show expression values #112

marcrasi opened this issue Sep 17, 2020 · 1 comment

Comments

@marcrasi
Copy link
Contributor

The recent merge causes LLDB to crash when it tries to show an expression value.

I'm going to work around this by disabling showing expression values. Users can still see values using print().

This issue reminds us to re-enable showing expression values when we can. I expect some upstream fix will make it start working again soon.

marcrasi pushed a commit that referenced this issue Sep 17, 2020
The recent merge causes LLDB to crash when it tries to show an expression value (with `result.description`).

This PR replaces all uses of `result.description` with a few different non-crashing alternatives:
* When we know the type, of the value, use `GetSignedInt32()`.
* When `GetDescription()` works, use that.
* In a case where even `GetDescription()` crashes, print a message telling the user that they can show the value using `print()`. I made #112 to track fixing this.
@Gentoli
Copy link

Gentoli commented Oct 30, 2020

Is this related to Error message not showing?

enum VendingMachineError: Error {
    case invalidSelection
    case insufficientFunds(coinsNeeded: Int)
    case outOfStock
}
print("1")
throw VendingMachineError.insufficientFunds(coinsNeeded: 5)

print("2")

If I run the code above, it prints:

1
Use `print()` to show values.

where as using a host on colab prints:

1
▿ VendingMachineError
  ▿ insufficientFunds : 1 element
    - coinsNeeded : 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants