[9fans] stepping in acid - Plan9

This is a discussion on [9fans] stepping in acid - Plan9 ; I notice that the step() command in acid steps you by machine instructions rather than C statements. While this is probably useful in some cases, in my case I need to see what line of C I am executing. Can ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: [9fans] stepping in acid

  1. [9fans] stepping in acid

    I notice that the step() command in acid steps you by machine
    instructions rather than C statements. While this is probably
    useful in some cases, in my case I need to see what line of
    C I am executing. Can somebody show me how to do this?
    Thanks

    John


  2. Re: [9fans] stepping in acid

    src(*PC) i think is what you want:


    minooka; cat > sleep.c
    #include
    #include

    void
    main(void)
    {
    int i;

    for(i = 0; i < 100; i++)
    sleep(2000);
    exits("");
    }

  3. Re: [9fans] stepping in acid

    i think this is what you want:

    minooka; cat > sleep.c
    #include
    #include

    void
    main(void)
    {
    int i;

    for(i = 0; i < 100; i++)
    sleep(2000);
    exits("");
    }

  4. Re: [9fans] stepping in acid

    sorry for the noise. silly me. i cut and paste
    EOT.

    minooka; cat > sleep.c
    #include
    #include

    void
    main(void)
    {
    int i;

    for(i = 0; i < 100; i++)
    sleep(2000);
    exits("");
    }
    minooka; 8c sleep.c
    minooka; 8l sleep.8
    minooka; 8.out &
    minooka; acid $apid
    /proc/111181/text:386 plan 9 executable
    /sys/lib/acid/port
    /sys/lib/acid/386
    acid: lstk()
    sleep()+0x7 /sys/src/libc/9syscall/sleep.s:5
    main()+0x1b /usr/quanstro/sleep.c:10
    i=0x5
    _main+0x31 /sys/src/libc/386/main9.s:16
    acid: pc
    :3: (error) pc used but not set
    acid: PC
    0x00000038
    acid: src(*PC)
    no source for /sys/src/libc/9syscall/sleep.s

    - erik

  5. Re: [9fans] stepping in acid

    > I notice that the step() command in acid steps you by machine
    > instructions rather than C statements. While this is probably
    > useful in some cases, in my case I need to see what line of
    > C I am executing. Can somebody show me how to do this?
    > Thanks
    >
    > John


    stmnt()


  6. Re: [9fans] stepping in acid

    >> I notice that the step() command in acid steps you by machine
    >> instructions rather than C statements. While this is probably
    >> useful in some cases, in my case I need to see what line of
    >> C I am executing. Can somebody show me how to do this?
    >> Thanks
    >>
    >> John

    >
    > stmnt()


    acid is a beauty. here's the definition from /sys/lib/acid/port

    defn stmnt() // step one statement
    {
    local line;

    line = pcline(*PC);
    while 1 do {
    step();
    if line != pcline(*PC) then {
    src(*PC);
    return {};
    }
    }
    }


  7. Re: [9fans] stepping in acid

    >>> I notice that the step() command in acid steps you by machine
    >>> instructions rather than C statements. While this is probably
    >>> useful in some cases, in my case I need to see what line of
    >>> C I am executing. Can somebody show me how to do this?
    >>> Thanks
    >>>
    >>> John

    >>
    >> stmnt()

    >
    > acid is a beauty. here's the definition from /sys/lib/acid/port
    >
    > defn stmnt() // step one statement
    > {
    > local line;
    >
    > line = pcline(*PC);
    > while 1 do {
    > step();
    > if line != pcline(*PC) then {
    > src(*PC);
    > return {};
    > }
    > }
    > }


    This looks like the thing I want; thanks everyone!

    John


  8. Re: [9fans] stepping in acid

    > > I notice that the step() command in acid steps you by machine
    > > instructions rather than C statements. While this is probably
    > > useful in some cases, in my case I need to see what line of
    > > C I am executing. Can somebody show me how to do this?
    > > Thanks


    see also slide 18 (Library functions) of Russ' acid trips,
    where he shows how you can set up the function 'stopped'
    to automatically highlight the line where acid is stopped
    in sam or acme, using acid 'Bsrc' command.

    http://swtch.com/~rsc/talks/acid07/

    (Russ: is there a way to give a URL that directly points
    to a particular page in acid trips?)


    Axel.

  9. Re: [9fans] stepping in acid

    On Dec 20, 2007 4:29 PM, Axel Belinfante wrote:
    > (Russ: is there a way to give a URL that directly points
    > to a particular page in acid trips?)


    Try ; sometimes it works,
    sometimes not.

    --Joel

+ Reply to Thread