blob: c0d96ebbfbfe567ed8f2590f6698c9e6acbe9f99 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_LIB_DEBUGGER_UTILS_LOAD_MAPS_H_
#define SRC_LIB_DEBUGGER_UTILS_LOAD_MAPS_H_
#include <zircon/types.h>
#include <cstdint>
#include <string>
#include <vector>
#include "src/lib/fxl/macros.h"
namespace debugger_utils {
struct LoadMap {
zx_koid_t pid;
uint64_t base_addr;
uint64_t load_addr;
uint64_t end_addr;
std::string name;
std::string so_name;
std::string build_id;
};
class LoadMapTable {
public:
LoadMapTable() = default;
bool ReadLogListenerOutput(const std::string& file);
const LoadMap* LookupLoadMap(zx_koid_t pid, uint64_t addr);
private:
void Clear();
void AddLoadMap(const LoadMap& map);
std::vector<LoadMap> maps_;
FXL_DISALLOW_COPY_AND_ASSIGN(LoadMapTable);
};
} // namespace debugger_utils
#endif // SRC_LIB_DEBUGGER_UTILS_LOAD_MAPS_H_