Results 1 to 8 of 8
  1. #1
    diolu is offline Member
    Join Date
    Jan 2017
    Posts
    26
    Rep Power
    0

    Default Operation not supported when evaluating methods with a negative argument in jdb

    I have a weird problem. Let's take this example code:

    Java Code:
    public class Testjdb {
    
        public static void main(String[] args) {
            bonjour t = new bonjour();
            System.out.println(t.test(-5));
        }
    }
    
    class bonjour {
        int test(int x) {
            return x+1;
        }
    }
    This code run as expected (it prints -4), however, the weirdness come when I launch the jdb debugger on it. Look at this log:

    Initializing jdb ...
    > stop at Testjdb:5
    Deferring breakpoint Testjdb:5.
    It will be set after the class is loaded.
    > run
    run Testjdb
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Set deferred breakpoint Testjdb:5

    Breakpoint hit: "thread=main", Testjdb.main(), line=5 bci=8
    5 System.out.println(t.test(-5));

    main[1] print t.test(4)
    t.test(4) = 5
    main[1] print t.test(-4)
    operation not yet supported
    t.test(-4) = null
    main[1] print t.test(0-4)
    t.test(0-4) = -3


    What does happen here? Why I can't put a negative number in evaluating an expression in jdb. It tells me that is not yet supported, agree, but not being able to parse a negative int seems odd. Or is there a bug somewhere? Or do I miss something?

    Update: jdb is the command line debugger that come with Oracle Java (https://docs.oracle.com/javase/8/doc...ndows/jdb.html)
    Last edited by diolu; 02-20-2017 at 07:12 PM. Reason: Clarification

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Operation not supported when evaluating methods with a negative argument in jdb

    What's jdb?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Operation not supported when evaluating methods with a negative argument in jdb

    It's the command line debugger that comes with the SDK.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Operation not supported when evaluating methods with a negative argument in jdb

    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Operation not supported when evaluating methods with a negative argument in jdb

    I think this line from that link says it all:
    The jdb command demonstrates the Java Platform Debugger Architecture (JDBA)
    As with the jdbc-odbc driver, this is a proof-of-concept.
    I don't think it's really intended to be used as anything other than a demo of the underlying architecture.
    Consequently I wouldn't be surprised if it had certain unusual limitations.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    diolu is offline Member
    Join Date
    Jan 2017
    Posts
    26
    Rep Power
    0

    Default Re: Operation not supported when evaluating methods with a negative argument in jdb

    jdb is indeed the command line debugger that comes with Oracle Java. I update the question for clarification.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Operation not supported when evaluating methods with a negative argument in jdb

    As I said, though, it's a demonstrator for the debugging API.
    I don't think it was intended to be used to actually debug something, so this could well be a bug/limitation.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #8
    Join Date
    Dec 2016
    Posts
    5
    Rep Power
    0

    Default Re: Operation not supported when evaluating methods with a negative argument in jdb

    Yes it is command line debugger.

Similar Threads

  1. argument types in overriding methods
    By arshanvit in forum New To Java
    Replies: 1
    Last Post: 02-08-2017, 01:22 PM
  2. Replies: 5
    Last Post: 02-08-2015, 04:01 AM
  3. Explanation of nested methods as argument (Android)
    By StateMachine in forum New To Java
    Replies: 12
    Last Post: 01-17-2012, 12:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •