3 #include "SymbolParser.h"
4 #include "Controller.h"
10 SymbolParser::SymbolParser(Misc::SmartPointer
<Controller
> gdb_controller
) : gdb_controller(gdb_controller
) {
11 assembly_parser
= new AssemblyParser();
12 previous_stream_handler
= gdb_controller
->get_processor()->get_stream_handler();
13 gdb_controller
->get_processor()->set_stream_handler(this);
18 SymbolParser::~SymbolParser() {
19 gdb_controller
->get_processor()->set_stream_handler(previous_stream_handler
);
22 void SymbolParser::parse_symbol(Misc::SmartPointer
<Symbol
> symbol
) {
23 if(symbol
->is_parsed()) return;
24 current_symbol
= symbol
;
25 gdb_controller
->send_command(Misc::StreamAsString() << "-interpreter-exec console \"x/i " << symbol
->get_address() << "\"");
26 gdb_controller
->listen();
28 gdb_controller
->send_command(Misc::StreamAsString() << "-interpreter-exec console \"x/i\"");
29 gdb_controller
->listen();
33 symbol
->set_parsed(true);
36 void SymbolParser::handle_stream(Misc::SmartPointer
<StreamOutput
> stream
) {
37 std::cout
<< "Received stream \"" << stream
->get_stream_data() << "\"" << std::endl
;
44 std::string symbol_name
;
46 scope
= symbol_name
.substr(1, symbol_name
.length()-3);
47 std::cout
<< "Scope is: \"" << scope
<< "\"\n";
52 } // namespace Interface
53 } // namespace Aesalon