Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

jdb_symbol.h

Go to the documentation of this file.
00001 // AUTOMATICALLY GENERATED -- DO NOT EDIT!         -*- c++ -*-
00002 
00003 #ifndef jdb_symbol_h
00004 #define jdb_symbol_h
00005 
00006 #include "l4_types.h"
00007 
00008 //
00009 // INTERFACE definition follows 
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   // register symbols for a specific task (called by user mode application)
00031   bool set(Address virt, size_t size);
00032 
00033 private:  
00034   // read address from current position and return its value
00035   static inline Address string_to_addr(const char *symstr);
00036   
00037   // Optimize symbol table to speed up address-to-symbol search.
00038   // Replace stringified address (8 characters) by 2 dwords of 32 bit: The
00039   // symbol value and the absolute address of the next symbol (or 0 if end
00040   // of list)
00041   bool transform();
00042 };
00043 
00044 class Jdb_symbol
00045 {
00046 public:
00047   enum
00048   {
00049     // don't allow more than 2048 tasks to register their symbols to save space
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   // Search a symbol in symbols of a specific task. If the symbol
00062   // was not found, search in kernel symbols too (if exists)
00063   static Address match_symbol_to_addr(const char *symbol, bool search_instr, Task_num task);
00064   
00065   // try to search a possible symbol completion
00066   static bool complete_symbol(char *symbol, unsigned size, Task_num task);
00067   
00068   // search symbol name that matches for a specific address
00069   static const char* match_addr_to_symbol(Address addr, Task_num task);
00070   
00071   // search last symbol before eip
00072   static bool match_addr_to_symbol_fuzzy(Address *addr_ptr, Task_num task, char *t_symbol, int s_symbol);
00073 
00074 private:  
00075   // search symbol in task's symbols, return pointer to symbol name
00076   static const char* match_symbol(const char *symbol, bool search_instr, Task_num task);
00077 };
00078 
00079 //
00080 // IMPLEMENTATION of inline functions (and needed classes)
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

Generated on Mon Sep 26 14:20:11 2005 for Fiasco by  doxygen 1.4.2