<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/70608>70608</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Need more powerful configuration file support
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          JetForMe
      </td>
    </tr>
</table>

<pre>
    This may be more than one request, but I'm trying to solve this problem: I wanted to be able to invoke some Swift code to operate on a variable while stopped in Swift code. I ended up writing this in mh ~/.lldbinit file, because it doesn't support any form of line continuation or multiline command.

```
command regex dump 's#(.+)#expr -l Swift -- print("\(dump(data: %1))"); func dump(data inData: Data, bytesPerLine inBPL: Int = 16) -> String { let conv = String("................................ !\"\u{23}$%&\u{27}()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"); var dump = ""; let maxCount = Swift.min(inData.count, 256); let bpl = inBPL > 0 ? inBPL : 8; let lines = maxCount / bpl + (maxCount % bpl > 0 ? 1 : 0); for line in 0 ..< lines { let start = line * bpl; let count = Swift.min(maxCount - start, bpl); let end = start + count; var dumpLine = String(format: "\u{25}08llx: ", start); for c in start ..< start + bpl { if c < end { dumpLine += String(format: "\u{25}02x ", inData[c]) } else { dumpLine += "   " }; if (c+1) % 8 == 0 { dumpLine += "  " } ;}; for c in start ..< end { let ch: Character; if c < conv.count { ch = conv[conv.index(conv.startIndex, offsetBy: c)] } else { ch = "." }; dumpLine.append(ch); if (c+1) % 8 == 0 { dumpLine += " " } ;}; dump += dumpLine + "\n" ;}; if inData.count > maxCount { dump += "…\(inData.count - maxCount) bytes omitted…\n" }; return dump }#'
```

At the very least, LLDB, lldb should support some form of line continuation character, perhaps a `\` at the end of the line, or (better) something like the Swift (and Python?) multiline string literal:

```
"""
as many
lines
as you
need
"""
```

A nice addition would be the ability to import arbitrary text into `~/.lldbinit`, so I could put my `command regex` in another file of multiple lines.

Best would be to directly support Swift for LLDB scripting. I realize that’s hard to do because it’s so hard to embed Swift.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVk9z67gN_zTwBWOPTNmWdPDBsuM22-z2tbv9e-lQEhRxH0VqSSqJ97CfvQNKdpxp3rRTj0cSSfz9AQQgvVfPhmgP2xK2p4UcQ2fd_jsKZ-u-p0Vlm8v-p0557OUFK8LeOsLQSYPWEDr6ZSQfQByxGgM-gsh6DO6izDMGi97qF6ZWHgdnK009pAd8xFdpAjVMURHKShN_KvNivxJ62xP--KragLVt4okdyMlAaA1KfJFORZbXTmlCH-wwUIPK3DGt8BHJNNTgOOCrUyHaw2Yog32Hv4E4r7RuKmVUwFZpih5QLUdPqAI2lrwBkQX04zBYF1CaC7bW9Whb1MoQ1tYEZUYZlDVoHfajDmo-6XtpmhUkJ0gO83OXzP-4nEnQ0TO9YTP2A4LIPIgURL4CUYIoQKT0Njhc6tmz5RIHp0wAkYMQsD2CyJmVXzJIhhbEdh1ZC6YQBaQltqOp8Y4OlTnN5PHNnl8C-S_knth8ZcovTzFOJiCkJ1zvQBS4hPQBfwyOoYSsRE2MtXmJJNP-ZNjqv_wQxDoazy6MkJUihewEYgNiC2J33cziZh5dOUREjssViHOyFulmu8vyAtIDpCWkR0hPkD5AeoZNciiPp4fz737_-N0fnr7_4Y9f_vTnH3_6y1__9vd__DNm-DH-T7B9-BfsElnVDbXPnfr5q-6NHX5xPowvr2-XXyErITtCdvrtHcgX6eZQpSeM24K3GYhevh3tOOMVo7XqlQGRT1ivaj5kpMV2N0tjtmrQkSNCjgxwgpCeb-sD5ldSziwfid91ifMkQZQIIr_b386Sr_LWUVZyTQjrphRWBhNcrSA9XsXPcfVBusmXSAfiwAKvptSfenpTv5zYY14N-s5bMk3kmqWLcpJ0D21MwA8JxXdOhim3bwmzheyU5Fq_XffF8ar05mHN7k2qJhff1UZwshJV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