* [patch][commit] trace_counter and GETMEM*, SETMEM*
@ 2006-05-10 21:02 Dave Brolley
0 siblings, 0 replies; only message in thread
From: Dave Brolley @ 2006-05-10 21:02 UTC (permalink / raw)
To: sid
[-- Attachment #1: Type: text/plain, Size: 272 bytes --]
I've committed the attached patch which makes
cgen_bi_endian_cpu::trace_counter a virtual method in order to allow
hooks in inherited classes.
It also fixes an astonishing bug in that some of the GETMEM* and SETMEM*
methods were reading/writing to insn memory.
Dave
[-- Attachment #2: sid-cgen-cpu.ChangeLog --]
[-- Type: text/plain, Size: 266 bytes --]
2006-05-10 Dave Brolley <brolley@redhat.com>
* cgen-cpu.h (trace_counter): Now virtual.
(SETMEMBI): Write to data memory
(class cgen_bi_endian_cpu, class cgen_bi_endian_cpu)
(class cgen_bi_endian_cpu, class cgen_bi_endian_cpu): Read/write
from data memory.
[-- Attachment #3: sid-cgen-cpu.patch.txt --]
[-- Type: text/plain, Size: 2906 bytes --]
Index: sid/component/cgen-cpu/cgen-cpu.h
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/cgen-cpu.h,v
retrieving revision 1.16
diff -c -p -r1.16 cgen-cpu.h
*** sid/component/cgen-cpu/cgen-cpu.h 28 Oct 2005 19:53:33 -0000 1.16
--- sid/component/cgen-cpu/cgen-cpu.h 10 May 2006 20:54:25 -0000
*************** protected:
*** 80,86 ****
struct disassemble_info *info);
static int cgen_symbol_at_address(bfd_vma addr, struct disassemble_info * info);
// Counter tracing support
! void trace_counter (PCADDR pc);
public:
// Called by semantic code to perform branches.
--- 80,86 ----
struct disassemble_info *info);
static int cgen_symbol_at_address(bfd_vma addr, struct disassemble_info * info);
// Counter tracing support
! virtual void trace_counter (PCADDR pc);
public:
// Called by semantic code to perform branches.
*************** public:
*** 128,134 ****
inline void
SETMEMBI(PCADDR pc, ADDR addr, BI value)
{
! return this->write_insn_memory_1 (pc, addr, value);
}
inline void
SETMEMQI(PCADDR pc, ADDR addr, QI value)
--- 128,134 ----
inline void
SETMEMBI(PCADDR pc, ADDR addr, BI value)
{
! return this->write_data_memory_1 (pc, addr, value);
}
inline void
SETMEMQI(PCADDR pc, ADDR addr, QI value)
*************** public:
*** 200,226 ****
inline SF
GETMEMSF(PCADDR pc, IADDR addr)
{
! SI iv = this->read_insn_memory_4 (pc, addr);
return * (SF *)(char *)(& iv);
}
inline void
SETMEMSF(PCADDR pc, ADDR addr, SF value)
{
SI iv = * (SI *)(char *)(& value);
! return this->write_insn_memory_4 (pc, addr, iv);
}
inline DF
GETMEMDF(PCADDR pc, IADDR addr)
{
! DI iv = this->read_insn_memory_8 (pc, addr);
return * (DF *)(char *)(& iv);
}
inline void
SETMEMDF(PCADDR pc, ADDR addr, DF value)
{
DI iv = * (DI *)(char *)(& value);
! return this->write_insn_memory_8 (pc, addr, iv);
}
// IMEM: instruction memory calls
--- 200,226 ----
inline SF
GETMEMSF(PCADDR pc, IADDR addr)
{
! SI iv = this->read_data_memory_4 (pc, addr);
return * (SF *)(char *)(& iv);
}
inline void
SETMEMSF(PCADDR pc, ADDR addr, SF value)
{
SI iv = * (SI *)(char *)(& value);
! return this->write_data_memory_4 (pc, addr, iv);
}
inline DF
GETMEMDF(PCADDR pc, IADDR addr)
{
! DI iv = this->read_data_memory_8 (pc, addr);
return * (DF *)(char *)(& iv);
}
inline void
SETMEMDF(PCADDR pc, ADDR addr, DF value)
{
DI iv = * (DI *)(char *)(& value);
! return this->write_data_memory_8 (pc, addr, iv);
}
// IMEM: instruction memory calls
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-10 21:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-10 21:02 [patch][commit] trace_counter and GETMEM*, SETMEM* Dave Brolley
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).