0

I have written a code like this:

#include <iostream>
int main(){
    int a,b;
    std::cin >> a >> b;
    std::cout << a+b;
}

After running the run command in GDB, I managed to complete the input. But with LLDB, I can't enter it anyway.

I tried google and did not find anything about it.

What should I do?

I can input on GDB

I can't input on LLDB. I ran the run command on the command line and a window popped up with the file name I compiled. I am unable to input anything in the new window, even though cin is waiting for my input at this time. When I randomly input something in the LLDB of the back window (even if they are not LLDB commands), I can input it normally in the front window. Why is this?

15
  • 1
    What version of lldb are you using? It works fine with lldb 18.1.8. Commented Oct 2, 2024 at 13:28
  • 1
    Repeating my comment from the staging ground: I see two different consoles on the last picture, it's not clear if you tried inputting into both. If both don't work, what happens when you try? You press keys and no symbols appear, or what? Commented Oct 2, 2024 at 13:30
  • @cigien 18.1.8, too. I have updated more detailed information at the end of the question Commented Oct 2, 2024 at 13:36
  • 1
    @3CxEZiVlQ Seeing two consoles being opened (the second picture) is valuable information, that would be lost if they just pasted the text. Commented Oct 2, 2024 at 13:50
  • 1
    @HolyBlackCat Nothing would lost. Since the (lldb) prompt is present, the program doesn't run. Commented Oct 2, 2024 at 13:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.