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

jdb_thread_list_i.h

Go to the documentation of this file.
00001 // AUTOMATICALLY GENERATED -- DO NOT EDIT!         -*- c++ -*-
00002 
00003 #ifndef jdb_thread_list_i_h
00004 #define jdb_thread_list_i_h
00005 
00006 #include "jdb_thread_names.h"
00007 
00008 #include <cstring>
00009 #include <cstdio>
00010 #include <limits.h>
00011 
00012 #include "jdb.h"
00013 #include "jdb_core.h"
00014 #include "jdb_module.h"
00015 #include "jdb_screen.h"
00016 #include "kernel_console.h"
00017 #include "keycodes.h"
00018 #include "simpleio.h"
00019 #include "thread.h"
00020 #include "thread_state.h"
00021 #include "static_init.h"
00022 
00023 class Jdb_list_threads : public Jdb_module
00024 {
00025 private:
00026   static char subcmd;
00027   static char long_output;
00028 
00029 public:  
00030   Jdb_list_threads();
00031   
00032   Jdb_module::Action_code action(int cmd, void *&, char const *&, int &);
00033   
00034   static void show_thread_list();
00035   
00036   Jdb_module::Cmd const *const cmds() const;
00037   
00038   int const num_cmds() const;
00039 
00040 private:  
00041   static void list_threads_show_thread(Thread *t);
00042   
00043   static void show_header();
00044   
00045   static void list_threads(Thread *t_start, char pr);
00046 };
00047 
00048 class Jdb_thread_list
00049 {
00050 private:
00051   static int _mode;
00052   static int _count;
00053   static char _pr;
00054   static Thread *_t_head, *_t_start;
00055 
00056   friend class _foo;
00057 
00058   enum { LIST_UNSORTED, LIST_SORT_PRIO, LIST_SORT_TID };
00059 
00060 public:  
00061   static void init(char pr, Thread *t_head);
00062   
00063   // return string describing current sorting mode of list
00064   static inline const char* const get_mode_str(void);
00065   
00066   // switch to next sorting mode
00067   static void switch_mode(void);
00068   
00069   // set _t_start element of list
00070   static void set_start(Thread *t_start);
00071   
00072   // _t_start-- if possible
00073   static int line_back(void);
00074   
00075   // _t_start++ if possible
00076   static int line_forw(void);
00077   
00078   // _t_start -= 24 if possible
00079   static int page_back(void);
00080   
00081   // _t_start += 24 if possible
00082   static int page_forw(void);
00083   
00084   // _t_start = first element of list
00085   static int goto_home(void);
00086   
00087   // _t_start = last element of list
00088   static int goto_end(void);
00089   
00090   // search index of t_search starting from _t_start
00091   static int lookup(Thread *t_search);
00092   
00093   // get y'th element of thread list starting from _t_start
00094   static Thread* index(int y);
00095   
00096   // show complete page using show callback function
00097   static int page_show(void (*show)(Thread *t));
00098   
00099   // show complete list using show callback function
00100   static int complete_show(void (*show)(Thread *t));
00101 
00102 private:  
00103   // helper function for iter() -- use priority as sorting key
00104   static int get_prio(Thread *t);
00105   
00106   // helper function for iter() -- use thread id as sorting key
00107   static int get_tid(Thread *t);
00108   
00109   static inline Thread* iter_prev(Thread *t);
00110   
00111   static inline Thread* iter_next(Thread *t);
00112   
00113   // walk though list <count> times
00114   // abort walking if no more elements
00115   // do iter if iter != 0
00116   static bool iter(int count, Thread **t_start, void (*iter)(Thread *t)=0);
00117 };
00118 
00119 #endif // jdb_thread_list_i_h

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