summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSymbolClient/Client.h
blob: 85fcdc1edf5024c8f21dd4dcfddc13574ba987d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibIPC/ServerConnection.h>
#include <SymbolServer/SymbolClientEndpoint.h>
#include <SymbolServer/SymbolServerEndpoint.h>

namespace SymbolClient {

struct Symbol {
    FlatPtr address { 0 };
    String name {};
    u32 offset { 0 };
    String filename {};
    u32 line_number { 0 };
};

Vector<Symbol> symbolicate_thread(pid_t pid, pid_t tid);

class Client
    : public IPC::ServerConnection<SymbolClientEndpoint, SymbolServerEndpoint>
    , public SymbolClientEndpoint {
    C_OBJECT(Client);

public:
    virtual void handshake() override;

    Optional<Symbol> symbolicate(const String& path, FlatPtr address);

private:
    Client();

    virtual void handle(const Messages::SymbolClient::Dummy&) override;
};

}