-
Notifications
You must be signed in to change notification settings - Fork 4
runner.reference
Members | Descriptions |
---|---|
void metal_dbg_setup_bps (std::vector<std::unique_ptr< metal::debug::break_point >> & bps)
|
This function is the central function needed to provide a break-point plugin. |
void metal_dbg_setup_options <br>(boost::program_options::options_description & po)
|
This function can be used to add program options for the plugin. |
namespace metal::debug
|
void metal_dbg_setup_bps(std::vector<std::unique_ptr<
metal::debug::break_point
>> & bps)
This function is the central function needed to provide a break-point plugin.
This function can be used to add program options for the plugin.
Members | Descriptions |
---|---|
class metal::debug::break_point
|
This class is used to implement a break_point, i.e. is inherited by an implementation. |
class metal::debug::interpreter
|
|
class metal::debug::process
|
|
struct metal::debug::address_info
|
Information about a certain address in the program, i.e in source code. |
struct metal::debug::arg
|
This type represents an argument passed to a function. It inherits var and adds the parameter identifier. |
struct metal::debug::backtrace_elem
|
This class represents an entry in the backtrace. |
struct metal::debug::cstring_t
|
This function represents a null-terminated string in gdb. Gdb can add a display for a c-string if a char* is passed to a function. |
struct metal::debug::frame
|
This class represents a stackframe. A stackframe let's you examine the stack in gdb. A reference to the frame will be passed to the break-point implementation on invocation. |
struct metal::debug::interpreter_error
|
|
struct metal::debug::location
|
Simple structure representing a location in code. |
struct metal::debug::var
|
This type represents a variable in gdb, as given by frame::print or frame::call . |
This class is used to implement a break_point, i.e. is inherited by an implementation.
Members | Descriptions |
---|---|
const std::string & identifier () const
|
Returns the identifier string, either the functions name or the location. |
const boost::optional< std::string > & condition ()
|
Return the condition of the breakpoint. |
break_point (const std::string & func_name)
|
Construct the breakpoint from a function identifier. The function signature can either be the pure name of the function, which will yield several breakpoints or you can be an explicit overload. |
break_point (const std::string & file_name,std::size_t line)
|
Construct a breakpoint from a location in source-code. |
void invoke ( frame & fr,const std::string & file,int line)
|
This function will be called when the breakpoint is reached. |
virtual void set_at (std::uint64_t addr,const std::string & file,int line)
|
This function is called when the breakpoint is set once. It is meant to be overridden, this functions is empty. |
virtual void set_multiple (std::uint64_t addr,std::string & name,int cnt)
|
This function is called when the breakpoint is set multiple times. It is meant to be overridden, this functions is empty. |
virtual void set_not_found ()
|
This function is called when the breakpoint target could not be found. It is meant to be overridden, this functions is empty. |
void set_condition (const std::string & condition)
|
Add a condition for this breakpoint. |
virtual ~break_point () = default
|
Destructor. |
Returns the identifier string, either the functions name or the location.
Return the condition of the breakpoint.
Construct the breakpoint from a function identifier. The function signature can either be the pure name of the function, which will yield several breakpoints or you can be an explicit overload.
If you want to define the overload, the full type names must be used, not the aliases. E.g. for function void foo(std::string &);
func_name must be foo(std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
.
-
func_name
The Identifier.
Construct a breakpoint from a location in source-code.
-
file_name
The name of the source file. -
line
The line of the breakpoint in the source file
void invoke(
frame
& fr, const std::string & file,int line)
This function will be called when the breakpoint is reached.
-
fr
The data frame of the breakpoint. -
file
The file the breakpoint is in. -
line
The line in the file.
This function is called when the breakpoint is set once. It is meant to be overridden, this functions is empty.
-
addr
The address of the location in the binary -
file
The file the breakpoint is in -
line
The line of the breakpoint in the file.
This function is called when the breakpoint is set multiple times. It is meant to be overridden, this functions is empty.
-
addr
The address of the location in the binary. -
name
The name of the breakpoint. -
cnt
Number of breakpoints set.
This function is called when the breakpoint target could not be found. It is meant to be overridden, this functions is empty.
Add a condition for this breakpoint.
-
condition
A code snippet for the breakpoint condition.
Destructor.
Members | Descriptions |
---|---|
interpreter() = default` | |
virtual ~interpreter() = default |
Members | Descriptions |
---|---|
void set_init_script(std::vector< std::string > && init_scripts) |
|
void set_init_scripts(const std::vector< std::string > & init_scripts) |
|
bool running() |
|
void set_exit(int code) |
|
void set_program(const std::string & program) |
|
void set_args(const std::vector< std::string > & args) |
|
void set_remote(const std::string & remote) |
|
void enable_debug() |
|
std::ostream & log() |
|
process(const boost::filesystem::path & gdb,const std::string & exe,const std::vector< std::string > & args) |
|
virtual ~process() = default |
|
int exit_code() |
|
void set_log(const std::string & name) |
|
void set_timeout(int value) |
|
void add_break_point(std::unique_ptr< break_point > && ptr)
|
|
void add_break_points(std::vector< std::unique_ptr< break_point >> && ptrs)
|
|
virtual void run() |
Information about a certain address in the program, i.e in source code.
Members | Descriptions |
---|---|
std::string file |
The name of the file the code was generated from. |
std::size_t line |
The line in the file. |
boost::optional<std::string> full_name |
The absolute path of the file. |
boost::optional<std::string> function |
The function this piece of code is part of. |
boost::optional<std::uint64_t> offset |
The offset in the containing function, if available. |
struct metal::debug::arg
: public metal::debug::var
This type represents an argument passed to a function. It inherits var and adds the parameter identifier.
Members | Descriptions |
---|---|
std::string id |
The identifier of the parameter. |
This class represents an entry in the backtrace.
Members | Descriptions |
---|---|
int cnt |
The position in the backtrace. |
boost::optional<std::uint64_t> addr |
Gives the position the functions. |
std::string func |
The name of the functions. |
location loc
|
Location of the function called. |
This function represents a null-terminated string in gdb. Gdb can add a display for a c-string if a char* is passed to a function.
GDB can shorten the string and add an ellipsis at the end.
Members | Descriptions |
---|---|
std::string value |
|
bool ellipsis |
The cstring value extracted from the gdb output. |
This class represents a stackframe. A stackframe let's you examine the stack in gdb. A reference to the frame will be passed to the break-point implementation on invocation.
For more details have a look at the gdb documentation.
Members | Descriptions |
---|---|
const std::string & id() const |
Get the id of the current frame. |
const std::vector< arg > & arg_list() const
|
Get the already read argument list. This means it does not need to be read again. |
const arg & arg_list(std::size_t index) const
|
|
boost::optional<[ address_info](#struct-metaldebugaddress_info) > addr2line(std::uint64_t addr) const
|
Examine the program at the given address. |
std::string get_cstring(std::size_t index) |
This function returns the cstring of the argument requested, if it is a null-terminated string. This will take care of the possible ellipsis of passed cstrings. |
std::unordered_map<std::string, std::uint64_t> regs() |
Returns the map of the registers and their values. |
void set(const std::string & var,const std::string & val) |
Set a variable in the current frame. |
void set(const std::string & var,std::size_t idx,const std::string & val) |
Set a member of an array in the current frame. |
boost::optional< var > call(const std::string & cl)
|
Call a function in the current frame. If not void the return value holds an instance of gdb::var. |
var print(const std::string & id,bool bitwise)` |
Print the value of a symbol in the current frame. |
void return_(const std::string & value) |
Return from the current function. |
void set_exit(int code) |
Sets the program to have exited. This is necessary for embedded environments where there is no operating system. |
void select(int frame) |
This function switches the current frame. The frame of the break-point location is zero, while adding one is always the next outer frame i.e. function call. |
std::vector< backtrace_elem > backtrace()
|
This function returns the backtrace of the current position. |
std::ostream & log() |
This function allows access to the log sink of the gdb-runner. |
class interpreter & interpreter() |
Gives a reference to the interpreter. |
void disable(const break_point & bp)
|
Disable a breakpoint. |
void enable(const break_point & bp)
|
Reenable a breakpoint. |
std::vector<std::uint8_t> read_memory(std::uint64_t addr,std::size_t size) |
Read a chunk of memory. |
void write_memory(std::uint64_t addr,const std::vector< std::uint8_t > & vec) |
Write a chunk of memory. |
Get the id of the current frame.
const std::vector<
arg
> & arg_list() const
Get the already read argument list. This means it does not need to be read again.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This function is for convenience and let's the user access elements in the argument list.
-
index
The index for the element.
const
arg
& arg_list(std::size_t index) const
boost::optional<
address_info
> addr2line(std::uint64_t addr) const
Examine the program at the given address.
Only returns a set value, if the address is in the right space.
This function returns the cstring of the argument requested, if it is a null-terminated string. This will take care of the possible ellipsis of passed cstrings.
-
index
Position of the argument the cstring shall be obtained from.
Returns the map of the registers and their values.
Set a variable in the current frame.
Set a member of an array in the current frame.
boost::optional<
var
> call(const std::string & cl)
Call a function in the current frame. If not void the return value holds an instance of gdb::var.
var
print(const std::string & id,bool bitwise)
Print the value of a symbol in the current frame.
-
id
The name of the symbol -
bitwise
If set true, the value will be printed as an array of binary values.
The printed value
Return from the current function.
-
value
The return value, needs to be passed if the return is not void.
Sets the program to have exited. This is necessary for embedded environments where there is no operating system.
Do only use it in an embedded environment.
-
code
The exit code.
This function switches the current frame. The frame of the break-point location is zero, while adding one is always the next outer frame i.e. function call.
Example
void foo()
{
}
void bar()
{
int value = 42;
foo();
}
If the breakpoint is in foo()
, selecting frame 1, will yield the frame of bar. E.g.:
void invoke(frame &fr)
{
fr.select(1); //select bar
auto val = fr.print("value");
assert(val.value == "42");
}
-
frame
The frame to be selected.
std::vector<
backtrace_elem
> backtrace
()`
This function returns the backtrace of the current position.
See also: The the gdb documentation for more details.
A vector of the backtrace elements.
This function allows access to the log sink of the gdb-runner.
class interpreter &
interpreter
()
Gives a reference to the interpreter.
void disable(const
break_point
& bp)
Disable a breakpoint.
void enable(const
break_point
& bp)
Reenable a breakpoint.
Read a chunk of memory.
Write a chunk of memory.
struct metal::debug::interpreter_error
: public runtime_error
Members | Descriptions |
---|
Simple structure representing a location in code.
Members | Descriptions |
---|---|
std::string file |
The file the location is in. |
int line |
The line in the file. |
The file the location is in.
The line in the file.
This type represents a variable in gdb, as given by frame::print
or frame::call
.
Members | Descriptions |
---|---|
boost::optional<std::uint64_t> ref |
|
std::string value |
The address of the target the value is a reference. |
cstring_t cstring
|
The value as cstring if available. |
The address of the target the value is a reference.
The actually value
cstring_t
cstring
The value as cstring if available.
- Overview
- Runner Introduction
- Runner Invocation
- Runner Plugins
- Runner Extender
- Runner FAQ
- Runner Reference
- Unit Introduction
- Unit Tutorial
- Unit FAQ
- Unit Reference
- Calltrace Introduction
- Calltrace Tutorial
- Calltrace FAQ
- Calltrace Plugin
- Calltrace Reference
- Serial Introduction
- Serial Tutorial
- Serial Invocation
- Serial Reference