* [9fans] stepping in acid
@ 2007-12-20 20:53 john
2007-12-20 20:58 ` erik quanstrom
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: john @ 2007-12-20 20:53 UTC (permalink / raw)
To: 9fans
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [9fans] stepping in acid
2007-12-20 20:53 [9fans] stepping in acid john
@ 2007-12-20 20:58 ` erik quanstrom
2007-12-20 20:58 ` erik quanstrom
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: erik quanstrom @ 2007-12-20 20:58 UTC (permalink / raw)
To: 9fans
src(*PC) i think is what you want:
minooka; cat > sleep.c
#include<u.h>
#include<libc.h>
void
main(void)
{
int i;
for(i = 0; i < 100; i++)
sleep(2000);
exits("");
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [9fans] stepping in acid
2007-12-20 20:53 [9fans] stepping in acid john
2007-12-20 20:58 ` erik quanstrom
@ 2007-12-20 20:58 ` erik quanstrom
2007-12-20 21:00 ` erik quanstrom
2007-12-20 21:02 ` Brantley Coile
3 siblings, 0 replies; 9+ messages in thread
From: erik quanstrom @ 2007-12-20 20:58 UTC (permalink / raw)
To: 9fans
i think this is what you want:
minooka; cat > sleep.c
#include<u.h>
#include<libc.h>
void
main(void)
{
int i;
for(i = 0; i < 100; i++)
sleep(2000);
exits("");
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [9fans] stepping in acid
2007-12-20 20:53 [9fans] stepping in acid john
2007-12-20 20:58 ` erik quanstrom
2007-12-20 20:58 ` erik quanstrom
@ 2007-12-20 21:00 ` erik quanstrom
2007-12-20 21:02 ` Brantley Coile
3 siblings, 0 replies; 9+ messages in thread
From: erik quanstrom @ 2007-12-20 21:00 UTC (permalink / raw)
To: 9fans
sorry for the noise. silly me. i cut and paste
EOT.
minooka; cat > sleep.c
#include<u.h>
#include<libc.h>
void
main(void)
{
int i;
for(i = 0; i < 100; i++)
sleep(2000);
exits("");
}
<EOT>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
<stdin>:3: (error) pc used but not set
acid: PC
0x00000038
acid: src(*PC)
no source for /sys/src/libc/9syscall/sleep.s
- erik
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [9fans] stepping in acid
2007-12-20 20:53 [9fans] stepping in acid john
` (2 preceding siblings ...)
2007-12-20 21:00 ` erik quanstrom
@ 2007-12-20 21:02 ` Brantley Coile
2007-12-20 21:10 ` Skip Tavakkolian
2007-12-20 21:29 ` Axel Belinfante
3 siblings, 2 replies; 9+ messages in thread
From: Brantley Coile @ 2007-12-20 21:02 UTC (permalink / raw)
To: 9fans
> 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()
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [9fans] stepping in acid
2007-12-20 21:02 ` Brantley Coile
@ 2007-12-20 21:10 ` Skip Tavakkolian
2007-12-20 21:13 ` john
2007-12-20 21:29 ` Axel Belinfante
1 sibling, 1 reply; 9+ messages in thread
From: Skip Tavakkolian @ 2007-12-20 21:10 UTC (permalink / raw)
To: 9fans
>> 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 {};
}
}
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [9fans] stepping in acid
2007-12-20 21:10 ` Skip Tavakkolian
@ 2007-12-20 21:13 ` john
0 siblings, 0 replies; 9+ messages in thread
From: john @ 2007-12-20 21:13 UTC (permalink / raw)
To: 9fans
>>> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [9fans] stepping in acid
2007-12-20 21:02 ` Brantley Coile
2007-12-20 21:10 ` Skip Tavakkolian
@ 2007-12-20 21:29 ` Axel Belinfante
2007-12-20 23:12 ` Joel C. Salomon
1 sibling, 1 reply; 9+ messages in thread
From: Axel Belinfante @ 2007-12-20 21:29 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
> > 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [9fans] stepping in acid
2007-12-20 21:29 ` Axel Belinfante
@ 2007-12-20 23:12 ` Joel C. Salomon
0 siblings, 0 replies; 9+ messages in thread
From: Joel C. Salomon @ 2007-12-20 23:12 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
On Dec 20, 2007 4:29 PM, Axel Belinfante <Axel.Belinfante@cs.utwente.nl> wrote:
> (Russ: is there a way to give a URL that directly points
> to a particular page in acid trips?)
Try <http://swtch.com/~rsc/talks/acid07/#(18)>; sometimes it works,
sometimes not.
--Joel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-12-20 23:12 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-20 20:53 [9fans] stepping in acid john
2007-12-20 20:58 ` erik quanstrom
2007-12-20 20:58 ` erik quanstrom
2007-12-20 21:00 ` erik quanstrom
2007-12-20 21:02 ` Brantley Coile
2007-12-20 21:10 ` Skip Tavakkolian
2007-12-20 21:13 ` john
2007-12-20 21:29 ` Axel Belinfante
2007-12-20 23:12 ` Joel C. Salomon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).