Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed compiler warnings.

svn path=/trunk/debugger/; revision=21791
  • Loading branch information...
commit 8132af552ce6102c3734812d6744f78dd8aae84f 1 parent 5682b2b
Martin Baulig authored
Showing with 66 additions and 265 deletions.
  1. +7 −13 arch/Bfd.cs
  2. +1 −1  arch/BfdContainer.cs
  3. +1 −1  arch/BfdModule.cs
  4. +1 −11 arch/DwarfReader.cs
  5. +0 −3  backends/DaemonThreadRunner.cs
  6. +3 −6 backends/Inferior.cs
  7. +5 −11 backends/Process.cs
  8. +6 −14 backends/SingleSteppingEngine.cs
  9. +0 −2  backends/ThreadManager.cs
  10. +2 −6 backends/classes/NativeModule.cs
  11. +0 −2  backends/classes/TargetReader.cs
  12. +0 −1  backends/mono-csharp/CSharpMethod.cs
  13. +2 −23 backends/mono-csharp/MonoCSharpLanguageBackend.cs
  14. +1 −1  backends/mono-csharp/MonoClass.cs
  15. +0 −12 backends/mono-csharp/MonoFunctionType.cs
  16. +1 −5 backends/mono-csharp/MonoOpaqueObject.cs
  17. +1 −4 backends/mono-csharp/MonoVariable.cs
  18. +1 −5 backends/native/NativeOpaqueObject.cs
  19. +0 −2  backends/native/NativePointerType.cs
  20. +2 −2 backends/server/i386-ptrace.c
  21. +1 −2  backends/server/server.h
  22. +0 −1  classes/MethodBase.cs
  23. +0 −4 classes/MethodSource.cs
  24. +1 −2  classes/ObjectCache.cs
  25. +25 −101 classes/ProcessStart.cs
  26. +0 −2  classes/SimpleSymbolTableCollection.cs
  27. +0 −2  classes/SymbolTable.cs
  28. +1 −4 classes/TargetMemoryArea.cs
  29. +1 −2  frontends/command-line/Interpreter.cs
  30. +0 −1  frontends/scripting/Generator.cs
  31. +0 −2  frontends/scripting/Parser.jay
  32. +1 −8 frontends/scripting/ScriptingContext.cs
  33. +0 −7 frontends/scripting/Tokenizer.cs
  34. +2 −2 frontends/scripting/VariableExpression.cs
20 arch/Bfd.cs
View
@@ -23,9 +23,7 @@ internal class Bfd : ISymbolContainer, ILanguageBackend, IDisposable
TargetAddress first_link_map = TargetAddress.Null;
TargetAddress dynlink_breakpoint = TargetAddress.Null;
TargetAddress rdebug_state_addr = TargetAddress.Null;
- int dynlink_breakpoint_id = -1;
Hashtable symbols;
- Hashtable section_hash;
BfdSymbolTable simple_symtab;
Module module;
BfdModule bfd_module;
@@ -34,7 +32,7 @@ internal class Bfd : ISymbolContainer, ILanguageBackend, IDisposable
bool initialized;
bool has_shlib_info;
TargetAddress base_address, start_address, end_address;
- TargetAddress plt_start, plt_end, got_start, got_end;
+ TargetAddress plt_start, plt_end, got_start;
bool has_got;
[Flags]
@@ -194,8 +192,6 @@ static Bfd ()
if (bfd == IntPtr.Zero)
throw new SymbolTableException ("Can't read symbol file: {0}", filename);
- section_hash = new Hashtable ();
-
if (core_file) {
if (!bfd_glue_check_format_core (bfd))
throw new SymbolTableException ("Not a core file: {0}", filename);
@@ -261,8 +257,6 @@ static Bfd ()
got_start = new TargetAddress (
memory.GlobalAddressDomain, base_address.Address + got_section.vma);
- got_end = got_start + got_section.size;
-
has_got = true;
}
}
@@ -389,7 +383,7 @@ public void UpdateSharedLibraryInfo (Inferior inferior)
TargetAddress l_addr = map_reader.ReadAddress ();
TargetAddress l_name = map_reader.ReadAddress ();
- TargetAddress l_ld = map_reader.ReadAddress ();
+ map_reader.ReadAddress ();
string name;
try {
@@ -412,8 +406,8 @@ public void UpdateSharedLibraryInfo (Inferior inferior)
if (name == null)
continue;
- Bfd library_bfd = container.AddFile (
- inferior, name, module.StepInto, l_addr, null);
+ container.AddFile (inferior, name, module.StepInto,
+ l_addr, null);
}
}
@@ -425,9 +419,9 @@ public void UpdateSharedLibraryInfo (Inferior inferior)
set {
core_file_bfd = value;
if (core_file_bfd != null) {
+#if FALSE
InternalSection text = GetSectionByName (".text", true);
-#if FALSE
base_address = new TargetAddress (
memory.GlobalAddressDomain, text.vma);
end_address = new TargetAddress (
@@ -571,13 +565,13 @@ public TargetMemoryArea[] GetMemoryMaps ()
if ((last.Flags == flags) &&
((last.End + 1 == start) || (last.End == start))) {
list [list.Count - 1] = new TargetMemoryArea (
- last.Start, end, last.Flags, last.Name, memory);
+ last.Start, end, last.Flags, last.Name);
continue;
}
}
string name = section.bfd.FileName;
- list.Add (new TargetMemoryArea (start, end, flags, name, memory));
+ list.Add (new TargetMemoryArea (start, end, flags, name));
}
TargetMemoryArea[] maps = new TargetMemoryArea [list.Count];
2  arch/BfdContainer.cs
View
@@ -112,7 +112,7 @@ private BfdContainer (SerializationInfo info, StreamingContext context)
if (backend == null)
throw new InvalidOperationException ();
- ICollection modules = (ICollection) info.GetValue ("modules", typeof (ICollection));
+ info.GetValue ("modules", typeof (ICollection));
bfd_hash = new Hashtable ();
module_hash = new Hashtable ();
2  arch/BfdModule.cs
View
@@ -24,7 +24,7 @@ internal sealed class BfdModule : NativeModule, ISymbolContainer, IDisposable
ILanguage language;
public BfdModule (DebuggerBackend backend, Module module, Bfd bfd, ITargetInfo info)
- : base (backend, module, bfd.FileName)
+ : base (module, bfd.FileName)
{
this.backend = backend;
this.module = module;
12 arch/DwarfReader.cs
View
@@ -361,10 +361,6 @@ object create_reader_func (object user_data)
if (contents == null)
throw new DwarfException (this, "Can't find DWARF 2 debugging info");
- ITargetInfo target_info = null;
- if (AddressSize != 0)
- target_info = new TargetInfo (AddressSize);
-
return new TargetBlob (contents);
}
@@ -1252,7 +1248,6 @@ public override string ToString ()
protected class AbbrevEntry
{
- DwarfReader dwarf;
int abbrev_id;
DwarfTag tag;
bool has_children;
@@ -1261,8 +1256,6 @@ protected class AbbrevEntry
public AbbrevEntry (DwarfReader dwarf, DwarfBinaryReader reader)
{
- this.dwarf = dwarf;
-
abbrev_id = reader.ReadLeb128 ();
tag = (DwarfTag) reader.ReadLeb128 ();
has_children = reader.ReadByte () != 0;
@@ -1393,7 +1386,6 @@ public Die CreateDie (DwarfBinaryReader reader, CompilationUnit comp_unit)
public static DieCompileUnit CreateDieCompileUnit (DwarfBinaryReader reader,
CompilationUnit comp_unit)
{
- long offset = reader.Position;
int abbrev_id = reader.ReadLeb128 ();
AbbrevEntry abbrev = comp_unit [abbrev_id];
@@ -1603,13 +1595,11 @@ public void AddMethod (SourceMethod method)
protected class DwarfSourceFile : SourceFile
{
- DwarfReader dwarf;
ArrayList methods;
public DwarfSourceFile (DwarfReader dwarf, string filename)
: base (dwarf.module, filename)
{
- this.dwarf = dwarf;
this.methods = new ArrayList ();
}
@@ -1657,7 +1647,6 @@ protected override ArrayList GetMethods ()
ArrayList methods = new ArrayList ();
ArrayList list = comp_unit_die.Subprograms;
- LineNumberEngine engine = comp_unit_die.Engine;
foreach (DieSubprogram subprog in list)
methods.Add (subprog.Method);
@@ -2715,6 +2704,7 @@ public bool Resolve ()
return ok;
ok = DoResolve ();
+ resolved = true;
return ok;
}
3  backends/DaemonThreadRunner.cs
View
@@ -100,9 +100,6 @@ void target_exited ()
Inferior inferior;
SingleSteppingEngine process;
DaemonThreadHandler daemon_thread_handler;
- ProcessStart start;
- bool is_main_thread;
- bool redirect_fds;
int pid;
protected bool daemon_stopped (TargetAddress address)
9 backends/Inferior.cs
View
@@ -40,8 +40,6 @@ internal abstract class Inferior : ITargetAccess, ITargetNotification, IDisposab
bool initialized;
ITargetInfo target_info;
- Hashtable pending_callbacks = new Hashtable ();
- long last_callback_id = 0;
public bool HasTarget {
get {
@@ -66,7 +64,7 @@ internal abstract class Inferior : ITargetAccess, ITargetNotification, IDisposab
public event TargetExitedHandler TargetExited;
[DllImport("monodebuggerserver")]
- static extern CommandError mono_debugger_server_spawn (IntPtr handle, string working_directory, string[] argv, string[] envp, out int child_pid, ChildOutputHandler stdout_handler, ChildOutputHandler stderr_handler, out IntPtr error, out bool has_thread_manager);
+ static extern CommandError mono_debugger_server_spawn (IntPtr handle, string working_directory, string[] argv, string[] envp, out int child_pid, ChildOutputHandler stdout_handler, ChildOutputHandler stderr_handler, out IntPtr error);
[DllImport("monodebuggerserver")]
static extern CommandError mono_debugger_server_attach (IntPtr handle, int child_pid, out int tid);
@@ -389,13 +387,12 @@ public void Run (bool redirect_fds)
IntPtr error;
- bool has_thread_manager;
CommandError result = mono_debugger_server_spawn (
server_handle, start.WorkingDirectory, start.CommandLineArguments,
start.Environment, out child_pid,
new ChildOutputHandler (inferior_stdout_handler),
new ChildOutputHandler (inferior_stderr_handler),
- out error, out has_thread_manager);
+ out error);
if (result != CommandError.None) {
string message = Marshal.PtrToStringAuto (error);
g_free (error);
@@ -1109,7 +1106,7 @@ public TargetMemoryArea[] GetMemoryMaps ()
TargetMemoryArea area = new TargetMemoryArea (
new TargetAddress (GlobalAddressDomain, start),
new TargetAddress (GlobalAddressDomain, end),
- flags, name, this);
+ flags, name);
list.Add (area);
} while (true);
}
16 backends/Process.cs
View
@@ -750,15 +750,14 @@ void ITargetAccess.WriteAddress (TargetAddress address, TargetAddress value)
//
internal StackFrame CreateFrame (TargetAddress address, int level,
- Inferior.StackFrame frame,
Backtrace bt, SourceAddress source,
IMethod method)
{
if (source != null)
- return new MyStackFrame (this, address, level, frame,
+ return new MyStackFrame (this, address, level,
bt, source, method);
else
- return new MyStackFrame (this, address, level, frame, bt);
+ return new MyStackFrame (this, address, level, bt);
}
@@ -813,7 +812,6 @@ public void Dispose ()
protected class MyStackFrame : StackFrame
{
Process process;
- Inferior.StackFrame frame;
Backtrace backtrace;
ILanguage language;
ILanguageBackend lbackend;
@@ -822,25 +820,21 @@ protected class MyStackFrame : StackFrame
bool has_registers;
internal MyStackFrame (Process process, TargetAddress address,
- int level, Inferior.StackFrame frame,
- Backtrace backtrace, SourceAddress source,
- IMethod method)
+ int level, Backtrace backtrace,
+ SourceAddress source, IMethod method)
: base (address, level, source, method)
{
this.process = process;
- this.frame = frame;
this.backtrace = backtrace;
this.language = method.Module.Language;
this.lbackend = method.Module.LanguageBackend as ILanguageBackend;
}
internal MyStackFrame (Process process, TargetAddress address,
- int level, Inferior.StackFrame frame,
- Backtrace backtrace)
+ int level, Backtrace backtrace)
: base (address, level, process.SimpleLookup (address, false))
{
this.process = process;
- this.frame = frame;
this.backtrace = backtrace;
this.language = process.NativeLanguage;
}
20 backends/SingleSteppingEngine.cs
View
@@ -606,10 +606,10 @@ Backtrace get_backtrace (int max_frames)
if ((method != null) && method.HasSource) {
SourceAddress source = method.Source.Lookup (address);
frames [i] = process.CreateFrame (
- address, i, iframes [i], backtrace, source, method);
+ address, i, backtrace, source, method);
} else
frames [i] = process.CreateFrame (
- address, i, iframes [i], backtrace, null, null);
+ address, i, backtrace, null, null);
}
backtrace.SetFrames (frames);
@@ -1047,16 +1047,11 @@ bool start_native ()
void child_exited ()
{
- child_already_exited = true;
-
inferior.Dispose ();
inferior = null;
frames_invalid ();
}
- bool child_already_exited;
- bool debugger_info_read;
-
// <summary>
// A breakpoint has been hit; now the sse needs to find out what do do:
// either ignore the breakpoint and continue or keep the target stopped
@@ -1162,17 +1157,14 @@ StackFrame get_frame (TargetAddress address)
// If some clown requested a backtrace while doing the symbol lookup ....
frames_invalid ();
- // This gets just one single stack frame.
- Inferior.StackFrame[] frames = inferior.GetBacktrace (1, TargetAddress.Null);
-
if ((current_method != null) && current_method.HasSource) {
SourceAddress source = current_method.Source.Lookup (address);
current_frame = process.CreateFrame (
- address, 0, frames [0], null, source, current_method);
+ address, 0, null, source, current_method);
} else
current_frame = process.CreateFrame (
- address, 0, frames [0], null, null, null);
+ address, 0, null, null, null);
return current_frame;
}
@@ -1232,10 +1224,10 @@ Operation frame_changed (TargetAddress address, Operation operation)
}
current_frame = process.CreateFrame (
- address, 0, frames [0], null, source, current_method);
+ address, 0, null, source, current_method);
} else
current_frame = process.CreateFrame (
- address, 0, frames [0], null, null, null);
+ address, 0, null, null, null);
return null;
}
2  backends/ThreadManager.cs
View
@@ -23,7 +23,6 @@ public class ThreadManager
internal ThreadManager (DebuggerBackend backend)
{
this.backend = backend;
- this.bfdc = backend.BfdContainer;
this.SymbolTableManager = backend.SymbolTableManager;
breakpoint_manager = new BreakpointManager ();
@@ -45,7 +44,6 @@ internal ThreadManager (DebuggerBackend backend)
internal readonly SymbolTableManager SymbolTableManager;
ProcessStart start;
- BfdContainer bfdc;
DebuggerBackend backend;
BreakpointManager breakpoint_manager;
Thread inferior_thread;
8 backends/classes/NativeModule.cs
View
@@ -11,13 +11,9 @@ namespace Mono.Debugger.Backends
{
internal abstract class NativeModule : ModuleData
{
- DebuggerBackend backend;
-
- public NativeModule (DebuggerBackend backend, Module module, string name)
+ public NativeModule (Module module, string name)
: base (module, name)
- {
- this.backend = backend;
- }
+ { }
bool check_breakpoint_hit (StackFrame frame, int index, object user_data)
{
2  backends/classes/TargetReader.cs
View
@@ -47,7 +47,6 @@ internal class TargetReader : ITargetMemoryReader
{
byte[] data;
TargetBinaryReader reader;
- int offset;
ITargetMemoryInfo info;
internal TargetReader (byte[] data, ITargetMemoryInfo info)
@@ -55,7 +54,6 @@ internal TargetReader (byte[] data, ITargetMemoryInfo info)
this.reader = new TargetBinaryReader (data, info);
this.info = info;
this.data = data;
- this.offset = 0;
}
public long Offset {
1  backends/mono-csharp/CSharpMethod.cs
View
@@ -7,7 +7,6 @@ namespace Mono.Debugger.Languages.CSharp
internal class CSharpMethod : MethodSource
{
int start_row, end_row;
- ArrayList addresses;
MonoSymbolTableReader reader;
JitLineNumberEntry[] line_numbers;
MethodEntry method;
25 backends/mono-csharp/MonoCSharpLanguageBackend.cs
View
@@ -315,8 +315,6 @@ internal class MonoSymbolTable : ILanguage, IDisposable
int TotalSize;
int address_size;
- int long_size;
- int int_size;
int last_num_type_tables;
int last_type_table_offset;
@@ -330,8 +328,6 @@ internal class MonoSymbolTable : ILanguage, IDisposable
this.TargetInfo = memory;
address_size = memory.TargetAddressSize;
- long_size = memory.TargetLongIntegerSize;
- int_size = memory.TargetIntegerSize;
modules = new ArrayList ();
module_hash = new Hashtable ();
@@ -367,7 +363,7 @@ internal void Update (ITargetMemoryAccess memory)
if (total_size != TotalSize)
throw new InternalError ();
- TargetAddress domain = header.ReadAddress ();
+ header.ReadAddress ();
TargetAddress corlib_address = header.ReadAddress ();
TargetAddress builtin_types_address = header.ReadAddress ();
@@ -726,7 +722,7 @@ private class MonoModule : NativeModule, IDisposable
MonoSymbolTableReader reader;
public MonoModule (Module module, string name, MonoSymbolTableReader reader)
- : base (reader.Table.Backend, module, name)
+ : base (module, name)
{
this.module = module;
this.reader = reader;
@@ -949,7 +945,6 @@ public override string ToString ()
// </summary>
internal class MonoSymbolTableReader : ISimpleSymbolTable
{
- MethodEntry[] Methods;
internal readonly int Index;
internal readonly Reflection.Assembly Assembly;
internal readonly MonoSymbolTable Table;
@@ -967,10 +962,8 @@ internal class MonoSymbolTableReader : ISimpleSymbolTable
ArrayList ranges;
TargetAddress dynamic_address;
- TargetAddress global_symfile;
int class_entry_size;
int address_size;
- int long_size;
int int_size;
int generation;
@@ -990,7 +983,6 @@ internal class MonoSymbolTableReader : ISimpleSymbolTable
GlobalAddressDomain = memory.GlobalAddressDomain;
address_size = TargetInfo.TargetAddressSize;
- long_size = TargetInfo.TargetLongIntegerSize;
int_size = TargetInfo.TargetIntegerSize;
ranges = new ArrayList ();
@@ -1277,7 +1269,6 @@ private class MonoSourceFile : SourceFile
{
MonoSymbolTableReader reader;
SourceFileEntry source;
- ArrayList methods;
public MonoSourceFile (MonoSymbolTableReader reader, SourceFileEntry source)
: base (reader.Module, source.FileName)
@@ -1304,10 +1295,8 @@ private class MonoSourceMethod : SourceMethod
MonoSymbolTableReader reader;
Hashtable load_handlers;
int index;
- string full_name;
MethodEntry entry;
MonoMethod method;
- MethodSourceEntry source;
public MonoSourceMethod (SourceFile info, MonoSymbolTableReader reader,
MethodSourceEntry source, MethodEntry entry, string name)
@@ -1315,7 +1304,6 @@ private class MonoSourceMethod : SourceMethod
{
this.reader = reader;
this.index = source.Index;
- this.source = source;
this.entry = entry;
info.Module.ModuleUnLoadedEvent += new ModuleEventHandler (module_unloaded);
@@ -1463,7 +1451,6 @@ protected class MonoMethod : MethodBase
SourceMethod info;
MethodEntry method;
System.Reflection.MethodBase rmethod;
- MonoType class_type;
MonoType[] param_types;
MonoType[] local_types;
IVariable[] parameters;
@@ -1524,9 +1511,6 @@ void get_variables ()
if (has_variables || !is_loaded)
return;
- class_type = reader.Table.GetType (
- rmethod.ReflectedType, address.ClassTypeInfoOffset);
-
Reflection.ParameterInfo[] param_info = rmethod.GetParameters ();
param_types = new MonoType [param_info.Length];
for (int i = 0; i < param_info.Length; i++)
@@ -1554,9 +1538,6 @@ void get_variables ()
if (method.LocalNamesAmbiguous && (local.BlockIndex > 0)) {
int index = local.BlockIndex - 1;
JitLexicalBlockEntry block = address.LexicalBlocks [index];
- int start_scope = block.StartAddress;
- int end_scope = block.EndAddress;
-
locals [i] = new MonoVariable (
reader.backend, local.Name, local_types [i],
true, this, address.LocalVariableInfo [i],
@@ -1713,7 +1694,6 @@ internal class MonoCSharpLanguageBackend : ILanguageBackend
Process process;
DebuggerBackend backend;
MonoDebuggerInfo info;
- int symtab_generation;
TargetAddress trampoline_address;
TargetAddress notification_address;
bool initialized;
@@ -1760,7 +1740,6 @@ void child_exited ()
process = null;
info = null;
initialized = false;
- symtab_generation = 0;
trampoline_address = TargetAddress.Null;
if (table != null) {
2  backends/mono-csharp/MonoClass.cs
View
@@ -42,7 +42,7 @@ internal class MonoClass : MonoType, ITargetClassType
goto again;
} else if (tkind != TypeKind.ClassInfo)
throw new InternalError ();
- int new_size = info.ReadInt32 ();
+ info.ReadInt32 ();
is_valuetype = info.ReadByte () != 0;
} else {
is_valuetype = kind == TargetObjectKind.Struct;
12 backends/mono-csharp/MonoFunctionType.cs
View
@@ -6,20 +6,16 @@ namespace Mono.Debugger.Languages.CSharp
{
internal class MonoFunctionType : MonoType, ITargetFunctionType
{
- MonoClass klass;
R.MethodBase method_info;
TargetAddress method;
MonoType return_type;
MonoType[] parameter_types;
- TargetAddress compile_method;
- TargetAddress runtime_invoke;
MonoSymbolTable table;
bool has_return_type;
public MonoFunctionType (MonoClass klass, R.MethodBase mbase, TargetBinaryReader info, MonoSymbolTable table)
: base (TargetObjectKind.Function, mbase.ReflectedType, 0)
{
- this.klass = klass;
this.method_info = mbase;
this.table = table;
this.method = new TargetAddress (table.AddressDomain, info.ReadAddress ());
@@ -29,7 +25,6 @@ public MonoFunctionType (MonoClass klass, R.MethodBase mbase, TargetBinaryReader
return_type = table.GetType (minfo.ReturnType, type_info);
has_return_type = minfo.ReturnType != typeof (void);
} else if (mbase is R.ConstructorInfo) {
- R.ConstructorInfo cinfo = (R.ConstructorInfo) mbase;
return_type = klass;
has_return_type = true;
}
@@ -49,25 +44,18 @@ public MonoFunctionType (MonoClass klass, R.MethodBase mbase, TargetBinaryReader
int param_info = info.ReadInt32 ();
parameter_types [i] = table.GetType (parameters [i].ParameterType, param_info);
}
-
- compile_method = table.Language.MonoDebuggerInfo.CompileMethod;
- runtime_invoke = table.Language.MonoDebuggerInfo.RuntimeInvoke;
}
public MonoFunctionType (MonoClass klass, R.MethodInfo minfo, TargetAddress method,
MonoType return_type, MonoSymbolTable table)
: base (TargetObjectKind.Function, minfo.ReflectedType, 0)
{
- this.klass = klass;
this.method_info = minfo;
this.method = method;
this.return_type = return_type;
this.table = table;
parameter_types = new MonoType [0];
-
- compile_method = table.Language.MonoDebuggerInfo.CompileMethod;
- runtime_invoke = table.Language.MonoDebuggerInfo.RuntimeInvoke;
}
public override bool IsByRef {
6 backends/mono-csharp/MonoOpaqueObject.cs
View
@@ -4,13 +4,9 @@ namespace Mono.Debugger.Languages.CSharp
{
internal class MonoOpaqueObject : MonoObject
{
- new MonoOpaqueType type;
-
public MonoOpaqueObject (MonoOpaqueType type, TargetLocation location)
: base (type, location)
- {
- this.type = type;
- }
+ { }
protected override long GetDynamicSize (ITargetMemoryReader reader,
TargetLocation location,
5 backends/mono-csharp/MonoVariable.cs
View
@@ -11,8 +11,7 @@ internal class MonoVariable : IVariable
DebuggerBackend backend;
TargetAddress start_liveness, end_liveness;
TargetAddress start_scope, end_scope;
- bool has_scope_info, has_liveness_info;
- bool is_local;
+ bool has_liveness_info;
public MonoVariable (DebuggerBackend backend, string name, MonoType type,
bool is_local, IMethod method, VariableInfo info,
@@ -22,7 +21,6 @@ internal class MonoVariable : IVariable
if (is_local) {
start_scope = method.StartAddress + start_scope_offset;
end_scope = method.StartAddress + end_scope_offset;
- has_scope_info = true;
} else if (method.HasMethodBounds) {
start_scope = method.MethodStartAddress;
end_scope = method.MethodEndAddress;
@@ -49,7 +47,6 @@ internal class MonoVariable : IVariable
this.backend = backend;
this.name = name;
this.type = type;
- this.is_local = is_local;
this.info = info;
if (info.HasLivenessInfo) {
6 backends/native/NativeOpaqueObject.cs
View
@@ -4,13 +4,9 @@ namespace Mono.Debugger.Languages.Native
{
internal class NativeOpaqueObject : NativeObject
{
- new NativeOpaqueType type;
-
public NativeOpaqueObject (NativeOpaqueType type, TargetLocation location)
: base (type, location)
- {
- this.type = type;
- }
+ { }
protected override long GetDynamicSize (ITargetMemoryReader reader,
TargetLocation location,
2  backends/native/NativePointerType.cs
View
@@ -11,11 +11,9 @@ public NativePointerType (string name, int size)
public NativePointerType (string name, NativeType target_type, int size)
: base (name, TargetObjectKind.Pointer, size)
{
- this.size = size;
this.target_type = target_type;
}
- int size;
NativeType target_type;
public override bool IsByRef {
4 backends/server/i386-ptrace.c
View
@@ -304,7 +304,7 @@ ServerCommandError
mono_debugger_server_spawn (ServerHandle *handle, const gchar *working_directory,
gchar **argv, gchar **envp, gint *child_pid,
ChildOutputFunc stdout_handler, ChildOutputFunc stderr_handler,
- gchar **error, gboolean *has_thread_manager)
+ gchar **error)
{
InferiorHandle *inferior = handle->inferior;
int fd[2], open_max, ret, len, i;
@@ -347,7 +347,7 @@ mono_debugger_server_spawn (ServerHandle *handle, const gchar *working_directory
inferior->pid = *child_pid;
_mono_debugger_server_setup_inferior (handle, TRUE);
- *has_thread_manager = _mono_debugger_server_setup_thread_manager (handle);
+ _mono_debugger_server_setup_thread_manager (handle);
return COMMAND_ERROR_NONE;
}
3  backends/server/server.h
View
@@ -91,8 +91,7 @@ mono_debugger_server_spawn (ServerHandle *handle,
gint *child_pid,
ChildOutputFunc stdout_handler,
ChildOutputFunc stderr_handler,
- gchar **error,
- gboolean *has_thread_manager);
+ gchar **error);
ServerCommandError
mono_debugger_server_attach (ServerHandle *handle,
1  classes/MethodBase.cs
View
@@ -36,7 +36,6 @@ public override string ToString ()
public abstract class MethodBase : IMethod, ISymbolLookup, IComparable
{
- int start_row, end_row;
TargetAddress start, end;
TargetAddress method_start, method_end;
TargetAddress wrapper_addr = TargetAddress.Null;
4 classes/MethodSource.cs
View
@@ -7,9 +7,6 @@ namespace Mono.Debugger
public abstract class MethodSource : IMethodSource
{
SourceFile file;
- SourceMethod source_method;
- int start_row, end_row;
- bool sources_read;
string name;
TargetAddress start, end;
@@ -175,7 +172,6 @@ public void DumpLineNumbers ()
Console.WriteLine ("DUMPING LINE NUMBER TABLE");
Console.WriteLine ("BOUNDS: start = {0} / {1}, end = {2} / {3}",
start, method_start, end, method_end);
- Console.WriteLine ("SOURCE BOUNDS: start = {0}, end = {1}", start_row, end_row);
Console.WriteLine ("--------");
for (int i = 0; i < Addresses.Length; i++) {
LineEntry entry = (LineEntry) Addresses [i];
3  classes/ObjectCache.cs
View
@@ -16,7 +16,6 @@ public class ObjectCache : IDisposable
int initial_ttl, ttl;
int id;
- static Timer timer;
static ArrayList objects;
static int next_id = 0;
@@ -33,7 +32,7 @@ public ObjectCache (ObjectCacheFunc func, object user_data, int ttl)
static ObjectCache ()
{
objects = ArrayList.Synchronized (new ArrayList ());
- timer = new Timer (new TimerCallback (cleanup_process), null, 0, 60000);
+ new Timer (new TimerCallback (cleanup_process), null, 0, 60000);
}
static void cleanup_process (object dummy)
126 classes/ProcessStart.cs
View
@@ -12,50 +12,12 @@ namespace Mono.Debugger
{
public class DebuggerOptions : Options
{
- public enum StartMode
- {
- Unknown,
- CoreFile,
- StartApplication
- }
-
public DebuggerOptions ()
{
ParsingMode = OptionsParsingMode.Linux;
EndOptionProcessingWithDoubleDash = true;
}
- StartMode start_mode = StartMode.Unknown;
-
- public StartMode Mode {
- get { return start_mode; }
- }
-
- [Option("PARAM is one of `core' (to load a core file),\n\t\t\t" +
- " `load' (to load a previously saved debugging session)\n\t\t\t" +
- " or `start' (to start a new application).", 'm')]
- public WhatToDoNext mode (string value)
- {
- if (start_mode != StartMode.Unknown) {
- Console.WriteLine ("This argument cannot be used multiple times.");
- return WhatToDoNext.AbandonProgram;
- }
-
- switch (value) {
- case "core":
- start_mode = StartMode.CoreFile;
- return WhatToDoNext.GoAhead;
-
- case "start":
- start_mode = StartMode.StartApplication;
- return WhatToDoNext.GoAhead;
-
- default:
- Console.WriteLine ("Invalid `--mode' argument.");
- return WhatToDoNext.AbandonProgram;
- }
- }
-
[Option("The command-line prompt", 'p', "prompt")]
public string Prompt = "$";
@@ -87,7 +49,6 @@ public abstract class ProcessStart
protected string base_dir;
string[] argv;
string[] envp;
- string core_file;
DebuggerOptions options;
protected bool native;
protected bool load_native_symtab;
@@ -117,11 +78,10 @@ static ProcessStart ()
}
}
- public ProcessStart (DebuggerOptions options, string[] argv, string core_file)
+ public ProcessStart (DebuggerOptions options, string[] argv)
: this (options)
{
this.argv = argv;
- this.core_file = core_file;
}
public ProcessStart (DebuggerOptions options)
@@ -130,6 +90,12 @@ public ProcessStart (DebuggerOptions options)
this.cwd = options.WorkingDirectory;
}
+ public DebuggerOptions Options {
+ get {
+ return options;
+ }
+ }
+
public string WorkingDirectory {
get {
return cwd;
@@ -190,14 +156,6 @@ public ProcessStart (DebuggerOptions options)
}
}
- public bool IsCoreFile {
- get { return core_file != null; }
- }
-
- public string CoreFile {
- get { return core_file; }
- }
-
public virtual string CommandLine {
get { return String.Join (" ", argv); }
}
@@ -270,21 +228,6 @@ protected virtual void DoSetup ()
initialized = true;
}
- protected static ProcessStart Create (DebuggerOptions options, string[] argv, string core_file)
- {
- Assembly application;
- try {
- application = Assembly.LoadFrom (argv [0]);
- } catch {
- application = null;
- }
-
- if (application != null)
- return new ManagedProcessStart (options, argv, application, core_file);
- else
- return new NativeProcessStart (options, argv, core_file);
- }
-
public static ProcessStart Create (DebuggerOptions options, string[] args)
{
if (options == null)
@@ -293,43 +236,30 @@ public static ProcessStart Create (DebuggerOptions options, string[] args)
options.ProcessArgs (args);
args = options.RemainingArguments;
- switch (options.Mode) {
- case DebuggerOptions.StartMode.CoreFile:
- if (args.Length < 2)
- throw new CannotStartTargetException (
- "You need to specify at least the name of " +
- "the core file and the application it was " +
- "generated from.");
-
- string core_file = args [0];
- string [] temp_args = new string [args.Length-1];
- Array.Copy (args, 1, temp_args, 0, args.Length-1);
- args = temp_args;
-
- return Create (options, args, core_file);
+ if (args.Length == 0)
+ throw new CannotStartTargetException (
+ "You need to specify the program you want " +
+ "to debug.");
- case DebuggerOptions.StartMode.Unknown:
- if (args.Length == 0)
- return null;
-
- return Create (options, args, null);
-
- default:
- if (args.Length == 0)
- throw new CannotStartTargetException (
- "You need to specify the program you want " +
- "to debug.");
-
- return Create (options, args, null);
+ Assembly application;
+ try {
+ application = Assembly.LoadFrom (args [0]);
+ } catch {
+ application = null;
}
+
+ if (application != null)
+ return new ManagedProcessStart (options, args);
+ else
+ return new NativeProcessStart (options, args);
}
}
[Serializable]
public class NativeProcessStart : ProcessStart
{
- public NativeProcessStart (DebuggerOptions options, string[] argv, string core_file)
- : base (options, argv, core_file)
+ public NativeProcessStart (DebuggerOptions options, string[] argv)
+ : base (options, argv)
{
}
}
@@ -337,15 +267,12 @@ public NativeProcessStart (DebuggerOptions options, string[] argv, string core_f
[Serializable]
public class ManagedProcessStart : NativeProcessStart
{
- Assembly application;
string[] old_argv;
string jit_wrapper, opt_flags;
- public ManagedProcessStart (DebuggerOptions options, string[] argv, Assembly application,
- string core_file)
- : base (options, argv, core_file)
+ public ManagedProcessStart (DebuggerOptions options, string[] argv)
+ : base (options, argv)
{
- this.application = application;
this.jit_wrapper = options.JitWrapper;
this.opt_flags = options.JitOptimizations;
}
@@ -371,9 +298,6 @@ protected override string[] SetupArguments ()
{
old_argv = base.SetupArguments ();
- MethodInfo main = application.EntryPoint;
- string main_name = main.DeclaringType + ":" + main.Name;
-
string[] start_argv = { jit_wrapper, opt_flags };
string[] new_argv = new string [old_argv.Length + start_argv.Length];
2  classes/SimpleSymbolTableCollection.cs
View
@@ -6,8 +6,6 @@ namespace Mono.Debugger
public class SimpleSymbolTableCollection : ISimpleSymbolTable, ICollection
{
ArrayList symtabs = new ArrayList ();
- bool in_update;
- bool needs_update = false;
public void AddSymbolTable (ISimpleSymbolTable symtab)
{
2  classes/SymbolTable.cs
View
@@ -117,8 +117,6 @@ protected SymbolTable (ISymbolContainer container)
}
}
- static int count = 0;
-
object get_methods (object user_data)
{
lock (this) {
5 classes/TargetMemoryArea.cs
View
@@ -10,16 +10,13 @@ public enum TargetMemoryFlags
public sealed class TargetMemoryArea
{
- ITargetMemoryAccess memory;
TargetAddress start, end;
TargetMemoryFlags flags;
string name;
public TargetMemoryArea (TargetAddress start, TargetAddress end,
- TargetMemoryFlags flags, string name,
- ITargetMemoryAccess memory)
+ TargetMemoryFlags flags, string name)
{
- this.memory = memory;
this.start = start;
this.end = end;
this.flags = flags;
3  frontends/command-line/Interpreter.cs
View
@@ -26,7 +26,6 @@ public Interpreter (ScriptingContext context)
public bool ProcessCommand (string line)
{
- bool ok;
if (line == "")
line = last_command;
if (line.StartsWith ("list"))
@@ -37,7 +36,7 @@ public bool ProcessCommand (string line)
return false;
try {
- ok = parser.Parse (line);
+ parser.Parse (line);
last_command = line;
} catch {
return true;
1  frontends/scripting/Generator.cs
View
@@ -338,7 +338,6 @@ public class CommandClass
{
Type type;
CommandAttribute attribute;
- ConstructorInfo ctor;
ExpressionClass[] args;
protected CommandClass (Type type, CommandAttribute attribute, ExpressionClass[] args)
2  frontends/scripting/Parser.jay
View
@@ -8,7 +8,6 @@ namespace Mono.Debugger.Frontends.CommandLine
{
public class Parser
{
- string name;
ScriptingContext current_context;
MyTextReader reader;
bool do_quit = false;
@@ -871,7 +870,6 @@ binary_operator
public Parser (ScriptingContext context, string name)
{
- this.name = name;
this.reader = new MyTextReader ();
this.current_context = context;
9 frontends/scripting/ScriptingContext.cs
View
@@ -233,15 +233,10 @@ public override string ToString ()
public class BacktraceHandle
{
- ProcessHandle process;
- Backtrace backtrace;
FrameHandle[] frames;
public BacktraceHandle (ProcessHandle process, Backtrace backtrace)
{
- this.process = process;
- this.backtrace = backtrace;
-
StackFrame[] bt_frames = backtrace.Frames;
if (bt_frames != null) {
frames = new FrameHandle [bt_frames.Length];
@@ -262,19 +257,17 @@ public BacktraceHandle (ProcessHandle process, Backtrace backtrace)
public class ProcessHandle
{
- DebuggerBackend backend;
ScriptingContext context;
IArchitecture arch;
Process process;
string name;
- int id, pid;
+ int id;
Hashtable registers;
public ProcessHandle (ScriptingContext context, DebuggerBackend backend, Process process)
{
this.context = context;
- this.backend = backend;
this.process = process;
this.id = process.ID;
7 frontends/scripting/Tokenizer.cs
View
@@ -181,11 +181,9 @@ public void restart ()
//
int getHex (int count, out bool error)
{
- int [] buffer = new int [8];
int i;
int total = 0;
int c;
- char e;
int top = count != -1 ? count : 4;
getChar ();
@@ -337,9 +335,6 @@ int GetKeyword (string name, bool tokens_seen)
//
int is_number (int c)
{
- bool is_real = false;
- int type;
-
number_builder.Length = 0;
if (c >= '0' && c <= '9'){
@@ -512,8 +507,6 @@ private string consume_help ()
public int xtoken ()
{
- int t;
- bool doread = false;
int c;
val = null;
4 frontends/scripting/VariableExpression.cs
View
@@ -286,14 +286,14 @@ protected override ITargetType DoResolveType (ScriptingContext context)
protected override ITargetObject DoResolveVariable (ScriptingContext context)
{
- ITargetType type = DoResolveType (context);
+ DoResolveType (context);
return frame.GetRegister (register, offset);
}
public TargetLocation ResolveLocation (ScriptingContext context)
{
- ITargetType type = DoResolveType (context);
+ DoResolveType (context);
return frame.GetRegisterLocation (register, offset, true);
}
Please sign in to comment.
Something went wrong with that request. Please try again.