Danny Webster
2009-Jun-05 13:46 UTC
[dtrace-discuss] (dtrace error) "operator -> cannot be applied to a forward declaration ..."
Hi, This may be more suited to a general D mailing list, but - i''m trying to analyse LWP activity on a system, and faltering at the first hurdle. The lwp_create() call is prototyped as: klwp_t * lwp_create(void (*proc)(), caddr_t arg, size_t len, proc_t *p, int state, int pri, const k_sigset_t *smask, int cid, id_t lwpid) This is currently the only call i''m probing, but I am having trouble accessing the proc_t structure; specifically it''s members, such as p_ppid for instance. The error I am getting is: "operator -> cannot be applied to a forward declaration: no struct proc_t definition is available" .. and the code I have so far is: fbt:genunix:lwp_create:entry { self->ppid = ((struct proc_t *)arg3)->p_ppid; } Can anyone kindly shed some light on the errors with the cast please? Cheers Dan. -- This message posted from opensolaris.org
Danny Webster
2009-Jun-05 13:48 UTC
[dtrace-discuss] (dtrace error) "operator -> cannot be applied to a forward declaration ..."
Hi, This may be more suited to a general D mailing list, but - i''m trying to analyse LWP activity on a system, and faltering at the first hurdle. The lwp_create() call is prototyped as: klwp_t * lwp_create(void (*proc)(), caddr_t arg, size_t len, proc_t *p, int state, int pri, const k_sigset_t *smask, int cid, id_t lwpid) This is currently the only call i''m probing, but I am having trouble accessing the proc_t structure; specifically it''s members, such as p_ppid for instance. The error I am getting is: "operator -> cannot be applied to a forward declaration: no struct proc_t definition is available" .. and the code I have so far is: fbt:genunix:lwp_create:entry { self->ppid = ((struct proc_t *)arg3)->p_ppid; } Can anyone kindly shed some light on the errors with the cast please? Cheers Dan. -- This message posted from opensolaris.org
Adam Leventhal
2009-Jun-05 13:59 UTC
[dtrace-discuss] (dtrace error) "operator -> cannot be applied to a forward declaration ..."
> The error I am getting is: > > "operator -> cannot be applied to a forward declaration: no struct > proc_t definition is available"You need to use the same syntax as in C. This means either ''proc_t'' or ''struct proc''. Adam -- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Chad Mynhier
2009-Jun-05 14:03 UTC
[dtrace-discuss] (dtrace error) "operator -> cannot be applied to a forward declaration ..."
On Fri, Jun 5, 2009 at 9:48 AM, Danny Webster<dannywebster at gmail.com> wrote:> Hi, > > This may be more suited to a general D mailing list, but - i''m trying to analyse LWP activity on a system, and faltering at the first hurdle. The lwp_create() call is prototyped as: > > klwp_t * lwp_create(void (*proc)(), caddr_t arg, size_t len, proc_t *p, int state, int pri, const k_sigset_t *smask, int cid, id_t lwpid) > > This is currently the only call i''m probing, but I am having trouble accessing the proc_t structure; specifically it''s members, such as p_ppid for instance. > > The error I am getting is: > > "operator -> cannot be applied to a forward declaration: no struct proc_t definition is available" > > .. and the code I have so far is: > > fbt:genunix:lwp_create:entry > { > self->ppid = ((struct proc_t *)arg3)->p_ppid; > } > > Can anyone kindly shed some light on the errors with the cast please?It looks like the type of the argument is "proc_t *" and not "struct proc_t *". You might also try "args[3]", which gives you the typed argument. Chad
Danny Webster
2009-Jun-05 14:07 UTC
[dtrace-discuss] (dtrace error) "operator -> cannot be applied to a forward declaration ..."
Chad Mynhier replied to this - his suggestion was to use drop the "struct" from "struct proc_t *", which fixed the issue. Thanks Chad! -- This message posted from opensolaris.org