|
Nemiver
0.3
|
#include <nmv-gdbmi-parser.h>
Public Types | |
| enum | Mode { UNDEFINED_MODE =0, STRICT_MODE, BROKEN_MODE } |
| Parsing mode. More... | |
Public Member Functions | |
| GDBMIParser (Mode a_mode=STRICT_MODE) | |
| GDBMIParser (const UString &a_input, Mode a_mode=STRICT_MODE) | |
| virtual | ~GDBMIParser () |
| void | push_input (const UString &a_input) |
| void | pop_input () |
| const UString & | get_input () const |
| void | set_mode (Mode) |
| Mode | get_mode () const |
| bool | parse_string (UString::size_type a_from, UString::size_type &a_to, UString &a_string) |
| bool | parse_octal_escape (UString::size_type a_from, UString::size_type &a_to, unsigned char &a_byte_value) |
| bool | parse_octal_escape_sequence (UString::size_type a_from, UString::size_type &a_to, UString &a_result) |
| bool | parse_c_string_body (UString::size_type a_from, UString::size_type &a_to, UString &a_string) |
| bool | parse_c_string (UString::size_type a_from, UString::size_type &a_to, UString &a_c_string) |
| bool | parse_embedded_c_string_body (UString::size_type a_from, UString::size_type &a_to, UString &a_string) |
| bool | parse_embedded_c_string (UString::size_type a_from, UString::size_type &a_to, UString &a_string) |
| bool | parse_gdbmi_result (UString::size_type a_from, UString::size_type &a_to, GDBMIResultSafePtr &a_value) |
| bool | parse_gdbmi_value (UString::size_type a_from, UString::size_type &a_to, GDBMIValueSafePtr &a_value) |
| parse a GDB/MI value. GDB/MI value type is defined as: VALUE ==> CONST | TUPLE | LIST CONSTis a string, basically. Look at parse_string() for more. TUPLE is a GDB/MI tuple. Look at parse_tuple() for more. LIST is a GDB/MI list. It is either a list of GDB/MI Result or a list of GDB/MI value. Yeah, that can be recursive ... To parse a GDB/MI list, we use parse_list() defined above. You can look at the GDB/MI output syntax for more. More... | |
| bool | parse_gdbmi_tuple (UString::size_type a_from, UString::size_type &a_to, GDBMITupleSafePtr &a_tuple) |
| bool | parse_gdbmi_list (UString::size_type a_from, UString::size_type &a_to, GDBMIListSafePtr &a_list) |
| bool | parse_gdbmi_string_result (UString::size_type a_from, UString::size_type &a_to, UString &a_variable, UString &a_value) |
| bool | parse_stream_record (UString::size_type a_from, UString::size_type &a_to, Output::StreamRecord &a_record) |
| bool | parse_stopped_async_output (UString::size_type a_from, UString::size_type &a_to, bool &a_got_frame, IDebugger::Frame &a_frame, map< UString, UString > &a_attrs) |
| bool | parse_running_async_output (UString::size_type a_from, UString::size_type &a_to, int &a_thread_id) |
| bool | parse_thread_selected_async_output (UString::size_type a_from, UString::size_type &a_to, int &a_thread_id) |
| bool | parse_attribute (UString::size_type a_from, UString::size_type &a_to, UString &a_name, UString &a_value) |
| bool | parse_attribute (UString::size_type a_from, UString::size_type &a_to, UString &a_name, GDBMIResultSafePtr &a_value) |
| bool | parse_attributes (UString::size_type a_from, UString::size_type &a_to, map< UString, UString > &a_attrs) |
| parses an attribute list More... | |
| bool | parse_frame (UString::size_type a_from, UString::size_type &a_to, IDebugger::Frame &a_frame) |
| parses a function frame More... | |
| bool | parse_out_of_band_record (UString::size_type a_from, UString::size_type &a_to, Output::OutOfBandRecord &a_record) |
| bool | parse_breakpoint_with_one_loc (Glib::ustring::size_type a_from, Glib::ustring::size_type &a_to, bool is_sub_breakpoint, IDebugger::Breakpoint &a_bkpt) |
| bool | parse_breakpoint (Glib::ustring::size_type a_from, Glib::ustring::size_type &a_to, IDebugger::Breakpoint &a_bkpt) |
| parses a breakpoint definition as returned by gdb. More... | |
| bool | parse_breakpoint_table (UString::size_type a_from, UString::size_type &a_to, map< string, IDebugger::Breakpoint > &a_breakpoints) |
| bool | parse_breakpoint_modified_async_output (UString::size_type a_from, UString::size_type &a_to, IDebugger::Breakpoint &a_b) |
| bool | parse_threads_list (UString::size_type a_from, UString::size_type &a_to, std::list< int > &a_thread_ids) |
| bool | parse_new_thread_id (UString::size_type a_from, UString::size_type &a_to, int &a_thread_id, IDebugger::Frame &a_frame) |
| bool | parse_file_list (UString::size_type a_from, UString::size_type &a_to, std::vector< UString > &a_files) |
| bool | parse_call_stack (const UString::size_type a_from, UString::size_type &a_to, vector< IDebugger::Frame > &a_stack) |
| bool | parse_stack_arguments (UString::size_type a_from, UString::size_type &a_to, map< int, list< IDebugger::VariableSafePtr > > &a_params) |
| bool | parse_local_var_list (UString::size_type a_from, UString::size_type &a_to, list< IDebugger::VariableSafePtr > &a_vars) |
| bool | parse_member_variable (const UString::size_type a_from, UString::size_type &a_to, IDebugger::VariableSafePtr &a_var, bool a_in_unnamed_var=false) |
| bool | parse_variable_value (const UString::size_type a_from, UString::size_type &a_to, IDebugger::VariableSafePtr &a_var) |
| bool | parse_overloads_choice_prompt (UString::size_type a_from, UString::size_type &a_to, vector< IDebugger::OverloadsChoiceEntry > &a_prompts) |
| bool | parse_register_names (UString::size_type a_from, UString::size_type &a_to, std::map< IDebugger::register_id_t, UString > &a_registers) |
| bool | parse_changed_registers (UString::size_type a_from, UString::size_type &a_to, std::list< IDebugger::register_id_t > &a_regs) |
| bool | parse_register_values (UString::size_type a_from, UString::size_type &a_to, std::map< IDebugger::register_id_t, UString > &a_values) |
| bool | parse_memory_values (UString::size_type a_from, UString::size_type &a_to, size_t &a_start_addr, std::vector< uint8_t > &a_values) |
| bool | parse_asm_instruction_list (UString::size_type a_from, UString::size_type &a_to, std::list< common::Asm > &a_asm) |
| bool | parse_variable (UString::size_type a_from, UString::size_type &a_to, IDebugger::VariableSafePtr &a_var) |
| bool | parse_variables_deleted (UString::size_type a_from, UString::size_type &a_to, unsigned int &a_nb_vars_deleted) |
| bool | parse_var_list_children (UString::size_type a_from, UString::size_type &a_to, vector< IDebugger::VariableSafePtr > &a_vars) |
| bool | parse_var_changed_list (UString::size_type a_from, UString::size_type &a_to, list< VarChangePtr > &a_var_changes) |
| bool | parse_var_path_expression (UString::size_type a_from, UString::size_type &a_to, UString &a_expression) |
| bool | parse_variable_format (UString::size_type a_from, UString::size_type &a_to, IDebugger::Variable::Format &a_format, UString &a_value) |
| bool | parse_result_record (UString::size_type a_from, UString::size_type &a_to, Output::ResultRecord &a_record) |
| bool | parse_output_record (UString::size_type a_from, UString::size_type &a_to, Output &a_output) |
| parse a GDB/MI output record More... | |
| bool | skip_output_record (UString::size_type a_from, UString::size_type &a_to) |
|
explicit |
|
explicit |
|
virtual |
| const UString& nemiver::GDBMIParser::get_input | ( | ) | const |
| Mode nemiver::GDBMIParser::get_mode | ( | ) | const |
| bool nemiver::GDBMIParser::parse_asm_instruction_list | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| std::list< common::Asm > & | a_asm | ||
| ) |
parse an asm instruction description as returned by GDB/MI
| bool nemiver::GDBMIParser::parse_attribute | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_name, | ||
| GDBMIResultSafePtr & | a_value | ||
| ) |
| bool nemiver::GDBMIParser::parse_attribute | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_name, | ||
| UString & | a_value | ||
| ) |
| bool nemiver::GDBMIParser::parse_attributes | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| map< UString, UString > & | a_attrs | ||
| ) |
parses an attribute list
An attribute list has the form: attr0="val0",attr1="bal1",attr2="val2"
| bool nemiver::GDBMIParser::parse_breakpoint | ( | Glib::ustring::size_type | a_from, |
| Glib::ustring::size_type & | a_to, | ||
| IDebugger::Breakpoint & | a_bkpt | ||
| ) |
parses a breakpoint definition as returned by gdb.
breakpoint definition string looks like this: bkpt={number="3",type="breakpoint",disp="keep",enabled="y", addr="0x0804860e",func="func2()",file="fooprog.cc",line="13",times="0"}
| a_input | the input string to parse. |
| a_from | where to start the parsing from |
| a_to | out parameter. A past the end iterator that point the the end of the parsed text. This is set if and only if the function completes successfuly |
| a_output | the output datatructure filled upon parsing. |
| bool nemiver::GDBMIParser::parse_breakpoint_modified_async_output | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| IDebugger::Breakpoint & | a_b | ||
| ) |
Parse a GDB/MI async output that says that a breakpoint that was set (e.g before the inferior is run) has changed (e.g after the inferior started to run).
| bool nemiver::GDBMIParser::parse_breakpoint_table | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| map< string, IDebugger::Breakpoint > & | a_breakpoints | ||
| ) |
| bool nemiver::GDBMIParser::parse_breakpoint_with_one_loc | ( | Glib::ustring::size_type | a_from, |
| Glib::ustring::size_type & | a_to, | ||
| bool | is_sub_breakpoint, | ||
| IDebugger::Breakpoint & | a_bkpt | ||
| ) |
| bool nemiver::GDBMIParser::parse_c_string | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_c_string | ||
| ) |
parses a string that has the form: "blah"
| bool nemiver::GDBMIParser::parse_c_string_body | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_string | ||
| ) |
| bool nemiver::GDBMIParser::parse_call_stack | ( | const UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| vector< IDebugger::Frame > & | a_stack | ||
| ) |
parse a callstack as returned by the gdb/mi command: -stack-list-frames
| bool nemiver::GDBMIParser::parse_changed_registers | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| std::list< IDebugger::register_id_t > & | a_regs | ||
| ) |
| bool nemiver::GDBMIParser::parse_embedded_c_string | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_string | ||
| ) |
| bool nemiver::GDBMIParser::parse_embedded_c_string_body | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_string | ||
| ) |
| bool nemiver::GDBMIParser::parse_file_list | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| std::vector< UString > & | a_files | ||
| ) |
parses the result of the gdbmi command "-file-list-exec-source-files".
| bool nemiver::GDBMIParser::parse_frame | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| IDebugger::Frame & | a_frame | ||
| ) |
parses a function frame
function frames have the form: frame={addr="0x080485fa",func="func1",args=[{name="foo", value="bar"}], file="fooprog.cc",fullname="/foo/fooprog.cc",line="6"}
| a_input | the input string to parse |
| a_from | where to parse from. |
| a_to | out parameter. Where the parser went after the parsing. |
| a_frame | the parsed frame. It is set if and only if the function returns true. |
| bool nemiver::GDBMIParser::parse_gdbmi_list | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| GDBMIListSafePtr & | a_list | ||
| ) |
Parse a GDB/MI LIST. A list is either a list of GDB/MI Results or a list of GDB/MI Values. Look at the GDB/MI output syntax documentation for more.
| bool nemiver::GDBMIParser::parse_gdbmi_result | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| GDBMIResultSafePtr & | a_value | ||
| ) |
parse a GDB/MI Result data structure. A result basically has the form: variable=value. Beware value is more complicated than what it looks like :-) Look at the GDB/MI spec for more.
| bool nemiver::GDBMIParser::parse_gdbmi_string_result | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_variable, | ||
| UString & | a_value | ||
| ) |
Parses a GDB/MI RESULT result=value where value is a string. This is a quick helper that uses parse_gdbmi_result.
| bool nemiver::GDBMIParser::parse_gdbmi_tuple | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| GDBMITupleSafePtr & | a_tuple | ||
| ) |
parse a GDB/MI Tuple is a actualy a set of name=value constructs, where 'value' can be quite complicated. Look at the GDB/MI output syntax for more.
| bool nemiver::GDBMIParser::parse_gdbmi_value | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| GDBMIValueSafePtr & | a_value | ||
| ) |
parse a GDB/MI value. GDB/MI value type is defined as: VALUE ==> CONST | TUPLE | LIST CONSTis a string, basically. Look at parse_string() for more. TUPLE is a GDB/MI tuple. Look at parse_tuple() for more. LIST is a GDB/MI list. It is either a list of GDB/MI Result or a list of GDB/MI value. Yeah, that can be recursive ... To parse a GDB/MI list, we use parse_list() defined above. You can look at the GDB/MI output syntax for more.
| a_input | the input string to parse |
| a_from | where to start parsing from |
| a_to | (out parameter) a pointer to the current char, after the parsing. |
| bool nemiver::GDBMIParser::parse_local_var_list | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| list< IDebugger::VariableSafePtr > & | a_vars | ||
| ) |
parse a list of local variables as returned by the GDBMI command -stack-list-locals 2
| bool nemiver::GDBMIParser::parse_member_variable | ( | const UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| IDebugger::VariableSafePtr & | a_var, | ||
| bool | a_in_unnamed_var = false |
||
| ) |
| bool nemiver::GDBMIParser::parse_memory_values | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| size_t & | a_start_addr, | ||
| std::vector< uint8_t > & | a_values | ||
| ) |
| bool nemiver::GDBMIParser::parse_new_thread_id | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| int & | a_thread_id, | ||
| IDebugger::Frame & | a_frame | ||
| ) |
parses the result of the gdbmi command "-thread-select"
| a_input | the input string to parse |
| a_from | the offset from where to start the parsing |
| a_to. | out parameter. The next offset after the end of what got parsed. |
| a_thread_id | out parameter. The id of the selected thread. |
| a_frame | out parameter. The current frame in the selected thread. |
| a_level | out parameter. the level |
| bool nemiver::GDBMIParser::parse_octal_escape | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| unsigned char & | a_byte_value | ||
| ) |
| bool nemiver::GDBMIParser::parse_octal_escape_sequence | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_result | ||
| ) |
| bool nemiver::GDBMIParser::parse_out_of_band_record | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| Output::OutOfBandRecord & | a_record | ||
| ) |
| bool nemiver::GDBMIParser::parse_output_record | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| Output & | a_output | ||
| ) |
parse a GDB/MI output record
| bool nemiver::GDBMIParser::parse_overloads_choice_prompt | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| vector< IDebugger::OverloadsChoiceEntry > & | a_prompts | ||
| ) |
| bool nemiver::GDBMIParser::parse_register_names | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| std::map< IDebugger::register_id_t, UString > & | a_registers | ||
| ) |
| bool nemiver::GDBMIParser::parse_register_values | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| std::map< IDebugger::register_id_t, UString > & | a_values | ||
| ) |
| bool nemiver::GDBMIParser::parse_result_record | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| Output::ResultRecord & | a_record | ||
| ) |
| bool nemiver::GDBMIParser::parse_running_async_output | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| int & | a_thread_id | ||
| ) |
parse GDBMI async output that says that the inferior process is running. the string looks like: *running,thread-id="<thread-id>" Note that <thread-id> is either a number, or the string 'all'.
| bool nemiver::GDBMIParser::parse_stack_arguments | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| map< int, list< IDebugger::VariableSafePtr > > & | a_params | ||
| ) |
Parse the arguments of the call stack. The call stack arguments is the result of the GDB/MI command -stack-list-arguments 1. It is basically the arguments of the functions of the call stack. See the GDB/MI documentation for more.
| bool nemiver::GDBMIParser::parse_stopped_async_output | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| bool & | a_got_frame, | ||
| IDebugger::Frame & | a_frame, | ||
| map< UString, UString > & | a_attrs | ||
| ) |
parse GDBMI async output that says that the debugger has stopped. the string looks like: *stopped,reason="foo",var0="foo0",var1="foo1",frame={<a-frame>}
| bool nemiver::GDBMIParser::parse_stream_record | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| Output::StreamRecord & | a_record | ||
| ) |
| bool nemiver::GDBMIParser::parse_string | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_string | ||
| ) |
parses a string that has the form: blah
| bool nemiver::GDBMIParser::parse_thread_selected_async_output | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| int & | a_thread_id | ||
| ) |
parse GBBMI async output that says which thread was selected in in the inferior the string looks like: =thread-selected,thread-id="<thread-id"
| bool nemiver::GDBMIParser::parse_threads_list | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| std::list< int > & | a_thread_ids | ||
| ) |
parses the result of the gdbmi command "-thread-list-ids".
| bool nemiver::GDBMIParser::parse_var_changed_list | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| list< VarChangePtr > & | a_var_changes | ||
| ) |
| bool nemiver::GDBMIParser::parse_var_list_children | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| vector< IDebugger::VariableSafePtr > & | a_vars | ||
| ) |
| bool nemiver::GDBMIParser::parse_var_path_expression | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| UString & | a_expression | ||
| ) |
| bool nemiver::GDBMIParser::parse_variable | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| IDebugger::VariableSafePtr & | a_var | ||
| ) |
| bool nemiver::GDBMIParser::parse_variable_format | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| IDebugger::Variable::Format & | a_format, | ||
| UString & | a_value | ||
| ) |
| bool nemiver::GDBMIParser::parse_variable_value | ( | const UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| IDebugger::VariableSafePtr & | a_var | ||
| ) |
parse the result of -data-evaluate-expression <var-name> the result is a gdbmi result of the form: value={attrname0=val0, attrname1=val1,...} where val0 and val1 can be simili tuples representing complex types as well.
| bool nemiver::GDBMIParser::parse_variables_deleted | ( | UString::size_type | a_from, |
| UString::size_type & | a_to, | ||
| unsigned int & | a_nb_vars_deleted | ||
| ) |
| void nemiver::GDBMIParser::pop_input | ( | ) |
| void nemiver::GDBMIParser::push_input | ( | const UString & | a_input | ) |
| void nemiver::GDBMIParser::set_mode | ( | Mode | ) |
| bool nemiver::GDBMIParser::skip_output_record | ( | UString::size_type | a_from, |
| UString::size_type & | a_to | ||
| ) |
1.8.17