break <TAB> causes same: [pmuldoon@localhost frysk-core]$ ./frysk/bindir/fhpd (fhpd) load /bin/sleep Loaded executable file: /bin/sleep (fhpd) start Attached to process 17018 starting/running with this command: /bin/sleep (fhpd) break mjava.lang.NullPointerException at frysk.debuginfo.ObjectDeclarationSearchEngine.complete(fhpd) at frysk.expr.IncompleteIdentifierException.complete(fhpd) at frysk.expr.ExpressionFactory.complete(fhpd) at frysk.hpd.CompletionFactory.completeExpression(fhpd) at frysk.hpd.BreakpointCommand.completer(fhpd) at frysk.hpd.ParameterizedCommand.complete(fhpd) at frysk.hpd.MultiLevelCom mand.complete(fhpd) at frysk.hpd.CLI.complete(fhpd) at frysk.bindir.fhpd$FhpdCompletor.complete(fhpd) at jline.ConsoleReader.complete(fhpd) at jline.ConsoleReader.readLine(fhpd) at jline.ConsoleReader.readLine(fhpd) at frysk.bindir.fhpd.main(fhpd) breakpoint 0 deferred
This comes from not checking whether the compilation unit for the current address actually exists. Quick and dirty patch that seems to work around the issue. The XXX in the comments suggest this is code isn't finished though. diff --git a/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java b/fry index 94aee90..86e8e1b 100644 --- a/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java +++ b/frysk-core/frysk/debuginfo/ObjectDeclarationSearchEngine.java @@ -139,16 +139,18 @@ public class ObjectDeclarationSearchEngine implements Expr /** * XXX: Who knows if this works; it is certainly not implemented * correctly as it should use the ObjectDeclaration. */ public void complete(String incomplete, List candidates) { long pc = frame.getAdjustedAddress(); Dwfl dwfl = DwflCache.getDwfl(frame.getTask()); DwflDieBias bias = dwfl.getCompilationUnit(pc); + if (bias == null) + return; DwarfDie die = bias.die; DwarfDie[] allDies = die.getScopes(pc - bias.bias); List candidates_p = die.getScopeVarNames(allDies, incomplete); for (Iterator i = candidates_p.iterator(); i.hasNext();) { String sNext = (String) i.next(); candidates.add(sNext); } }