9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] acid analogues of gdb stepping commands
@ 2013-11-08  2:46 Nick Owens
  2013-11-08  7:40 ` Skip Tavakkolian
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Owens @ 2013-11-08  2:46 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 479 bytes --]

9fans,

i find myself needing to use acid a lot lately, and maybe i am going
about it wrong. i very much dislike that when i next() in acid, acid
will step through every subcall. what i would like is that it would
instead behave more like gdb's next. is this crazy or am i going about
using acid wrong?

maybe someone has acid analogues of gdb's next, finish, until as
described here.

https://sourceware.org/gdb/onlinedocs/gdb/Continuing-and-Stepping.html

nick


[-- Attachment #2: Type: application/pgp-signature, Size: 851 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] acid analogues of gdb stepping commands
  2013-11-08  2:46 [9fans] acid analogues of gdb stepping commands Nick Owens
@ 2013-11-08  7:40 ` Skip Tavakkolian
  2013-11-08 10:03   ` Skip Tavakkolian
  0 siblings, 1 reply; 6+ messages in thread
From: Skip Tavakkolian @ 2013-11-08  7:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: 9fans

Isn't step what you're looking for?

> On Nov 7, 2013, at 6:46 PM, Nick Owens <mischief@9.offblast.org> wrote:
>
> 9fans,
>
> i find myself needing to use acid a lot lately, and maybe i am going
> about it wrong. i very much dislike that when i next() in acid, acid
> will step through every subcall. what i would like is that it would
> instead behave more like gdb's next. is this crazy or am i going about
> using acid wrong?
>
> maybe someone has acid analogues of gdb's next, finish, until as
> described here.
>
> https://sourceware.org/gdb/onlinedocs/gdb/Continuing-and-Stepping.html
>
> nick
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] acid analogues of gdb stepping commands
  2013-11-08  7:40 ` Skip Tavakkolian
@ 2013-11-08 10:03   ` Skip Tavakkolian
  2013-11-08 23:46     ` Nick Owens
  0 siblings, 1 reply; 6+ messages in thread
From: Skip Tavakkolian @ 2013-11-08 10:03 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1188 bytes --]

ok, read this again and i see that you want to avoid all the intermediate
prints from next(). i looked at /sys/lib/acid/port but can't see where the
print is happening; maybe it's deeper in builtins.

something like this, but with better housekeeping to work with existing
acid code, could work:

defn Next() {
printto("/env/nextStmt", pcfile(*PC),":",pcline(*PC)+1);
bpset(filepc(readfile("/env/nextStmt")));
cont();
}


On Thu, Nov 7, 2013 at 11:40 PM, Skip Tavakkolian <
skip.tavakkolian@gmail.com> wrote:

> Isn't step what you're looking for?
>
> > On Nov 7, 2013, at 6:46 PM, Nick Owens <mischief@9.offblast.org> wrote:
> >
> > 9fans,
> >
> > i find myself needing to use acid a lot lately, and maybe i am going
> > about it wrong. i very much dislike that when i next() in acid, acid
> > will step through every subcall. what i would like is that it would
> > instead behave more like gdb's next. is this crazy or am i going about
> > using acid wrong?
> >
> > maybe someone has acid analogues of gdb's next, finish, until as
> > described here.
> >
> > https://sourceware.org/gdb/onlinedocs/gdb/Continuing-and-Stepping.html
> >
> > nick
> >
>

[-- Attachment #2: Type: text/html, Size: 2079 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] acid analogues of gdb stepping commands
  2013-11-08 10:03   ` Skip Tavakkolian
@ 2013-11-08 23:46     ` Nick Owens
  2013-11-08 23:51       ` erik quanstrom
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Owens @ 2013-11-08 23:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

On Fri, Nov 08, 2013 at 02:03:59AM -0800, Skip Tavakkolian wrote:
> something like this, but with better housekeeping to work with existing
> acid code, could work:
> 
> defn Next() {
> printto("/env/nextStmt", pcfile(*PC),":",pcline(*PC)+1);
> bpset(filepc(readfile("/env/nextStmt")));
> cont();
> }

this seems like it should work, but sometimes the computed PC for the
next line is way off, and cont() just runs the entire program. even more
confusing, doing pcline of the computed pc prints the next line
correctly, e.g.

x = filepc(pcfile(*PC)+":"+itoa(pcline(*PC)+1));
print(pcline(x));

will show the next line, but the new PC in x is totally wrong.

any clue why?

nick


[-- Attachment #2: Type: application/pgp-signature, Size: 851 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] acid analogues of gdb stepping commands
  2013-11-08 23:46     ` Nick Owens
@ 2013-11-08 23:51       ` erik quanstrom
  2013-11-09  0:36         ` Nick Owens
  0 siblings, 1 reply; 6+ messages in thread
From: erik quanstrom @ 2013-11-08 23:51 UTC (permalink / raw)
  To: 9fans

> this seems like it should work, but sometimes the computed PC for the
> next line is way off, and cont() just runs the entire program. even more
> confusing, doing pcline of the computed pc prints the next line
> correctly, e.g.
>
> x = filepc(pcfile(*PC)+":"+itoa(pcline(*PC)+1));
> print(pcline(x));
>
> will show the next line, but the new PC in x is totally wrong.
>
> any clue why?

have you tried compiling with -N (no peephole opt).

- erik



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] acid analogues of gdb stepping commands
  2013-11-08 23:51       ` erik quanstrom
@ 2013-11-09  0:36         ` Nick Owens
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Owens @ 2013-11-09  0:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

On Fri, Nov 08, 2013 at 06:51:54PM -0500, erik quanstrom wrote:
> have you tried compiling with -N (no peephole opt).
> 
> - erik
> 

i hadn't, but i just tried it like so, where Next is basically as Skip described:

cpu% 8c -FTVw -N ps.c
cpu% 8l -N -o 8.ps ps.8
cpu% cp 8.ps /386/bin/ps
cpu% acid /bin/ps
/bin/ps:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: new()
1645200: system call  _main SUBL  $0x48,SP
1645200: breakpoint main+0x3  MOVL  $0x1,none+0x2c(SP)
acid: Next()
mischief          1    0:00   0:00      220K Await    bootrc
mischief          2   12:39   0:00        0K Wakeme   genrandom
<rest of output elided>
1645200: breakpoint main+0xb  CMPL  argv0(SB),$0x0
<stdin>:3: (error) msg: pid=1645200 startstop: process exited
acid: 

Bsrc shows this happens right after ARGBEGIN. maybe that confuses acid?

i should mention now that i am on 9front, but i hope that doesn't matter.

nick


[-- Attachment #2: Type: application/pgp-signature, Size: 851 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-09  0:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-08  2:46 [9fans] acid analogues of gdb stepping commands Nick Owens
2013-11-08  7:40 ` Skip Tavakkolian
2013-11-08 10:03   ` Skip Tavakkolian
2013-11-08 23:46     ` Nick Owens
2013-11-08 23:51       ` erik quanstrom
2013-11-09  0:36         ` Nick Owens

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).