Otawa  0.10
Process.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Copyright (c) 2007, IRIT UPS <casse@irit.fr>
4  *
5  * loader::new_gliss::Process class interface
6  */
7 #ifndef OTAWA_LOADER_NEW_GLISS_PROCESS_H
8 #define OTAWA_LOADER_NEW_GLISS_PROCESS_H
9 
10 #include <otawa/prog/Process.h>
11 
12 struct gel_line_map_t;
13 struct gel_file_info_t;
14 
15 namespace otawa {
16 
17 namespace loader { namespace new_gliss {
18 
19 class Segment;
20 
21 // Process class
22 class Process: public otawa::Process {
23 public:
25  const PropList& props = PropList::EMPTY);
26  inline void *state(void) const { return _state; }
27 
28  // Process Overloads
29  virtual hard::Platform *platform(void);
30  virtual Inst *start(void);
31  virtual File *loadFile(elm::CString path);
32  virtual void get(Address at, signed char& val);
33  virtual void get(Address at, unsigned char& val);
34  virtual void get(Address at, signed short& val);
35  virtual void get(Address at, unsigned short& val);
36  virtual void get(Address at, signed long& val);
37  virtual void get(Address at, unsigned long& val);
38  virtual void get(Address at, signed long long& val);
39  virtual void get(Address at, unsigned long long& val);
40  virtual void get(Address at, Address& val);
41  virtual void get(Address at, string& str);
42  virtual void get(Address at, char *buf, int size);
45  virtual void getAddresses(cstring file, int line,
46  Vector<Pair<Address, Address> >& addresses)
48 
49 protected:
50  friend class Segment;
51  virtual Inst *decode(address_t addr) = 0;
52  virtual void *gelFile(void) = 0;
53  virtual void *memory(void) = 0;
54 
55 public:
56  void setup(void);
58  hard::Platform *_platform;
59  void *_state;
60  void *_memory;
61  int argc;
62  char **argv, **envp;
63  bool no_stack;
64  bool init;
65  struct gel_line_map_t *map;
66  struct gel_file_info_t *file;
67 };
68 
69 } } } // otawa::loader::new_gliss
70 
71 #endif // OTAWA_LOADER_NEW_GLISS_PROCESS_H
Inst * _start
Definition: Process.h:57
void * _state
Definition: Process.h:59
bool init
Definition: Process.h:64
virtual void getAddresses(cstring file, int line, Vector< Pair< Address, Address > > &addresses)
Get the list of addresses implementing the given (source, line) pair.
Manager * manager(void)
Get the manager owning this process.
Definition: Process.h:143
static const PropList EMPTY
This is an empty proplist for convenience.
Definition: PropList.h:66
struct gel_file_info_t * file
Definition: Process.h:66
virtual void * gelFile(void)=0
Definition: Inst.h:16
hard::Platform * _platform
Definition: Process.h:58
uint32 size
The manager class providesfacilities for storing, grouping and retrieving shared resources like loade...
Definition: Manager.h:58
In usual file format like ELF, COFF and so on, the program file is divided in segment according platf...
Definition: Segment.h:40
virtual hard::Platform * platform(void)
Get the platform of the process.
This class represents a file involved in the building of a process.
Definition: File.h:43
elm::StringBuffer buf
Definition: util_fft_lexer.cc:640
struct gel_line_map_t * map
Definition: Process.h:65
virtual Option< Pair< cstring, int > > getSourceLine(Address addr)
Get the source file and the line matching the given address.
A process is the realization of a program on a platform.
Definition: Process.h:136
The representation of an address in OTAWA.
Definition: base.h:54
virtual Inst * decode(address_t addr)=0
int argc
Definition: Process.h:61
virtual Inst * start(void)
Get the address of the first instruction of the program.
virtual File * loadFile(elm::CString path)
Load an existing file.
Process(Manager *manager, hard::Platform *platform, const PropList &props=PropList::EMPTY)
This class records information about the architecture where the processed program will run...
Definition: Platform.h:48
char ** argv
Definition: Process.h:62
This a list of properties.
Definition: PropList.h:63
virtual void * memory(void)=0
void * state(void) const
Definition: Process.h:26
Definition: Process.h:22
This class is used to throw an exception when a process does not support an invoked feature...
Definition: Process.h:75
bool no_stack
Definition: Process.h:63
char ** envp
Definition: Process.h:62
void * _memory
Definition: Process.h:60