00001
00002
00003 #ifndef jdb_symbol_h
00004 #define jdb_symbol_h
00005
00006 #include "l4_types.h"
00007
00008
00009
00010
00011
00012
00013 class Jdb_symbol_info
00014 {
00015 private:
00016 Address _virt;
00017 size_t _size;
00018 Address _beg_sym;
00019 Address _end_sym;
00020
00021 public:
00022 inline char* str();
00023
00024 inline void get(Address &virt, size_t &size);
00025
00026 inline void reset();
00027
00028 inline bool in_range(Address addr);
00029
00030
00031 bool set(Address virt, size_t size);
00032
00033 private:
00034
00035 static inline Address string_to_addr(const char *symstr);
00036
00037
00038
00039
00040
00041 bool transform();
00042 };
00043
00044 class Jdb_symbol
00045 {
00046 public:
00047 enum
00048 {
00049
00050 Max_tasks = L4_uid::Max_tasks < 2048 ? L4_uid::Max_tasks : 2048,
00051 };
00052
00053 private:
00054 static Jdb_symbol_info *_task_symbols;
00055
00056 public:
00057 static void init(void *mem, Mword pages);
00058
00059 static Jdb_symbol_info* lookup(Task_num task);
00060
00061
00062
00063 static Address match_symbol_to_addr(const char *symbol, bool search_instr, Task_num task);
00064
00065
00066 static bool complete_symbol(char *symbol, unsigned size, Task_num task);
00067
00068
00069 static const char* match_addr_to_symbol(Address addr, Task_num task);
00070
00071
00072 static bool match_addr_to_symbol_fuzzy(Address *addr_ptr, Task_num task, char *t_symbol, int s_symbol);
00073
00074 private:
00075
00076 static const char* match_symbol(const char *symbol, bool search_instr, Task_num task);
00077 };
00078
00079
00080
00081
00082
00083
00084
00085
00086 inline void
00087 Jdb_symbol_info::get(Address &virt, size_t &size)
00088 {
00089 virt = _virt;
00090 size = _size;
00091 }
00092
00093
00094
00095 inline void
00096 Jdb_symbol_info::reset()
00097 {
00098 _virt = 0;
00099 }
00100
00101 #endif // jdb_symbol_h