#110 NullPointerException in GdbPlugin.Debugger$OutOfBandHandler

Pavel Demin

1. Problem: When gdb sends a "stopped" messages without any "reason" field, a NullPointerException is produced in Debugger$OutOfBandHandler.handle:

22:59:31 [Thread-11] [error] Thread-11: Exception in thread "Thread-11"
22:59:31 [Thread-11] [error] Thread-11: java.lang.NullPointerException
22:59:31 [Thread-11] [error] Thread-11: at gdb.core.Debugger$OutOfBandHandler.handle(Debugger.java:441)
22:59:31 [Thread-11] [error] Thread-11: at gdb.core.Parser.parse(Parser.java:272)
22:59:31 [Thread-11] [error] Thread-11: at gdb.core.Parser.run(Parser.java:311)

2. Example of a gdb message that causes the problem:


3. Possible fix: add a null pointer check to the Debugger$OutOfBandHandler.handle method. The following code works for me:

String reason = res.getStringValue("reason");
if (reason == null) {
commandManager.add(getCurrentPosition, new StoppedHandler());


  • Alan Ezust

    Alan Ezust - 2012-03-06

    gdbplugin needs a new maintainer.

  • Jarek Czekalski

    Jarek Czekalski - 2012-06-23
    • assigned_to: nobody --> jarekczek
  • Pavel Demin

    Pavel Demin - 2012-06-23

    I've just attached a file with "svn diff" output. Is it OK?

  • Jarek Czekalski

    Jarek Czekalski - 2012-06-24
    • status: open --> closed-accepted
  • Jarek Czekalski

    Jarek Czekalski - 2012-06-24

    That's helpful. I applied your patch (r21872) after a small correction: linked the check to the if .. else if chain.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks