From: matthew green <mrg@cygnus.com>
To: sid@sources.redhat.com
Subject: re: RFA: loader Elf64 loader & split insn/data accessors
Date: Sat, 13 Jan 2001 21:08:00 -0000 [thread overview]
Message-ID: <14951.979448688@cygnus.com> (raw)
In-Reply-To: <20493.979441944@cygnus.com>
OK, done. i still need to finish the debugger changes for this also.
this is the debugger patch. it adds a new "debugger_bus_insn" to each
component, default to the insn_bus (as "debugger_bus" defaults to the
data_bus). in the GDB component, it looks for the "debugger-bus-insn"
for accesses with bit 33 set, or in the old "debugger-bus" otherwise.
i've tested this change with a couple of internal ports and it seems
to work OK...
.mrg.
[component/gdb/ChangeLog]
2001-01-14 matthew green <mrg@redhat.com>
* gdb.cxx (gdb::process_get_mem): Use "debugger-bus-insn" for
addresses with bit 33 set.
(gdb::process_set_mem): Likewise.
[include/ChangeLog]
2001-01-14 matthew green <mrg@redhat.com>
* include/sidcpuutil.h (basic_cpu): New debugger_bus_insn bus
for debugger access to the instruction bus, attribute name of
"debugger-bus-insn".
Index: component/gdb/gdb.cxx
===================================================================
RCS file: /cvs/cvsfiles/devo/sid/component/gdb/gdb.cxx,v
retrieving revision 1.36
diff -p -r1.36 gdb.cxx
*** gdb.cxx 2001/01/04 17:08:41 1.36
--- gdb.cxx 2001/01/14 04:31:46
*************** gdb::process_get_mem (struct gdbserv_reg
*** 545,563 ****
gdbserv_output_string (gdbserv, "E01");
return;
}
- sid::bus* memory = cpu->find_bus ("debugger-bus");
- if (! memory)
- {
- cerr << "No debugger-bus!" << endl;
- gdbserv_output_string (gdbserv, "E02");
- return;
- }
endian e;
component::status s =
parse_attribute (cpu->attribute_value ("endian"), e);
if (s != component::ok) assert (e == endian_unknown);
// XXX: 64-bit addresses unsupported
if (0 && addr8 >= (1ULL << 32))
{
--- 545,570 ----
gdbserv_output_string (gdbserv, "E01");
return;
}
endian e;
component::status s =
parse_attribute (cpu->attribute_value ("endian"), e);
if (s != component::ok) assert (e == endian_unknown);
+ // XXX: 33-bit addresses -> 0x1.0000.0000 -> insn ram
+ string which_bus;
+ if (addr8 & 0x100000000ULL)
+ which_bus = "debugger-bus-insn";
+ else
+ which_bus = "debugger-bus";
+ sid::bus* memory = cpu->find_bus (which_bus);
+ if (!memory)
+ {
+ cerr << "No " << which_bus << "!" << endl;
+ gdbserv_output_string (gdbserv, "E02");
+ return;
+ }
+
// XXX: 64-bit addresses unsupported
if (0 && addr8 >= (1ULL << 32))
{
*************** gdb::process_set_mem (struct gdbserv_reg
*** 625,642 ****
gdbserv_output_string (gdbserv, "E01");
return;
}
- sid::bus* memory = cpu->find_bus ("debugger-bus");
- if (! memory)
- {
- cerr << "No debugger-bus!" << endl;
- gdbserv_output_string (gdbserv, "E02");
- return;
- }
endian e;
component::status s =
parse_attribute (cpu->attribute_value ("endian"), e);
if (s != component::ok) assert (e == endian_unknown);
// XXX: 64-bit addresses unsupported
if (0 && addr8 >= (1ULL << 32))
--- 632,656 ----
gdbserv_output_string (gdbserv, "E01");
return;
}
endian e;
component::status s =
parse_attribute (cpu->attribute_value ("endian"), e);
if (s != component::ok) assert (e == endian_unknown);
+
+ // XXX: 33-bit addresses -> 0x1.0000.0000 -> insn ram
+ string which_bus;
+ if (addr8 & 0x100000000ULL)
+ which_bus = "debugger-bus-insn";
+ else
+ which_bus = "debugger-bus";
+ sid::bus* memory = cpu->find_bus (which_bus);
+ if (! memory)
+ {
+ cerr << "No " << which_bus << "!" << endl;
+ gdbserv_output_string (gdbserv, "E02");
+ return;
+ }
// XXX: 64-bit addresses unsupported
if (0 && addr8 >= (1ULL << 32))
Index: include/sidcpuutil.h
===================================================================
RCS file: /cvs/cvsfiles/devo/sid/include/sidcpuutil.h,v
retrieving revision 1.17
diff -p -r1.17 sidcpuutil.h
*** sidcpuutil.h 2001/01/10 19:41:02 1.17
--- sidcpuutil.h 2001/01/14 04:31:46
*************** namespace sidutil
*** 350,355 ****
--- 350,356 ----
// debugger access functions
private:
passthrough_bus debugger_bus;
+ passthrough_bus debugger_bus_insn;
virtual std::string dbg_get_reg (sid::host_int_4 n) = 0;
virtual sid::component::status dbg_set_reg (sid::host_int_4 n, const std::string& s) = 0;
*************** public:
*** 402,408 ****
flush_icache_pin (this, & basic_cpu::flush_icache_pin_handler),
pc_set_pin (this, & basic_cpu::pc_set_pin_handler),
endian_set_pin (this, & basic_cpu::endian_set_pin_handler),
! debugger_bus (& this->data_bus)
{
// buses
this->data_bus = 0;
--- 403,410 ----
flush_icache_pin (this, & basic_cpu::flush_icache_pin_handler),
pc_set_pin (this, & basic_cpu::pc_set_pin_handler),
endian_set_pin (this, & basic_cpu::endian_set_pin_handler),
! debugger_bus (& this->data_bus),
! debugger_bus_insn (& this->insn_bus)
{
// buses
this->data_bus = 0;
*************** public:
*** 410,415 ****
--- 412,418 ----
this->insn_bus = 0;
add_accessor ("insn-memory", & this->insn_bus);
add_bus ("debugger-bus", & this->debugger_bus);
+ add_bus ("debugger-bus-insn", & this->debugger_bus_insn);
// pins
add_pin ("step!", & this->step_pin);
next prev parent reply other threads:[~2001-01-13 21:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-13 4:01 matthew green
2001-01-13 5:41 ` Frank Ch. Eigler
2001-01-13 19:12 ` matthew green
2001-01-13 21:08 ` matthew green [this message]
2001-01-14 9:55 ` Frank Ch. Eigler
2001-01-15 8:28 ` debugger_bus_insn dead (was: re: RFA: loader Elf64 loader & split insn/data accessors) matthew green
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14951.979448688@cygnus.com \
--to=mrg@cygnus.com \
--cc=sid@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).