Index: sid/component/cgen-cpu/cgen-cpu.h =================================================================== RCS file: /cvs/src/src/sid/component/cgen-cpu/cgen-cpu.h,v retrieving revision 1.17 diff -c -p -r1.17 cgen-cpu.h *** sid/component/cgen-cpu/cgen-cpu.h 10 May 2006 20:58:29 -0000 1.17 --- sid/component/cgen-cpu/cgen-cpu.h 20 Jun 2006 18:25:18 -0000 *************** public: *** 70,76 **** --- 70,80 ---- void disassemble (PCADDR pc, disassembler_ftype printfn, enum bfd_flavour flavour, enum bfd_architecture arch, enum bfd_endian endian, const char *name, CGEN_BITSET *isas = 0, int machine = 0); + string symbol_at_address; struct disassemble_info info; + component *loader; + output_pin disassembly_symbol_address_pin; + protected: static int cgen_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, Index: sid/component/cgen-cpu/compCGEN.cxx =================================================================== RCS file: /cvs/src/src/sid/component/cgen-cpu/compCGEN.cxx,v retrieving revision 1.18 diff -c -p -r1.18 compCGEN.cxx *** sid/component/cgen-cpu/compCGEN.cxx 11 May 2006 14:33:40 -0000 1.18 --- sid/component/cgen-cpu/compCGEN.cxx 20 Jun 2006 18:25:18 -0000 *************** using namespace cgen; *** 42,47 **** --- 42,48 ---- // ---------------------------------------------------------------------------- cgen_bi_endian_cpu::cgen_bi_endian_cpu () { + loader = 0; branch_was_return = false; warnings_enabled = false; add_attribute ("enable-warnings?", & warnings_enabled, "setting"); *************** cgen_bi_endian_cpu::cgen_bi_endian_cpu ( *** 50,55 **** --- 51,58 ---- & cgen_bi_endian_cpu::set_engine_type, & cgen_bi_endian_cpu::get_engine_type, "setting"); + add_uni_relation("loader", &loader); + add_pin ("disassembly-symbol-address", & disassembly_symbol_address_pin); } *************** cgen_bi_endian_cpu::cgen_print_address(b *** 230,245 **** { cgen_bi_endian_cpu *thisp = static_cast(info->application_data); ! thisp->trace_stream ! << "0x" << hex << addr << dec; } int cgen_bi_endian_cpu::cgen_symbol_at_address(bfd_vma addr, struct disassemble_info * info) { ! cerr << "cgen_bi_endian_cpu::symbol_at_address!?" << endl; ! return 0; } --- 233,265 ---- { cgen_bi_endian_cpu *thisp = static_cast(info->application_data); ! thisp->trace_stream << hex << addr << dec; ! ! if (cgen_symbol_at_address (addr, info)) ! if (! thisp->symbol_at_address.empty ()) ! thisp->trace_stream << " <" << thisp->symbol_at_address << '>'; } int cgen_bi_endian_cpu::cgen_symbol_at_address(bfd_vma addr, struct disassemble_info * info) { ! cgen_bi_endian_cpu *thisp = static_cast(info->application_data); ! if (thisp->loader) ! { ! thisp->disassembly_symbol_address_pin.drive (addr); ! thisp->symbol_at_address = thisp->loader->attribute_value("current-function"); ! } ! else ! thisp->symbol_at_address = ""; ! ! if (thisp->symbol_at_address.empty ()) ! { ! cerr << "cgen_bi_endian_cpu::symbol_at_address!?" << endl; ! return 0; // failed ! } ! ! return 1; // success } Index: sid/main/dynamic/commonCfg.cxx =================================================================== RCS file: /cvs/src/src/sid/main/dynamic/commonCfg.cxx,v retrieving revision 1.13 diff -c -p -r1.13 commonCfg.cxx *** sid/main/dynamic/commonCfg.cxx 14 Jun 2006 20:41:28 -0000 1.13 --- sid/main/dynamic/commonCfg.cxx 20 Jun 2006 18:25:18 -0000 *************** void BoardCfg::write_config (Writer &w) *** 1256,1261 **** --- 1256,1269 ---- { AggregateCfg::write_config (w); + // Make the connection which allows the cpu to query the loader regarding + // addresses. + if (loader) + { + Relation (cpu, "loader", loader).write_to (w); + PinConnection (cpu, "disassembly-symbol-address", loader, "function?").write_to (w); + } + if (gloss) { if (gdb) Index: sid/component/loader/compLoader.cxx =================================================================== RCS file: /cvs/src/src/sid/component/loader/compLoader.cxx,v retrieving revision 1.12 diff -c -p -r1.12 compLoader.cxx *** sid/component/loader/compLoader.cxx 1 Mar 2006 21:07:01 -0000 1.12 --- sid/component/loader/compLoader.cxx 20 Jun 2006 18:25:18 -0000 *************** void *** 420,426 **** elf_loader::check_function_pin_handler (host_int_4 addr) { // Find the function corresponding to the given address in the symbol ! // table, if any, and set current_function to that name. If no function is // found, set current_function to a string representing the address. if (symbol_table) { --- 420,426 ---- elf_loader::check_function_pin_handler (host_int_4 addr) { // Find the function corresponding to the given address in the symbol ! // table, if any, and set current_function to that name. If a function is // found, set current_function to a string representing the address. if (symbol_table) {