26 #ifndef __NMV_GDBMI_PARSER_H
27 #define __NMV_GDBMI_PARSER_H
28 #include <boost/variant.hpp>
33 NEMIVER_BEGIN_NAMESPACE (
nemiver)
50 list<GDBMIResultSafePtr> m_content;
60 const list<GDBMIResultSafePtr>& content ()
const;
61 void content (
const list<GDBMIResultSafePtr> &a_in);
75 typedef boost::variant<bool,
79 ContentType m_content;
110 return boost::get<UString> (m_content);
116 return boost::get<GDBMIListSafePtr> (m_content);
121 return boost::get<GDBMIListSafePtr> (m_content);
128 return boost::get<GDBMITupleSafePtr> (m_content);
134 return boost::get<GDBMITupleSafePtr> (m_content);
164 bool is_singular=
false) :
165 m_variable (a_variable),
167 m_is_singular (is_singular)
183 list<boost::variant<GDBMIResultSafePtr, GDBMIValueSafePtr> > m_content;
204 m_content.push_back (value);
214 m_content.push_back (value);
223 m_content.push_back (a_result);
232 m_content.push_back (a_value);
238 if (m_content.empty ()) {
239 return UNDEFINED_TYPE;
244 bool empty ()
const {
return m_empty;}
249 if (!m_content.empty ()) {
252 m_content.push_back (a_result);
258 if (!m_content.empty ()) {
261 m_content.push_back (a_value);
267 if (empty ()) {
return;}
269 list<boost::variant<GDBMIResultSafePtr,GDBMIValueSafePtr> >::const_iterator it;
270 for (it= m_content.begin (); it!= m_content.end () ; ++it) {
271 a_list.push_back (boost::get<GDBMIResultSafePtr> (*it));
277 if (empty ()) {
return;}
279 list<boost::variant<GDBMIResultSafePtr,GDBMIValueSafePtr> >::const_iterator it;
280 for (it= m_content.begin (); it!= m_content.end () ; ++it) {
281 a_list.push_back (boost::get<GDBMIValueSafePtr> (*it));
303 operator<< (std::ostream &a_out,
const IDebugger::Variable &a_var);
329 list<common::AsmInstr>&,
330 string::size_type a_cur);
333 list<common::MixedAsmInstr>&,
334 string::size_type a_cur);
350 void push_input (
const UString &a_input);
352 const UString& get_input ()
const;
354 void set_mode (Mode);
355 Mode get_mode ()
const;
363 bool parse_string (UString::size_type a_from,
364 UString::size_type &a_to,
367 bool parse_octal_escape (UString::size_type a_from,
368 UString::size_type &a_to,
369 unsigned char &a_byte_value);
371 bool parse_octal_escape_sequence (UString::size_type a_from,
372 UString::size_type &a_to,
375 bool parse_c_string_body (UString::size_type a_from,
376 UString::size_type &a_to,
381 bool parse_c_string (UString::size_type a_from,
382 UString::size_type &a_to,
385 bool parse_embedded_c_string_body (UString::size_type a_from,
386 UString::size_type &a_to,
389 bool parse_embedded_c_string (UString::size_type a_from,
390 UString::size_type &a_to,
398 bool parse_gdbmi_result (UString::size_type a_from,
399 UString::size_type &a_to,
416 bool parse_gdbmi_value (UString::size_type a_from,
417 UString::size_type &a_to,
423 bool parse_gdbmi_tuple (UString::size_type a_from,
424 UString::size_type &a_to,
430 bool parse_gdbmi_list (UString::size_type a_from,
431 UString::size_type &a_to,
436 bool parse_gdbmi_string_result (UString::size_type a_from,
437 UString::size_type &a_to,
441 bool parse_stream_record (UString::size_type a_from,
442 UString::size_type &a_to,
449 bool parse_stopped_async_output (UString::size_type a_from,
450 UString::size_type &a_to,
453 map<UString, UString> &a_attrs);
460 bool parse_running_async_output (UString::size_type a_from,
461 UString::size_type &a_to,
468 bool parse_thread_selected_async_output (UString::size_type a_from,
469 UString::size_type &a_to,
472 bool parse_attribute (UString::size_type a_from,
473 UString::size_type &a_to,
477 bool parse_attribute (UString::size_type a_from,
478 UString::size_type &a_to,
486 bool parse_attributes (UString::size_type a_from,
487 UString::size_type &a_to,
488 map<UString, UString> &a_attrs);
502 bool parse_frame (UString::size_type a_from,
503 UString::size_type &a_to,
506 bool parse_out_of_band_record (UString::size_type a_from,
507 UString::size_type &a_to,
510 bool parse_breakpoint_with_one_loc (Glib::ustring::size_type a_from,
511 Glib::ustring::size_type &a_to,
512 bool is_sub_breakpoint,
528 bool parse_breakpoint (Glib::ustring::size_type a_from,
529 Glib::ustring::size_type &a_to,
532 bool parse_breakpoint_table (UString::size_type a_from,
533 UString::size_type &a_to,
534 map<string, IDebugger::Breakpoint> &a_breakpoints);
539 bool parse_breakpoint_modified_async_output (UString::size_type a_from,
540 UString::size_type &a_to,
545 bool parse_threads_list (UString::size_type a_from,
546 UString::size_type &a_to,
547 std::list<int> &a_thread_ids);
558 bool parse_new_thread_id (UString::size_type a_from,
559 UString::size_type &a_to,
565 bool parse_file_list (UString::size_type a_from,
566 UString::size_type &a_to,
567 std::vector<UString> &a_files);
571 bool parse_call_stack (
const UString::size_type a_from,
572 UString::size_type &a_to,
573 vector<IDebugger::Frame> &a_stack);
580 bool parse_stack_arguments
581 (UString::size_type a_from,
582 UString::size_type &a_to,
583 map<
int, list<IDebugger::VariableSafePtr> > &a_params);
587 bool parse_local_var_list (UString::size_type a_from,
588 UString::size_type &a_to,
589 list<IDebugger::VariableSafePtr> &a_vars);
591 bool parse_member_variable (
const UString::size_type a_from,
592 UString::size_type &a_to,
594 bool a_in_unnamed_var=
false);
600 bool parse_variable_value (
const UString::size_type a_from,
601 UString::size_type &a_to,
604 bool parse_overloads_choice_prompt
605 (UString::size_type a_from,
606 UString::size_type &a_to,
607 vector<IDebugger::OverloadsChoiceEntry> &a_prompts);
609 bool parse_register_names (UString::size_type a_from,
610 UString::size_type &a_to,
614 bool parse_changed_registers (UString::size_type a_from,
615 UString::size_type &a_to,
616 std::list<IDebugger::register_id_t> &a_regs);
618 bool parse_register_values (UString::size_type a_from,
619 UString::size_type &a_to,
623 bool parse_memory_values (UString::size_type a_from,
624 UString::size_type &a_to,
625 size_t& a_start_addr,
626 std::vector<uint8_t> &a_values);
630 bool parse_asm_instruction_list (UString::size_type a_from,
631 UString::size_type &a_to,
632 std::list<common::Asm> &a_asm);
634 bool parse_variable (UString::size_type a_from,
635 UString::size_type &a_to,
638 bool parse_variables_deleted (UString::size_type a_from,
639 UString::size_type &a_to,
640 unsigned int &a_nb_vars_deleted);
642 bool parse_var_list_children (UString::size_type a_from,
643 UString::size_type &a_to,
644 vector<IDebugger::VariableSafePtr> &a_vars);
646 bool parse_var_changed_list (UString::size_type a_from,
647 UString::size_type &a_to,
648 list<VarChangePtr> &a_var_changes);
650 bool parse_var_path_expression (UString::size_type a_from,
651 UString::size_type &a_to,
654 bool parse_variable_format (UString::size_type a_from,
655 UString::size_type &a_to,
659 bool parse_result_record (UString::size_type a_from,
660 UString::size_type &a_to,
664 bool parse_output_record (UString::size_type a_from,
665 UString::size_type &a_to,
668 bool skip_output_record (UString::size_type a_from,
669 UString::size_type &a_to);
676 NEMIVER_END_NAMESPACE (
nemiver)
677 #endif //__NMV_GDBMI_PARSER_H