Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#110 NullPointerException in GdbPlugin.Debugger$OutOfBandHandler

closed-accepted
None
5
2012-06-24
2012-03-06
Pavel Demin
No

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:

*stopped,frame={addr="0x0000c000",func="_reset_vector__",args=[],file="../../../gcc-4.5.3/gcc/config/msp430/crt0.S",line="118"},thread-id="1",stopped-threads="all"

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());
return;
}

Discussion

  • Alan Ezust
    Alan Ezust
    2012-03-06

    gdbplugin needs a new maintainer.

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

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

     
    • status: open --> closed-accepted
     
  • That's helpful. I applied your patch (r21872) after a small correction: linked the check to the if .. else if chain.