Permalink
Browse files

2007-10-29 Martin Baulig <martin@ximian.com>

	* classes/TargetInfo.cs: New file.
	(TargetInfo): Moved here from TargetBinaryAccess.cs.
	(TargetMemoryInfo): New public class, derives from `TargetInfo'.
	(TargetInfo.AddressDomain): Moved this into `TargetMemoryInfo'.


svn path=/trunk/debugger/; revision=88416
  • Loading branch information...
1 parent a686257 commit 72da29e5f457d6396dfd04233439dc2f7c924313 Martin Baulig committed Oct 29, 2007
Showing with 221 additions and 201 deletions.
  1. +7 −0 ChangeLog
  2. +6 −6 backend/Inferior.cs
  3. +1 −1 backend/MonoThreadManager.cs
  4. +3 −3 backend/ProcessServant.cs
  5. +4 −4 backend/SingleSteppingEngine.cs
  6. +0 −8 backend/TargetAccess.cs
  7. +5 −1 backend/TargetMemoryAccess.cs
  8. +3 −3 backend/TargetReader.cs
  9. +1 −1 backend/ThreadDB.cs
  10. +5 −5 backend/ThreadServant.cs
  11. +0 −4 backend/arch/Architecture.cs
  12. +6 −6 backend/arch/Architecture_I386.cs
  13. +9 −9 backend/arch/Architecture_X86_64.cs
  14. +3 −3 backend/arch/Bfd.cs
  15. +1 −1 backend/arch/BfdContainer.cs
  16. +3 −3 backend/arch/BfdDisassembler.cs
  17. +7 −7 backend/arch/CoreFile.cs
  18. +6 −6 backend/arch/DwarfFrameReader.cs
  19. +9 −9 backend/arch/DwarfReader.cs
  20. +2 −2 backend/arch/X86_Instruction.cs
  21. +1 −1 classes/StackFrame.cs
  22. +9 −60 classes/TargetBinaryAccess.cs
  23. +2 −2 classes/TargetBinaryReader.cs
  24. +1 −1 classes/TargetBinaryWriter.cs
  25. +69 −0 classes/TargetInfo.cs
  26. +9 −9 classes/Thread.cs
  27. +1 −1 languages/BitfieldTargetLocation.cs
  28. +1 −1 languages/ClientSuppliedTargetLocation.cs
  29. +1 −1 languages/TargetArrayObject.cs
  30. +1 −1 languages/TargetFundamentalType.cs
  31. +4 −4 languages/mono/MonoArrayObject.cs
  32. +7 −6 languages/mono/MonoClassInfo.cs
  33. +1 −1 languages/mono/MonoClassType.cs
  34. +1 −1 languages/mono/MonoFunctionType.cs
  35. +3 −3 languages/mono/MonoFundamentalType.cs
  36. +8 −8 languages/mono/MonoLanguageBackend.cs
  37. +1 −1 languages/mono/MonoObjectType.cs
  38. +3 −2 languages/mono/MonoRuntime.cs
  39. +1 −1 languages/mono/MonoStringType.cs
  40. +11 −10 languages/mono/MonoSymbolFile.cs
  41. +5 −5 languages/mono/MonoVariableLocation.cs
View
@@ -1,3 +1,10 @@
+2007-10-29 Martin Baulig <martin@ximian.com>
+
+ * classes/TargetInfo.cs: New file.
+ (TargetInfo): Moved here from TargetBinaryAccess.cs.
+ (TargetMemoryInfo): New public class, derives from `TargetInfo'.
+ (TargetInfo.AddressDomain): Moved this into `TargetMemoryInfo'.
+
2007-10-15 Martin Baulig <martin@ximian.com>
HEADS UP: The debugger currently doesn't work with the latest mono
View
@@ -41,7 +41,7 @@ internal class Inferior : TargetMemoryAccess, ITargetNotification, IDisposable
bool has_target;
bool pushed_regs;
- TargetInfo target_info;
+ TargetMemoryInfo target_info;
Architecture arch;
bool has_signals;
@@ -631,14 +631,14 @@ public ChildEvent ProcessEvent (int status)
return new ChildEvent (message, arg, data1, data2);
}
- public static TargetInfo GetTargetInfo (AddressDomain domain)
+ public static TargetMemoryInfo GetTargetInfo (AddressDomain domain)
{
int target_int_size, target_long_size, target_addr_size, is_bigendian;
check_error (mono_debugger_server_get_target_info
(out target_int_size, out target_long_size,
out target_addr_size, out is_bigendian));
- return new TargetInfo (target_int_size, target_long_size,
+ return new TargetMemoryInfo (target_int_size, target_long_size,
target_addr_size, is_bigendian != 0, domain);
}
@@ -767,13 +767,13 @@ void inferior_stderr_handler (string line)
// TargetMemoryAccess
//
- public AddressDomain AddressDomain {
+ public override AddressDomain AddressDomain {
get {
return address_domain;
}
}
- public override TargetInfo TargetInfo {
+ public override TargetMemoryInfo TargetMemoryInfo {
get {
return target_info;
}
@@ -1295,7 +1295,7 @@ internal class StackFrame
{
TargetAddress address, stack, frame;
- internal StackFrame (TargetInfo info, ServerStackFrame frame)
+ internal StackFrame (TargetMemoryInfo info, ServerStackFrame frame)
{
this.address = new TargetAddress (info.AddressDomain, frame.Address);
this.stack = new TargetAddress (info.AddressDomain, frame.StackPointer);
@@ -439,7 +439,7 @@ public MonoMetadataInfo (TargetMemoryAccess memory, TargetAddress address)
MonoDefaultsSize = reader.ReadInt32 ();
MonoDefaultsAddress = new TargetAddress (
- memory.TargetInfo.AddressDomain, reader.ReadAddress ());
+ memory.AddressDomain, reader.ReadAddress ());
TypeSize = reader.ReadInt32 ();
ArrayTypeSize = reader.ReadInt32 ();
@@ -338,14 +338,14 @@ void read_thread_table (Inferior inferior)
{
TargetAddress ptr = inferior.ReadAddress (mono_manager.MonoDebuggerInfo.ThreadTable);
while (!ptr.IsNull) {
- int size = 24 + inferior.TargetInfo.TargetAddressSize;
+ int size = 24 + inferior.TargetMemoryInfo.TargetAddressSize;
TargetReader reader = new TargetReader (inferior.ReadMemory (ptr, size));
long tid = reader.ReadLongInteger ();
TargetAddress lmf_addr = reader.ReadAddress ();
TargetAddress end_stack = reader.ReadAddress ();
- if (inferior.TargetInfo.TargetAddressSize == 4)
+ if (inferior.TargetMemoryInfo.TargetAddressSize == 4)
tid &= 0x00000000ffffffffL;
ptr = reader.ReadAddress ();
@@ -460,7 +460,7 @@ public void LoadLibrary (Thread thread, string filename)
filename);
if (!mono_language.TryFindImage (thread, filename))
- bfd_container.AddFile (thread.TargetInfo, filename,
+ bfd_container.AddFile (thread.TargetMemoryInfo, filename,
TargetAddress.Null, true, false);
}
@@ -755,10 +755,10 @@ public override Symbol SimpleLookup (TargetAddress address, bool exact_match)
get { return end_stack_address; }
}
- public override TargetInfo TargetInfo {
+ public override TargetMemoryInfo TargetMemoryInfo {
get {
check_inferior ();
- return inferior.TargetInfo;
+ return inferior.TargetMemoryInfo;
}
}
@@ -1734,7 +1734,7 @@ public override byte[] ReadBuffer (TargetAddress address, int size)
public override TargetBlob ReadMemory (TargetAddress address, int size)
{
- return new TargetBlob (ReadBuffer (address, size), TargetInfo);
+ return new TargetBlob (ReadBuffer (address, size), TargetMemoryInfo);
}
public override byte ReadByte (TargetAddress address)
@@ -3173,7 +3173,7 @@ protected override EventResult CallbackCompleted (long data1, long data2)
if (!class_type.IsByRef) {
TargetLocation new_loc = instance.Location.GetLocationAtOffset (
- 2 * inferior.TargetInfo.TargetAddressSize);
+ 2 * inferior.TargetMemoryInfo.TargetAddressSize);
instance = (TargetClassObject) class_type.GetObject (
inferior, new_loc);
}
View
@@ -59,14 +59,6 @@ public abstract class TargetAccess : TargetMemoryAccess
get;
}
- //
- // ITargetMemoryInfo
- //
-
- public abstract AddressDomain AddressDomain {
- get;
- }
-
//
// TargetMemoryAccess
//
@@ -6,7 +6,11 @@ namespace Mono.Debugger
{
public abstract class TargetMemoryAccess : DebuggerMarshalByRefObject
{
- public abstract TargetInfo TargetInfo {
+ public abstract TargetMemoryInfo TargetMemoryInfo {
+ get;
+ }
+
+ public abstract AddressDomain AddressDomain {
get;
}
View
@@ -11,9 +11,9 @@ internal class TargetReader
{
byte[] data;
TargetBinaryReader reader;
- TargetInfo info;
+ TargetMemoryInfo info;
- internal TargetReader (byte[] data, TargetInfo info)
+ internal TargetReader (byte[] data, TargetMemoryInfo info)
{
if ((info == null) || (data == null))
throw new ArgumentNullException ();
@@ -23,7 +23,7 @@ internal TargetReader (byte[] data, TargetInfo info)
}
internal TargetReader (TargetBlob data)
- : this (data.Contents, data.TargetInfo)
+ : this (data.Contents, data.TargetMemoryInfo)
{ }
public long Offset {
View
@@ -116,7 +116,7 @@ PsErr global_lookup (string obj_name, string sym_name, out long sym_addr)
TargetAddress create_address (long address)
{
- return new TargetAddress (target.TargetInfo.AddressDomain, address);
+ return new TargetAddress (target.AddressDomain, address);
}
PsErr read_memory (long address, IntPtr ptr, int size)
View
@@ -242,23 +242,23 @@ public string PrintRegisters (StackFrame frame)
}
public override int TargetAddressSize {
- get { return TargetInfo.TargetAddressSize; }
+ get { return TargetMemoryInfo.TargetAddressSize; }
}
public override int TargetIntegerSize {
- get { return TargetInfo.TargetIntegerSize; }
+ get { return TargetMemoryInfo.TargetIntegerSize; }
}
public override int TargetLongIntegerSize {
- get { return TargetInfo.TargetLongIntegerSize; }
+ get { return TargetMemoryInfo.TargetLongIntegerSize; }
}
public override bool IsBigEndian {
- get { return TargetInfo.IsBigEndian; }
+ get { return TargetMemoryInfo.IsBigEndian; }
}
public override AddressDomain AddressDomain {
- get { return TargetInfo.AddressDomain; }
+ get { return TargetMemoryInfo.AddressDomain; }
}
#region IDisposable implementation
@@ -27,10 +27,6 @@ protected Architecture (ProcessServant process, TargetInfo info)
this.TargetInfo = info;
}
- public AddressDomain AddressDomain {
- get { return TargetInfo.AddressDomain; }
- }
-
public int TargetAddressSize {
get { return TargetInfo.TargetAddressSize; }
}
@@ -81,7 +81,7 @@ internal Architecture_I386 (ProcessServant process, TargetInfo info)
foreach (TargetAddress address in process.MonoLanguage.Trampolines) {
if (call_target + call_disp + 10 == address) {
- trampoline = new TargetAddress (AddressDomain, method_info);
+ trampoline = new TargetAddress (memory.AddressDomain, method_info);
return true;
}
}
@@ -272,7 +272,7 @@ public override string PrintRegisters (StackFrame frame)
Registers regs = new Registers (old_regs);
TargetAddress ebp = new TargetAddress (
- AddressDomain, old_regs [(int) I386Register.EBP].GetValue ());
+ memory.AddressDomain, old_regs [(int) I386Register.EBP].GetValue ());
int addr_size = TargetAddressSize;
TargetAddress new_ebp = memory.ReadAddress (ebp);
@@ -558,7 +558,7 @@ internal override void Hack_ReturnNull (Inferior inferior)
{
Registers regs = inferior.GetRegisters ();
TargetAddress esp = new TargetAddress (
- AddressDomain, regs [(int) I386Register.ESP].GetValue ());
+ inferior.AddressDomain, regs [(int) I386Register.ESP].GetValue ());
TargetAddress eip = inferior.ReadAddress (esp);
esp += TargetAddressSize;
@@ -598,11 +598,11 @@ internal override void Hack_ReturnNull (Inferior inferior)
bool adjust_retaddr)
{
TargetAddress address = new TargetAddress (
- AddressDomain, regs [(int) I386Register.EIP].GetValue ());
+ thread.AddressDomain, regs [(int) I386Register.EIP].GetValue ());
TargetAddress stack_pointer = new TargetAddress (
- AddressDomain, regs [(int) I386Register.ESP].GetValue ());
+ thread.AddressDomain, regs [(int) I386Register.ESP].GetValue ());
TargetAddress frame_pointer = new TargetAddress (
- AddressDomain, regs [(int) I386Register.EBP].GetValue ());
+ thread.AddressDomain, regs [(int) I386Register.EBP].GetValue ());
return CreateFrame (thread, address, stack_pointer, frame_pointer, regs,
adjust_retaddr);
@@ -88,7 +88,7 @@ internal Architecture_X86_64 (ProcessServant process, TargetInfo info)
int call_disp = reader.ReadInt32 ();
foreach (TargetAddress address in process.MonoLanguage.Trampolines) {
if (call_target + call_disp + 19 == address) {
- trampoline = new TargetAddress (AddressDomain, method_info);
+ trampoline = new TargetAddress (memory.AddressDomain, method_info);
return true;
}
}
@@ -337,7 +337,7 @@ internal override Registers CopyRegisters (Registers old_regs)
return null;
TargetAddress rbp = new TargetAddress (
- AddressDomain, old_regs [(int) X86_64_Register.RBP].Value);
+ memory.AddressDomain, old_regs [(int) X86_64_Register.RBP].Value);
int addr_size = TargetAddressSize;
TargetAddress new_rbp = memory.ReadAddress (rbp);
@@ -577,11 +577,11 @@ StackFrame try_unwind_sigreturn (StackFrame frame, TargetMemoryAccess memory)
}
TargetAddress rip = new TargetAddress (
- AddressDomain, regs [(int) X86_64_Register.RIP].GetValue ());
+ memory.AddressDomain, regs [(int) X86_64_Register.RIP].GetValue ());
TargetAddress rsp = new TargetAddress (
- AddressDomain, regs [(int) X86_64_Register.RSP].GetValue ());
+ memory.AddressDomain, regs [(int) X86_64_Register.RSP].GetValue ());
TargetAddress rbp = new TargetAddress (
- AddressDomain, regs [(int) X86_64_Register.RBP].GetValue ());
+ memory.AddressDomain, regs [(int) X86_64_Register.RBP].GetValue ());
Symbol name = new Symbol ("<signal handler>", rip, 0);
@@ -603,7 +603,7 @@ internal override void Hack_ReturnNull (Inferior inferior)
{
Registers regs = inferior.GetRegisters ();
TargetAddress rsp = new TargetAddress (
- AddressDomain, regs [(int) X86_64_Register.RSP].GetValue ());
+ inferior.AddressDomain, regs [(int) X86_64_Register.RSP].GetValue ());
TargetAddress rip = inferior.ReadAddress (rsp);
rsp += TargetAddressSize;
@@ -643,11 +643,11 @@ internal override void Hack_ReturnNull (Inferior inferior)
bool adjust_retaddr)
{
TargetAddress address = new TargetAddress (
- AddressDomain, regs [(int) X86_64_Register.RIP].GetValue ());
+ thread.AddressDomain, regs [(int) X86_64_Register.RIP].GetValue ());
TargetAddress stack_pointer = new TargetAddress (
- AddressDomain, regs [(int) X86_64_Register.RSP].GetValue ());
+ thread.AddressDomain, regs [(int) X86_64_Register.RSP].GetValue ());
TargetAddress frame_pointer = new TargetAddress (
- AddressDomain, regs [(int) X86_64_Register.RBP].GetValue ());
+ thread.AddressDomain, regs [(int) X86_64_Register.RBP].GetValue ());
return CreateFrame (thread, address, stack_pointer, frame_pointer, regs,
adjust_retaddr);
View
@@ -17,7 +17,7 @@ internal class Bfd : SymbolFile, ISymbolContainer
IntPtr bfd;
protected Module module;
protected BfdContainer container;
- protected TargetInfo info;
+ protected TargetMemoryInfo info;
protected Bfd main_bfd;
protected Architecture arch;
TargetAddress first_link_map = TargetAddress.Null;
@@ -170,7 +170,7 @@ static Bfd ()
bfd_init ();
}
- public Bfd (BfdContainer container, TargetInfo info, string filename,
+ public Bfd (BfdContainer container, TargetMemoryInfo info, string filename,
Bfd main_bfd, TargetAddress base_address, bool is_loaded)
{
this.container = container;
@@ -480,7 +480,7 @@ public TargetAddress GetAddress (long address)
info.AddressDomain, BaseAddress.Address + address);
}
- public TargetInfo TargetInfo {
+ public TargetMemoryInfo TargetMemoryInfo {
get {
return info;
}
@@ -58,7 +58,7 @@ internal void SetupInferior (TargetInfo info, Bfd main_bfd)
language = new NativeLanguage (this, info);
}
- public Bfd AddFile (TargetInfo memory, string filename,
+ public Bfd AddFile (TargetMemoryInfo memory, string filename,
TargetAddress base_address, bool step_info, bool is_loaded)
{
check_disposed ();
@@ -55,7 +55,7 @@ int read_memory_func (long address, IntPtr data, int size)
{
try {
TargetAddress location = new TargetAddress (
- memory.TargetInfo.AddressDomain, address);
+ memory.AddressDomain, address);
byte[] buffer = memory.ReadBuffer (location, size);
Marshal.Copy (buffer, 0, data, size);
} catch (Exception e) {
@@ -82,7 +82,7 @@ void output_func (long address)
void print_address_func (long address)
{
TargetAddress maddress = new TargetAddress (
- memory.TargetInfo.AddressDomain, address);
+ memory.AddressDomain, address);
if (current_method != null) {
try {
@@ -148,7 +148,7 @@ public override AssemblerMethod DisassembleMethod (Method method)
sb = new StringBuilder ();
address = new TargetAddress (
- memory.TargetInfo.AddressDomain, address.Address);
+ memory.AddressDomain, address.Address);
string insn;
int insn_size;
Oops, something went wrong.

0 comments on commit 72da29e

Please sign in to comment.