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

jdb_tcb_i.h

Go to the documentation of this file.
00001 // AUTOMATICALLY GENERATED -- DO NOT EDIT!         -*- c++ -*-
00002 
00003 #ifndef jdb_tcb_i_h
00004 #define jdb_tcb_i_h
00005 
00006 #include <cstdio>
00007 #include "entry_frame.h"
00008 #include "jdb.h"
00009 #include "jdb_input.h"
00010 #include "jdb_module.h"
00011 #include "jdb_screen.h"
00012 #include "kernel_console.h"
00013 #include "keycodes.h"
00014 #include "l4_types.h"
00015 #include "mem_layout.h"
00016 #include "push_console.h"
00017 #include "simpleio.h"
00018 #include "static_init.h"
00019 #include "thread.h"
00020 #include "types.h"
00021 
00022 class Jdb_tcb : public Jdb_module
00023 {
00024   static L4_uid  threadid;
00025   static Address address;
00026   static char    first_char;
00027   static char    auto_tcb;
00028 
00029 public:  
00030   Jdb_tcb();
00031   
00032   static Jdb_module::Action_code show(L4_uid tid, int level);
00033   
00034   /* --- original L4 screen ------------------------------------------------------
00035   thread: 0081 (001.01) <00020401 00080000>                             prio: 10
00036   state : 85, ready                            lists: 81                   mcp: ff
00037   
00038   wait for: --                             rcv descr: 00000000   partner: 00000000
00039   sndq    : 0081 0081                       timeouts: 00000000   waddr0/1: 000/000
00040   cpu time: 0000000000 timeslice: 01/0a
00041   
00042   pager   : --                            prsent lnk: 0080 0080
00043   ipreempt: --                            ready link : 0080 0080
00044   xpreempt: --
00045                                           soon wakeup lnk: 
00046   EAX=00202dfe  ESI=00020401  DS=0008     late wakeup lnk: 
00047   EBX=00000028  EDI=00080000  ES=0008
00048   ECX=00000003  EBP=e0020400
00049   EDX=00000001  ESP=e00207b4
00050   
00051   700:
00052   720:
00053   740:
00054   760:
00055   780:
00056   7a0:                                                  0000897b 00000020 00240082
00057   7c0:  00000000 00000000 00000000 00000000    00000000 00000000 00000000 00000000
00058   7e0:  00000000 00000000 ffffff80 00000000    0000001b 00003200 00000000 00000013
00059   L4KD: 
00060   ------------------------------------------------------------------------------*/
00061   Jdb_module::Action_code action(int cmd, void *&args, char const *&fmt, int &next_char);
00062   
00063   Jdb_module::Cmd const *const cmds() const;
00064   
00065   int const num_cmds() const;
00066 
00067 private:  
00068   static void at_jdb_enter();
00069   
00070   static Address search_bt_start(Address tcb, Mword *ksp, bool is_current_thread);
00071   
00072   static void print_entry_frame_regs(Task_num task);
00073   
00074   static void info_thread_state(Thread *t, Jdb::Guessed_thread_state state);
00075   
00076   static void print_regs_invalid_tid();
00077   
00078   static inline void print_thread_uid_raw(Thread *t);
00079 };
00080 
00081 class Jdb_tcb_ptr
00082 {
00083 public:
00084   Jdb_tcb_ptr(Address addr)
00085     : _base(addr & ~(Config::thread_block_size-1)),
00086       _offs(addr &  (Config::thread_block_size-1))
00087   {}
00088 
00089   Jdb_tcb_ptr(Jdb_tcb_ptr &p)
00090     : _base(p.base()), _offs(p.offs())
00091   {}
00092 
00093   inline bool valid(Address base)
00094   { 
00095     return _base == base && 
00096            _offs <= Config::thread_block_size-sizeof(Mword); 
00097   }
00098 
00099   bool operator > (int offs)
00100   {
00101     return offs < 0 ? _offs > Config::thread_block_size + offs*sizeof(Mword)
00102                     : _offs > offs*sizeof(Mword);
00103   }
00104 
00105   Jdb_tcb_ptr &operator += (int offs)
00106   { _offs += offs*sizeof(Mword); return *this; }
00107 
00108   inline Address addr()
00109   { return _base + _offs; }
00110 
00111   inline Mword value()
00112   { return *(Mword*)(_base + _offs); }
00113 
00114   inline void value(Mword v)
00115   { *(Mword*)(_base + _offs) = v; }
00116 
00117   inline bool is_user_value()
00118   { return _offs >= Config::thread_block_size - 5*sizeof(Mword); }
00119 
00120   inline Mword top_value(int offs)
00121   { return *((Mword*)(_base + Config::thread_block_size) + offs); }
00122 
00123   inline Address base()
00124   { return _base; }
00125 
00126   inline Address offs()
00127   { return _offs; }
00128 
00129   inline void offs(Address offs)
00130   { _offs = offs; }
00131 
00132 private:
00133   Address  _base;
00134   Address  _offs;
00135 
00136 public:  
00137   bool in_backtrace(Address bt_start, Address tcb);
00138 };
00139 
00140 //
00141 // IMPLEMENTATION of inline functions follows
00142 //
00143 
00144 
00145 
00146 
00147 inline void
00148 Jdb_tcb::print_thread_uid_raw(Thread *t)
00149 {
00150   printf(" <%08x %08x>",
00151       (Unsigned32)(t->id().raw() >> 32), (Unsigned32)(t->id().raw()));
00152 }
00153 
00154 #endif // jdb_tcb_i_h

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