diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-04 23:33:27 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-04 23:35:10 +0100 |
commit | acabc37c242ab2769eaa2b8bd1ac133f97c9bbf0 (patch) | |
tree | 2678fc0726dbcb93a392ada5e954cfb9820f7946 /Userland/Services/SymbolServer | |
parent | 5dd555fe2fc407b035ea994474eb19bd633038bb (diff) | |
download | serenity-acabc37c242ab2769eaa2b8bd1ac133f97c9bbf0.zip |
SymbolServer+LibSymbolClient: Just do one symbol per IPC message
I originally wanted to batch the symbolication requests but that just
makes the client logic significantly more complicated with no real
benefit other than architectural feelgood points.
Diffstat (limited to 'Userland/Services/SymbolServer')
-rw-r--r-- | Userland/Services/SymbolServer/ClientConnection.cpp | 16 | ||||
-rw-r--r-- | Userland/Services/SymbolServer/SymbolServer.ipc | 2 |
2 files changed, 6 insertions, 12 deletions
diff --git a/Userland/Services/SymbolServer/ClientConnection.cpp b/Userland/Services/SymbolServer/ClientConnection.cpp index b958807afd..fee6bfb02e 100644 --- a/Userland/Services/SymbolServer/ClientConnection.cpp +++ b/Userland/Services/SymbolServer/ClientConnection.cpp @@ -66,12 +66,12 @@ OwnPtr<Messages::SymbolServer::SymbolicateResponse> ClientConnection::handle(con auto mapped_file = MappedFile::map(path); if (mapped_file.is_error()) { dbgln("Failed to map {}: {}", path, mapped_file.error().string()); - return make<Messages::SymbolServer::SymbolicateResponse>(false, Vector<String> {}); + return make<Messages::SymbolServer::SymbolicateResponse>(false, String {}, 0, String {}, 0); } auto elf = ELF::Image(mapped_file.value()->bytes()); if (!elf.is_valid()) { dbgln("ELF not valid: {}", path); - return make<Messages::SymbolServer::SymbolicateResponse>(false, Vector<String> {}); + return make<Messages::SymbolServer::SymbolicateResponse>(false, String {}, 0, String {}, 0); } auto cached_elf = CachedELF { mapped_file.release_value(), move(elf) }; s_cache.set(path, move(cached_elf)); @@ -81,16 +81,10 @@ OwnPtr<Messages::SymbolServer::SymbolicateResponse> ClientConnection::handle(con ASSERT(it != s_cache.end()); auto& cached_elf = it->value; - Vector<String> symbols; - symbols.ensure_capacity(message.addresses().size()); + u32 offset = 0; + auto symbol = cached_elf.elf.symbolicate(message.address(), &offset); - for (auto address : message.addresses()) { - u32 offset = 0; - auto symbol = cached_elf.elf.symbolicate(address, &offset); - symbols.append(move(symbol)); - } - - return make<Messages::SymbolServer::SymbolicateResponse>(true, move(symbols)); + return make<Messages::SymbolServer::SymbolicateResponse>(true, symbol, offset, String {}, 0); } } diff --git a/Userland/Services/SymbolServer/SymbolServer.ipc b/Userland/Services/SymbolServer/SymbolServer.ipc index 10e4ed51b7..a578b01809 100644 --- a/Userland/Services/SymbolServer/SymbolServer.ipc +++ b/Userland/Services/SymbolServer/SymbolServer.ipc @@ -2,5 +2,5 @@ endpoint SymbolServer = 4541510 { Greet() => () - Symbolicate(String path, Vector<u32> addresses) => (bool success, Vector<String> symbols) + Symbolicate(String path, u32 address) => (bool success, String name, u32 offset, String filename, u32 line) } |