ROSE  0.11.102.0
Public Member Functions | List of all members
Rose::BinaryAnalysis::Debugger::Specimen Class Reference

Description

Describes the specimen to be debugged.

A specimen can be either an executable program or a running process.

Definition at line 52 of file Debugger.h.

#include <Rose/BinaryAnalysis/Debugger.h>

Public Member Functions

 Specimen ()
 Default construct an empty specimen descriptor. More...
 
 Specimen (int pid)
 Construct a specimen description for a process. More...
 
 Specimen (const boost::filesystem::path &name)
 Construct a specimen description for a program with no arguments. More...
 
 Specimen (const boost::filesystem::path &name, const std::vector< std::string > &args)
 Construct a specimen description for a program with arguments. More...
 
 Specimen (const std::vector< std::string > &nameAndArgs)
 Construct a specimen description from combined program and arguments. More...
 
void eraseEnvironmentVariable (const std::string &)
 Remove an environment variable. More...
 
void eraseMatchingEnvironmentVariables (const boost::regex &)
 Remove some environment variables. More...
 
void eraseAllEnvironmentVariables ()
 Remove all environment variables. More...
 
void insertEnvironmentVariable (const std::string &name, const std::string &value)
 Add an environment variable. More...
 
void print (std::ostream &out) const
 Print some basic info about the specimen. More...
 
char ** prepareEnvAdjustments () const
 
boost::filesystem::path program () const
 Property: Name of executable program to run. More...
 
void program (const boost::filesystem::path &name)
 Property: Name of executable program to run. More...
 
const std::vector< std::string > & arguments () const
 Property: Program command-line arguments. More...
 
void arguments (const std::vector< std::string > &args)
 Property: Program command-line arguments. More...
 
boost::filesystem::path workingDirectory () const
 Property: Current working directory for running a program. More...
 
void workingDirectory (const boost::filesystem::path &name)
 Property: Current working directory for running a program. More...
 
const BitFlags< Flag > & flags () const
 Property: Operational flags. More...
 
BitFlags< Flag > & flags ()
 Property: Operational flags. More...
 
unsigned long persona () const
 Property: Personality flags. More...
 
void persona (unsigned long bits)
 Property: Personality flags. More...
 
bool randomizedAddresses () const
 Property: Whether to randomize addresses of a process. More...
 
void randomizedAddresses (bool)
 Property: Whether to randomize addresses of a process. More...
 
int process () const
 Property: Process ID. More...
 
void process (int pid)
 Property: Process ID. More...
 

Constructor & Destructor Documentation

Rose::BinaryAnalysis::Debugger::Specimen::Specimen ( )
inline

Default construct an empty specimen descriptor.

Definition at line 68 of file Debugger.h.

Rose::BinaryAnalysis::Debugger::Specimen::Specimen ( int  pid)
inline

Construct a specimen description for a process.

Definition at line 72 of file Debugger.h.

Rose::BinaryAnalysis::Debugger::Specimen::Specimen ( const boost::filesystem::path &  name)
inline

Construct a specimen description for a program with no arguments.

Definition at line 76 of file Debugger.h.

Rose::BinaryAnalysis::Debugger::Specimen::Specimen ( const boost::filesystem::path &  name,
const std::vector< std::string > &  args 
)
inline

Construct a specimen description for a program with arguments.

Definition at line 80 of file Debugger.h.

Rose::BinaryAnalysis::Debugger::Specimen::Specimen ( const std::vector< std::string > &  nameAndArgs)
inline

Construct a specimen description from combined program and arguments.

Definition at line 84 of file Debugger.h.

Member Function Documentation

boost::filesystem::path Rose::BinaryAnalysis::Debugger::Specimen::program ( ) const
inline

Property: Name of executable program to run.

A specimen description can be either a program or a process, but not both. Setting this property will clear the process property.

Definition at line 96 of file Debugger.h.

void Rose::BinaryAnalysis::Debugger::Specimen::program ( const boost::filesystem::path &  name)
inline

Property: Name of executable program to run.

A specimen description can be either a program or a process, but not both. Setting this property will clear the process property.

Definition at line 99 of file Debugger.h.

const std::vector<std::string>& Rose::BinaryAnalysis::Debugger::Specimen::arguments ( ) const
inline

Property: Program command-line arguments.

This property is the list of command-line arguments supplied to a program when starting it. This property is not used when attaching to an existing process.

Definition at line 111 of file Debugger.h.

void Rose::BinaryAnalysis::Debugger::Specimen::arguments ( const std::vector< std::string > &  args)
inline

Property: Program command-line arguments.

This property is the list of command-line arguments supplied to a program when starting it. This property is not used when attaching to an existing process.

Definition at line 114 of file Debugger.h.

void Rose::BinaryAnalysis::Debugger::Specimen::eraseEnvironmentVariable ( const std::string &  )

Remove an environment variable.

The specified environment variable is removed from environment before starting the subordinate process. This function can be called multiple times to remove multiple variables. The variables are removed from the subordinate process without affecting process from which this is called. Removals happen before additions.

void Rose::BinaryAnalysis::Debugger::Specimen::eraseMatchingEnvironmentVariables ( const boost::regex &  )

Remove some environment variables.

Variables whose names match the specified regular expression are removed from the environment before starting the subordinate process. This function can be called multiple times to remove multiple variables. The variables are removed from the subordinate process without affectig the calling process. Removals happen before additions.

void Rose::BinaryAnalysis::Debugger::Specimen::eraseAllEnvironmentVariables ( )

Remove all environment variables.

All environment variables are removed before starting the subordinate process. Removals happen before additions.

void Rose::BinaryAnalysis::Debugger::Specimen::insertEnvironmentVariable ( const std::string &  name,
const std::string &  value 
)

Add an environment variable.

The specified variable and value is added to the subordinate process's environment. This function can be called multiple times to add multiple variables. The variables are added to the subordinate process without affecting this calling process. Additions happen after removals.

boost::filesystem::path Rose::BinaryAnalysis::Debugger::Specimen::workingDirectory ( ) const
inline

Property: Current working directory for running a program.

This property is only used for starting a new program, not for attaching to a process (which already has a current working directory). If no working directory is specified then the program's working directory will be this process's current working directory.

Definition at line 152 of file Debugger.h.

void Rose::BinaryAnalysis::Debugger::Specimen::workingDirectory ( const boost::filesystem::path &  name)
inline

Property: Current working directory for running a program.

This property is only used for starting a new program, not for attaching to a process (which already has a current working directory). If no working directory is specified then the program's working directory will be this process's current working directory.

Definition at line 155 of file Debugger.h.

const BitFlags<Flag>& Rose::BinaryAnalysis::Debugger::Specimen::flags ( ) const
inline

Property: Operational flags.

These flags control some finer aspects of the operations.

Definition at line 165 of file Debugger.h.

BitFlags<Flag>& Rose::BinaryAnalysis::Debugger::Specimen::flags ( )
inline

Property: Operational flags.

These flags control some finer aspects of the operations.

Definition at line 168 of file Debugger.h.

unsigned long Rose::BinaryAnalysis::Debugger::Specimen::persona ( ) const
inline

Property: Personality flags.

These flags are identical to the bit flags used by the Linux personality function. For instance, to turn off address space randomization, include sys/personality.h and pass ADDR_NO_RANDOMIZE. See also, randomizedAddresses property.

Definition at line 180 of file Debugger.h.

void Rose::BinaryAnalysis::Debugger::Specimen::persona ( unsigned long  bits)
inline

Property: Personality flags.

These flags are identical to the bit flags used by the Linux personality function. For instance, to turn off address space randomization, include sys/personality.h and pass ADDR_NO_RANDOMIZE. See also, randomizedAddresses property.

Definition at line 183 of file Debugger.h.

bool Rose::BinaryAnalysis::Debugger::Specimen::randomizedAddresses ( ) const

Property: Whether to randomize addresses of a process.

This is actually a persona property, but it's used so commonly that we have a separate API for turning it on and off. The alleviates the user from having to test what kind of machine he's compiling on and using conditional compilation to include the correct files and use the correct constants. If the host machine doesn't support adjusting whether address space randomization is used, then setting this property is a no-op and false is always returned.

void Rose::BinaryAnalysis::Debugger::Specimen::randomizedAddresses ( bool  )

Property: Whether to randomize addresses of a process.

This is actually a persona property, but it's used so commonly that we have a separate API for turning it on and off. The alleviates the user from having to test what kind of machine he's compiling on and using conditional compilation to include the correct files and use the correct constants. If the host machine doesn't support adjusting whether address space randomization is used, then setting this property is a no-op and false is always returned.

int Rose::BinaryAnalysis::Debugger::Specimen::process ( ) const
inline

Property: Process ID.

This is the identification number for a specimen process to which the debugger should be attached. Setting this property will clear the program property.

Definition at line 206 of file Debugger.h.

void Rose::BinaryAnalysis::Debugger::Specimen::process ( int  pid)
inline

Property: Process ID.

This is the identification number for a specimen process to which the debugger should be attached. Setting this property will clear the program property.

Definition at line 209 of file Debugger.h.

void Rose::BinaryAnalysis::Debugger::Specimen::print ( std::ostream &  out) const

Print some basic info about the specimen.


The documentation for this class was generated from the following file: