[Pkg-cli-apps-commits] [SCM] monodevelop-debugger-gdb branch, master-experimental, updated. debian/2.5.92-1
Jo Shields
directhex at apebox.org
Tue Jun 28 22:20:06 UTC 2011
The following commit has been merged in the master-experimental branch:
commit 9ec67a2f5a3952ec01707e250afa17d655430046
Author: Jo Shields <directhex at apebox.org>
Date: Tue Jun 28 22:50:30 2011 +0100
Imported Upstream version 2.5.92
diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs
index f3ce7f9..ad3b28e 100644
--- a/AssemblyInfo.cs
+++ b/AssemblyInfo.cs
@@ -5,5 +5,5 @@ using System.Reflection;
[assembly: AssemblyProduct ("MonoDevelop")]
[assembly: AssemblyTitle ("GDB support for Mono.Debugging")]
[assembly: AssemblyDescription ("GNU Debugger support for Mono.Debugging")]
-[assembly: AssemblyVersion ("2.4")]
+[assembly: AssemblyVersion ("2.6")]
[assembly: AssemblyCopyright ("MIT X11")]
diff --git a/GdbSession.cs b/GdbSession.cs
index 3b685c2..e88742c 100644
--- a/GdbSession.cs
+++ b/GdbSession.cs
@@ -25,9 +25,6 @@
//
//
-// Uncomment to see the commands sent to gdb and the output it generates
-// #define GDB_OUTPUT
-
using System;
using System.Globalization;
using System.Text;
@@ -57,8 +54,8 @@ namespace MonoDevelop.Debugger.Gdb
bool isMonoProcess;
string currentProcessName;
List<string> tempVariableObjects = new List<string> ();
- Dictionary<int,Breakpoint> breakpoints = new Dictionary<int,Breakpoint> ();
- List<Breakpoint> breakpointsWithHitCount = new List<Breakpoint> ();
+ Dictionary<int,BreakEventInfo> breakpoints = new Dictionary<int,BreakEventInfo> ();
+ List<BreakEventInfo> breakpointsWithHitCount = new List<BreakEventInfo> ();
DateTime lastBreakEventUpdate = DateTime.Now;
Dictionary<int, WaitCallback> breakUpdates = new Dictionary<int,WaitCallback> ();
@@ -66,11 +63,17 @@ namespace MonoDevelop.Debugger.Gdb
const int BreakEventUpdateNotifyDelay = 500;
bool internalStop;
+ bool logGdb;
object syncLock = new object ();
object eventLock = new object ();
object gdbLock = new object ();
+ public GdbSession ()
+ {
+ logGdb = !string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("MONODEVELOP_GDB_LOG"));
+ }
+
protected override void OnRun (DebuggerStartInfo startInfo)
{
lock (gdbLock) {
@@ -117,7 +120,7 @@ namespace MonoDevelop.Debugger.Gdb
throw;
}
- RunCommand ("-environment-directory", Escape (startInfo.WorkingDirectory));
+ RunCommand ("-environment-cd", Escape (startInfo.WorkingDirectory));
// Set inferior arguments
if (!string.IsNullOrEmpty (startInfo.Arguments))
@@ -250,14 +253,22 @@ namespace MonoDevelop.Debugger.Gdb
protected override void OnFinish ()
{
SelectThread (activeThread);
- RunCommand ("-exec-finish");
+ GdbCommandResult res = RunCommand ("-stack-info-depth", "2");
+ if (res.GetValue ("depth") == "1") {
+ RunCommand ("-exec-continue");
+ } else {
+ RunCommand ("-stack-select-frame", "0");
+ RunCommand ("-exec-finish");
+ }
}
- protected override object OnInsertBreakEvent (BreakEvent be, bool activate)
+ protected override BreakEventInfo OnInsertBreakEvent (BreakEvent be)
{
Breakpoint bp = be as Breakpoint;
if (bp == null)
- return null;
+ throw new NotSupportedException ();
+
+ BreakEventInfo bi = new BreakEventInfo ();
lock (gdbLock) {
bool dres = InternalStop ();
@@ -265,7 +276,7 @@ namespace MonoDevelop.Debugger.Gdb
string extraCmd = string.Empty;
if (bp.HitCount > 0) {
extraCmd += "-i " + bp.HitCount;
- breakpointsWithHitCount.Add (bp);
+ breakpointsWithHitCount.Add (bi);
}
if (!string.IsNullOrEmpty (bp.ConditionExpression)) {
if (!bp.BreakIfConditionChanges)
@@ -293,14 +304,16 @@ namespace MonoDevelop.Debugger.Gdb
}
}
if (res == null) {
- OnDebuggerOutput (true, "Could not set breakpoint: " + errorMsg);
- return null;
+ bi.SetStatus (BreakEventStatus.Invalid, errorMsg);
+ return bi;
}
int bh = res.GetObject ("bkpt").GetInt ("number");
- if (!activate)
+ if (!be.Enabled)
RunCommand ("-break-disable", bh.ToString ());
- breakpoints [bh] = bp;
- return bh;
+ breakpoints [bh] = bi;
+ bi.Handle = bh;
+ bi.SetStatus (BreakEventStatus.Bound, null);
+ return bi;
} finally {
InternalResume (dres);
}
@@ -309,10 +322,12 @@ namespace MonoDevelop.Debugger.Gdb
bool CheckBreakpoint (int handle)
{
- Breakpoint bp = breakpoints [handle];
- if (bp == null)
+ BreakEventInfo binfo;
+ if (!breakpoints.TryGetValue (handle, out binfo))
return true;
+ Breakpoint bp = (Breakpoint) binfo.BreakEvent;
+
if (!string.IsNullOrEmpty (bp.ConditionExpression) && bp.BreakIfConditionChanges) {
// Update the condition expression
GdbCommandResult res = RunCommand ("-data-evaluate-expression", Escape (bp.ConditionExpression));
@@ -323,21 +338,21 @@ namespace MonoDevelop.Debugger.Gdb
if (bp.HitAction == HitAction.PrintExpression) {
GdbCommandResult res = RunCommand ("-data-evaluate-expression", Escape (bp.TraceExpression));
string val = res.GetValue ("value");
- NotifyBreakEventUpdate (handle, 0, val);
+ NotifyBreakEventUpdate (binfo, 0, val);
return false;
}
return true;
}
- void NotifyBreakEventUpdate (int eventHandle, int hitCount, string lastTrace)
+ void NotifyBreakEventUpdate (BreakEventInfo binfo, int hitCount, string lastTrace)
{
bool notify = false;
WaitCallback nc = delegate {
if (hitCount != -1)
- UpdateHitCount (eventHandle, hitCount);
+ binfo.UpdateHitCount (hitCount);
if (lastTrace != null)
- UpdateLastTraceValue (eventHandle, lastTrace);
+ binfo.UpdateLastTraceValue (lastTrace);
};
lock (breakUpdates)
@@ -349,7 +364,7 @@ namespace MonoDevelop.Debugger.Gdb
notify = true;
} else {
// Queue the event notifications to avoid wasting too much time
- breakUpdates [eventHandle] = nc;
+ breakUpdates [(int)binfo.Handle] = nc;
if (!breakUpdateEventsQueued) {
breakUpdateEventsQueued = true;
@@ -374,74 +389,75 @@ namespace MonoDevelop.Debugger.Gdb
void UpdateHitCountData ()
{
- foreach (Breakpoint bp in breakpointsWithHitCount) {
- object h;
- if (GetBreakpointHandle (bp, out h)) {
- GdbCommandResult res = RunCommand ("-break-info", h.ToString ());
- string val = res.GetObject ("BreakpointTable").GetObject ("body").GetObject (0).GetObject ("bkpt").GetValue ("ignore");
- if (val != null)
- NotifyBreakEventUpdate ((int)h, int.Parse (val), null);
- else
- NotifyBreakEventUpdate ((int)h, 0, null);
- }
+ foreach (BreakEventInfo bp in breakpointsWithHitCount) {
+ GdbCommandResult res = RunCommand ("-break-info", bp.Handle.ToString ());
+ string val = res.GetObject ("BreakpointTable").GetObject ("body").GetObject (0).GetObject ("bkpt").GetValue ("ignore");
+ if (val != null)
+ NotifyBreakEventUpdate (bp, int.Parse (val), null);
+ else
+ NotifyBreakEventUpdate (bp, 0, null);
}
breakpointsWithHitCount.Clear ();
}
- protected override void OnRemoveBreakEvent (object handle)
+ protected override void OnRemoveBreakEvent (BreakEventInfo binfo)
{
lock (gdbLock) {
+ if (binfo.Handle == null)
+ return;
bool dres = InternalStop ();
- Breakpoint bp = breakpoints [(int)handle];
- breakpointsWithHitCount.Remove (bp);
- breakpoints.Remove ((int)handle);
+ breakpointsWithHitCount.Remove (binfo);
+ breakpoints.Remove ((int)binfo.Handle);
try {
- RunCommand ("-break-delete", handle.ToString ());
+ RunCommand ("-break-delete", binfo.Handle.ToString ());
} finally {
InternalResume (dres);
}
}
}
- protected override void OnEnableBreakEvent (object handle, bool enable)
+ protected override void OnEnableBreakEvent (BreakEventInfo binfo, bool enable)
{
lock (gdbLock) {
+ if (binfo.Handle == null)
+ return;
bool dres = InternalStop ();
try {
if (enable)
- RunCommand ("-break-enable", handle.ToString ());
+ RunCommand ("-break-enable", binfo.Handle.ToString ());
else
- RunCommand ("-break-disable", handle.ToString ());
+ RunCommand ("-break-disable", binfo.Handle.ToString ());
} finally {
InternalResume (dres);
}
}
}
- protected override object OnUpdateBreakEvent (object handle, BreakEvent be)
+ protected override void OnUpdateBreakEvent (BreakEventInfo binfo)
{
- Breakpoint bp = be as Breakpoint;
+ Breakpoint bp = binfo.BreakEvent as Breakpoint;
if (bp == null)
- return null;
+ throw new NotSupportedException ();
+ if (binfo.Handle == null)
+ return;
+
bool ss = InternalStop ();
try {
if (bp.HitCount > 0) {
- RunCommand ("-break-after", handle.ToString (), bp.HitCount.ToString ());
- breakpointsWithHitCount.Add (bp);
+ RunCommand ("-break-after", binfo.Handle.ToString (), bp.HitCount.ToString ());
+ breakpointsWithHitCount.Add (binfo);
} else
- breakpointsWithHitCount.Remove (bp);
+ breakpointsWithHitCount.Remove (binfo);
if (!string.IsNullOrEmpty (bp.ConditionExpression) && !bp.BreakIfConditionChanges)
- RunCommand ("-break-condition", handle.ToString (), bp.ConditionExpression);
+ RunCommand ("-break-condition", binfo.Handle.ToString (), bp.ConditionExpression);
else
- RunCommand ("-break-condition", handle.ToString ());
+ RunCommand ("-break-condition", binfo.Handle.ToString ());
} finally {
InternalResume (ss);
}
-
- return handle;
}
protected override void OnContinue ()
@@ -541,9 +557,10 @@ namespace MonoDevelop.Debugger.Gdb
lock (eventLock) {
running = true;
}
-#if GDB_OUTPUT
- Console.WriteLine ("gdb<: " + command + " " + string.Join (" ", args));
-#endif
+
+ if (logGdb)
+ Console.WriteLine ("gdb<: " + command + " " + string.Join (" ", args));
+
sin.WriteLine (command + " " + string.Join (" ", args));
if (!Monitor.Wait (syncLock, 4000))
@@ -588,9 +605,8 @@ namespace MonoDevelop.Debugger.Gdb
void ProcessOutput (string line)
{
-#if GDB_OUTPUT
- Console.WriteLine ("dbg>: '" + line + "'");
-#endif
+ if (logGdb)
+ Console.WriteLine ("dbg>: '" + line + "'");
switch (line [0]) {
case '^':
lock (syncLock) {
diff --git a/Manifest.addin.xml b/Manifest.addin.xml
index 08d1f0e..c31c20b 100644
--- a/Manifest.addin.xml
+++ b/Manifest.addin.xml
@@ -5,12 +5,12 @@
description = "GNU Debugger support for Mono.Debugging"
copyright = "MIT X11"
category = "Debugging"
- version = "2.4">
+ version = "2.6">
<Dependencies>
- <Addin id="MonoDevelop.Core" version="2.4"/>
- <Addin id="MonoDevelop.Ide" version="2.4"/>
- <Addin id="MonoDevelop.Debugger" version="2.4"/>
+ <Addin id="MonoDevelop.Core" version="2.6"/>
+ <Addin id="MonoDevelop.Ide" version="2.6"/>
+ <Addin id="MonoDevelop.Debugger" version="2.6"/>
</Dependencies>
<Extension path="/MonoDevelop/Debugging/DebuggerEngines">
diff --git a/configure b/configure
index 08af177..0318278 100755
--- a/configure
+++ b/configure
@@ -1,10 +1,10 @@
#!/bin/bash
-VERSION=2.4
+VERSION=2.5.92
PACKAGE=monodevelop-debugger-gdb
prefix=/usr/local
config=DEBUG
configurations=" RELEASE DEBUG"
-common_packages=" monodevelop;2.4"
+common_packages=" monodevelop;2.5.92"
usage ()
@@ -142,7 +142,7 @@ echo "ASSEMBLY_VERSION=$VERSION.0.0" >> config.make
echo "VERSION=$VERSION" >> config.make
echo "PACKAGE=$PACKAGE" >> config.make
echo "CONFIG=$config" >> config.make
-echo "CSC=gmcs" >> config.make
+echo "CSC=dmcs" >> config.make
echo
echo "$PACKAGE has been configured with "
--
monodevelop-debugger-gdb
More information about the Pkg-cli-apps-commits
mailing list