Author callmekohei
Recipients callmekohei, ned.deily, ronaldoussoren
Date 2018-01-11.05:24:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1515648246.66.0.467229070634.issue32531@psf.upfronthosting.co.za>
In-reply-to
Content
Hello! I'm callmekohei! (^_^)/


------------------------
   Problems summary
------------------------

gdb.execute can not put string value.


------------------------
   Steps to Reproduce
------------------------

// create 
$ gcc -g foo.c

// launch sdb
$ sdb a.out

// set breakpoint
$ b foo.c:5

// run
$ run

// next
$ n


------------------------
   Current Behavior
------------------------

(gdb)  n
6	    n = 2;
False
True


------------------------
   Expected Behavior
------------------------

(gdb)  n
False
False


------------------------
   Code 
------------------------

// .gdbinit

set startup-with-shell off

python

class Foo(gdb.Command):

    def __init__(self):
        gdb.Command.__init__(self                     \
                , name            = 'n'               \
                , command_class   = gdb.COMMAND_USER  \
                , completer_class = gdb.COMPLETE_NONE \
                , prefix          = True)

    def invoke(self, arg, from_tty):
        output = gdb.execute(command='next',from_tty=False, to_string=True)
        print(output is None)
        print(output == '')

Foo()

end


// foo.c

#include <stdio.h>

int main(int argc, char *args[])
{
    int n = 1;
    n = 2;
    n = 3;
    n = 4;
    n = 5;
    n = 6;
    n = 7;
    n = 8;
    n = 9;
    printf("n = %d\n",n);
    return 0;
}


------------------------
   Others 
------------------------

see also:

https://github.com/mono/sdb/issues/45
History
Date User Action Args
2018-01-11 05:24:06callmekoheisetrecipients: + callmekohei, ronaldoussoren, ned.deily
2018-01-11 05:24:06callmekoheisetmessageid: <1515648246.66.0.467229070634.issue32531@psf.upfronthosting.co.za>
2018-01-11 05:24:06callmekoheilinkissue32531 messages
2018-01-11 05:24:05callmekoheicreate