Otawa  0.10
Process.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Copyright (c) 2004-07, IRIT UPS <casse@irit.fr>
4  *
5  * loader::old_gliss::Process class interface
6  */
7 #ifndef OTAWA_LOADER_OLD_PROCESS_H
8 #define OTAWA_LOADER_OLD_PROCESS_H
9 
10 #include <otawa/prog/Process.h>
11 
12 namespace otawa {
13 
14 namespace loader { namespace old_gliss {
15 
16 class Segment;
17 
18 // Process class
19 class Process: public otawa::Process {
20 public:
21  Process(
23  Loader *loader,
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 Loader *loader(void) const;
33  virtual void get(Address at, signed char& val);
34  virtual void get(Address at, unsigned char& val);
35  virtual void get(Address at, signed short& val);
36  virtual void get(Address at, unsigned short& val);
37  virtual void get(Address at, signed long& val);
38  virtual void get(Address at, unsigned long& val);
39  virtual void get(Address at, signed long long& val);
40  virtual void get(Address at, unsigned long long& val);
41  virtual void get(Address at, Address& val);
42  virtual void get(Address at, string& str);
43  virtual void get(Address at, char *buf, int size);
46  virtual void getAddresses(cstring file, int line,
47  Vector<Pair<Address, Address> >& addresses)
49 
50 protected:
51  friend class Segment;
52  virtual Inst *decode(address_t addr) = 0;
53  virtual void *memory(void) = 0;
54 
55 public:
57  hard::Platform *_platform;
58  void *_state;
59  void *_memory;
60  int argc;
61  char **argv, **envp;
63 };
64 
65 } } } // otawa::loader::old_gliss
66 
67 #endif /* OTAWA_LOADER_OLD_GLISS_PROCESS_H */
virtual Loader * loader(void) const
Get the loader that has created this process.
Manager * manager(void)
Get the manager owning this process.
Definition: Process.h:143
int argc
Definition: Process.h:60
static const PropList EMPTY
This is an empty proplist for convenience.
Definition: PropList.h:66
Loader * _loader
Definition: Process.h:62
virtual void * memory(void)=0
virtual Inst * decode(address_t addr)=0
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 void getAddresses(cstring file, int line, Vector< Pair< Address, Address > > &addresses)
Get the list of addresses implementing the given (source, line) pair.
virtual Option< Pair< cstring, int > > getSourceLine(Address addr)
Get the source file and the line matching the given address.
This class represents a file involved in the building of a process.
Definition: File.h:43
void * _state
Definition: Process.h:58
elm::StringBuffer buf
Definition: util_fft_lexer.cc:640
hard::Platform * _platform
Definition: Process.h:57
char ** argv
Definition: Process.h:61
A process is the realization of a program on a platform.
Definition: Process.h:136
virtual hard::Platform * platform(void)
Get the platform of the process.
The representation of an address in OTAWA.
Definition: base.h:54
void * state(void) const
Definition: Process.h:26
This interface is implemented by all objects that may build and provide a process.
Definition: Loader.h:31
Process(Manager *manager, Loader *loader, 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 ** envp
Definition: Process.h:61
virtual File * loadFile(elm::CString path)
Load an existing file.
This a list of properties.
Definition: PropList.h:63
virtual Inst * start(void)
Get the address of the first instruction of the program.
void * _memory
Definition: Process.h:59
Definition: Process.h:19
Definition: Inst.h:16
Inst * _start
Definition: Process.h:56
This class is used to throw an exception when a process does not support an invoked feature...
Definition: Process.h:75