# Lldb on interactive CLI programs - How to set a breakpoint where some output X is passed to stdout, waiting for input from the user

**URL:** <https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776>\
**Category:** Advanced Apple Debugging\
**Created:** [July 24, 2020, 2:29pm UTC](https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776 "2020-07-24T14:29:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![junxiang99](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/junxiang99/32/81494_2.png) [@junxiang99](https://forums.kodeco.com/u/junxiang99)\
**Post date:** [July 24, 2020, 2:29pm UTC](https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776/1 "2020-07-24T14:29:35Z")

</div>

I am inspecting the bash executable with lldb. If I run on my terminal:

```
./bash

```

It provides a new command prompt like so:

```
bash-3.2$

```

I’d like to set a breakpoint just at the line where the code outputs `bash-3.2$` to the terminal, and waits for the user to type some input.

How can I do this?

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 24, 2020, 4:22pm UTC](https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776/2 "2020-07-24T16:22:30Z")

</div>

@lolgrep Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![junxiang99](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/junxiang99/32/81494_2.png) [@junxiang99](https://forums.kodeco.com/u/junxiang99)\
**Post date:** [July 29, 2020, 9:12am UTC](https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776/3 "2020-07-29T09:12:21Z")

</div>

Hi @lolgrep, any advice on this?

---

<div class="post-metadata">

**Author:** ![junxiang99](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/junxiang99/32/81494_2.png) [@junxiang99](https://forums.kodeco.com/u/junxiang99)\
**Post date:** [August 7, 2020, 4:32pm UTC](https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776/4 "2020-08-07T16:32:56Z")

</div>

Hi @lolgrep and @shogunkaramazov, is there an answer to this?

---

<div class="post-metadata">

**Author:** ![lolgrep](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/lolgrep/32/106950_2.png) [@lolgrep](https://forums.kodeco.com/u/lolgrep)\
**Post date:** [September 8, 2020, 6:36pm UTC](https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776/5 "2020-09-08T18:36:48Z")

</div>

Check out the external functions bash is calling with a nm -u $(which bash)

Are there any functions you see that would stand out to try breakpoints on?

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [April 8, 2021, 6:14am UTC](https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776/7 "2021-04-08T06:14:28Z")

</div>

Opened on April 8, 2021, 6:14am UTC



---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [April 8, 2021, 6:14am UTC](https://forums.kodeco.com/t/lldb-on-interactive-cli-programs-how-to-set-a-breakpoint-where-some-output-x-is-passed-to-stdout-waiting-for-input-from-the-user/115776/8 "2021-04-08T06:14:49Z")

</div>

@junxiang99 Do you still have issues with this?
