"Error getting locals" in Water debugger

Running Water with Elements 10.0.0.2351, I am suddenly unable to inspect locals in the debugger. It shows a message

Error getting locals: system.collections.generic.keynotfoundexception.

Strangely, I tried to reproduce in a new project, but I am not able to create a new project due to error

Value cannot be null - Parameter name: collection

I am debugging an Android project written in Oxygene.

Does it print any more detailed stack trace for either exception? Does the issue persist with the latest, .2359?

thanx,
marc

Oops my mistake - Iā€™m running .2359, not .2351, so yes. I also tried downgrading to .2358 and the issue persisted.

Nope, thatā€™s all Iā€™m getting for either one. I did a full uninstall and clean install and I am no longer getting the error on creating a new project, but I am still getting the error in the inspector.

Iā€™ve been playing around with it and have noticed some more details:

I am able to inspect locals in a method as long as there is only a single variable type defined within the method. For example (this is actual code from a newly created test project):

method MainActivity.doHelloWorld;
  var
    text1, text2: String;
begin
  text2 := 'Hello, world 2.';
  Log.d('tests', text2);
end;

I am able to inspect this and see the value of text2, although strangely the first variable (in this case, text1) always shows up in the inspector as ā€œselfā€, regardless of type or name, but it does show the correct value. If I change the code to this:

method MainActivity.doHelloWorld;
  var
    text1, text2: String;
    num: Integer; // only change from first example
begin
  text2 := 'Hello, world 2.';
  Log.d('tests', text2);
end;

then I get the same ā€œerror getting localsā€ error that I was getting in my main project.

If I define a class-scope variable, the app crashes while debugging if I expand the ā€œthisā€ scope item in the inspector. Oddly, the crash takes about one second to occur (consistently) and I am able to see that it displays the field name and value correctly before crashing. Strange all around, as debugging and inspecting were working fine for me just a few days ago.

Hereā€™s the full test project. Itā€™s a new project with only a handful of changes to test this bug.

com.matt.tests.zip (189.8 KB)

Thanks, logged as bugs://81678 ā€” for the ā€˜error getting localsā€™

Does this mean that someone was able to reproduce the bug on another system?

No, just that since enow have a testcase I can have someone look at it :wink:

Can you check Water.log to see if you see an y more details there? I just reviewed the code, and i should be logging the whole exception, there as ā€œException getting locals: ...ā€

I cannot reproduce this one. Can you give me more steps? I assume you do File|New Project, then Java Console App or Android App (i tried both)? Does the error show before or after you browse for the target folder? how/where does it show, as a message box? using waterā€™s ā€œOops there was a problemā€ Exception dialog?

It does show "The given key was not present in the dictionary." Hereā€™s from there to the end, which appears to include the crash I referred to above.

2019-01-07 20:02:14 Exception getting locals: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at RemObjects.Oxygene.CoreDebugEngine.CooperDebugEngine.FillFrameData(StackFrameInfo ec)
   at RemObjects.Oxygene.CoreDebugEngine.StackFrameInfo.get_Locals()
   at RemObjects.Fire.ProjectSystem.DebugSession.fillLocals(StackFrameInfo stackFrame)
2019-01-07 20:02:14 <- Exception in block: The given key was not present in the dictionary. at    at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at RemObjects.Oxygene.CoreDebugEngine.CooperDebugEngine.FillFrameData(StackFrameInfo ec)
   at RemObjects.Oxygene.CoreDebugEngine.StackFrameInfo.get_Self()
   at RemObjects.Fire.ProjectSystem.TextFile.<>c__DisplayClass38.<getLocals>b__2()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:05:19 parameters {
  "Arguments": [
  ],
  "EnvironmentVariables": {
  },
  "Mode": "Cooper",
  "SubMode": "Android",
  "CaptureOutput": true,
  "CrossBox": "Local",
  "LocalExecutable": "C:\\Users\\mattr\\Documents\\RemObjects Software\\Elements\\Water\\com.matt.tests\\Bin\\Debug\\com.matt.tests.apk",
  "Architecture": "jvm",
  "AndroidDeviceID": "HT72V0201615",
  "AndroidPackageName": "com.matt.tests",
  "AndroidMainActivityName": "com.matt.tests.MainActivity",
  "UseMixedDebugger": false,
  "Detach": false,
  "StrictBreakpoints": true
}
2019-01-07 20:05:27 evaluateExpressionOnCurrentStackFrame error (Error) for expression 'end': End of expression expected but found: end
2019-01-07 20:05:31 <- Exception in block: Value cannot be null.
Parameter name: source at    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at RemObjects.Oxygene.CoreDebugEngine.CooperValue.get_HasChildren()
   at RemObjects.Fire.ProjectSystem.DebugEvaluation..ctor(DebugSession debugSession, StackFrameInfo stackFrame, EvaluatorValue evaluation)
   at RemObjects.Fire.ProjectSystem.DebugEvaluation.<>c__DisplayClass0.<fillChildrenWithCallback>b__0()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:05:32 <- Exception in block: Value cannot be null.
Parameter name: source at    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at RemObjects.Oxygene.CoreDebugEngine.CooperValue.get_HasChildren()
   at RemObjects.Fire.ProjectSystem.DebugEvaluation..ctor(DebugSession debugSession, StackFrameInfo stackFrame, EvaluatorValue evaluation)
   at RemObjects.Fire.ProjectSystem.DebugEvaluation.<>c__DisplayClass0.<fillChildrenWithCallback>b__0()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:05:37 parameters {
  "Arguments": [
  ],
  "EnvironmentVariables": {
  },
  "Mode": "Cooper",
  "SubMode": "Android",
  "CaptureOutput": true,
  "CrossBox": "Local",
  "LocalExecutable": "C:\\Users\\mattr\\Documents\\RemObjects Software\\Elements\\Water\\com.matt.tests\\Bin\\Debug\\com.matt.tests.apk",
  "Architecture": "jvm",
  "AndroidDeviceID": "HT72V0201615",
  "AndroidPackageName": "com.matt.tests",
  "AndroidMainActivityName": "com.matt.tests.MainActivity",
  "UseMixedDebugger": false,
  "Detach": false,
  "StrictBreakpoints": true
}
2019-01-07 20:05:52 <- Exception in block: Value cannot be null.
Parameter name: source at    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at RemObjects.Oxygene.CoreDebugEngine.CooperValue.get_HasChildren()
   at RemObjects.Fire.ProjectSystem.DebugEvaluation..ctor(DebugSession debugSession, StackFrameInfo stackFrame, EvaluatorValue evaluation)
   at RemObjects.Fire.ProjectSystem.DebugEvaluation.<>c__DisplayClass0.<fillChildrenWithCallback>b__0()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:05:52 <- Exception in block: Value cannot be null.
Parameter name: source at    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at RemObjects.Oxygene.CoreDebugEngine.CooperValue.get_HasChildren()
   at RemObjects.Fire.ProjectSystem.DebugEvaluation..ctor(DebugSession debugSession, StackFrameInfo stackFrame, EvaluatorValue evaluation)
   at RemObjects.Fire.ProjectSystem.DebugEvaluation.<>c__DisplayClass0.<fillChildrenWithCallback>b__0()
   at RemObjects.Fire.BaseLibrary.SBLSingleThreadedQueue.processQueue(List`1 queue)
2019-01-07 20:06:07 parameters {
  "Arguments": [
  ],
  "EnvironmentVariables": {
  },
  "Mode": "Cooper",
  "SubMode": "Android",
  "CaptureOutput": true,
  "CrossBox": "Local",
  "LocalExecutable": "C:\\Users\\mattr\\Documents\\RemObjects Software\\Elements\\Water\\com.matt.tests\\Bin\\Debug\\com.matt.tests.apk",
  "Architecture": "jvm",
  "AndroidDeviceID": "HT72V0201615",
  "AndroidPackageName": "com.matt.tests",
  "AndroidMainActivityName": "com.matt.tests.MainActivity",
  "UseMixedDebugger": false,
  "Detach": false,
  "StrictBreakpoints": true
}

I canā€™t reproduce this one now either. I didnā€™t even get the ā€œOops there was a problemā€ dialog. It was just a plain white dialog that showed

Value cannot be null.
Parameter name: collection

:(.

Weird.

bugs://81678 got closed with status fixed.

This seems promising :slight_smile: What happened with this?

It was fixed? :wink:

Great! Thanks for the fix! Would it be possible for me to get a build with this fix? Iā€™m trying to sort through a few bugs and 90% of the time the debugger either shows this or crashes out of the debug session completely.

Sure thing, Iā€™ll start a new build with Water for you now.

1 Like

Up!

1 Like

Thanks Marc!

1 Like