[Lldb-commits] [lldb] [lldb-dap] Fix disassembled ranges for `disassemble` request (PR #105446)

Adrian Vogelsgesang via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 20 16:58:20 PDT 2024


vogelsgesang wrote:

@clayborg I would be interested in your guidance for this PR, given that you previously reviewed a similar change in https://reviews.llvm.org/D140358

I did use `SBFunction` / `SBSymbol` as suggested by you in [this comment](https://reviews.llvm.org/D140358#4027551). 

I did not know how to address the part

```
    // then we need to repeat the search for the next function or symbol. 
    // note there may be bytes between functions or symbols which we can disassemble
    // by calling _get_instructions_from_memory(...) but we must find the next
    // symbol or function boundary and get back on track
```

from your comment, though. Is there some API to find the next symbol? Or some API to get a list of symbols, sorted by their start address?

I could of course use a brute-force approach, similar to

```
SBAddress addr;
while (!addr.GetFunction() && !addr.GetSymbol())
   addr = addr.OffsetAddress(1);
```

but that seems a bit wasteful

https://github.com/llvm/llvm-project/pull/105446


More information about the lldb-commits mailing list