OpenSolaris

You are not signed in. Sign in or register.

Heads up: forthdebug changes

Date: Wed, 7 Sep 2005 13:51:50 -0700
From: Keith M Wesolowski <keith dot wesolowski at sun dot com>
To: onnv-gate at onnv dot eng dot sun dot com, on-all at sun dot com
Subject: Heads up: forthdebug changes

If you don't change the kernel, or drivers that are built on SPARC,
you can ignore this message.

The forthdebug modules used for OBP-level debugging on SPARC platforms
are built from templates; these templates contain forth code and lists
of kernel data types.  These types will have forth code generated so
that they can be displayed in OBP as they are by other debuggers such
as mdb.

With my putback for

        6254394 ctfstabs should replace stabs

maintenance of the forthdebug templates is now partially enforced by
the build.  If you change any of the kernel data structures
corresponding to entries the forthdebug templates located in
uts/sun4,4u,4v/forthdebug, you must update the template as well.  If
you remove a structure or member from the kernel but do not remove it
from the template, the forthdebug build will fail with errors like:

  ctfstabs: Line 30: Invalid member mem_node_conf.cursize
  ctfstabs: Line 30: Error found: skipping to the next blank line
  *** Error code 1
  dmake: Warning: Command failed for target `obj64/memnode.fth'

Because of the way forthdebug templates are preprocessed, there are
two caveats to heed when adding new structures or members.
Previously, templates that disregarded these rules would silently fail
to include the intended information; now they will cause build
failure:

1. Preprocessor shortcuts for substructure members cannot be used.
Instead, define the substructure separately in the template.  For
example:

        --- WRONG ---

        _kthread
                ...
                t_wchan0        x
                t_wchan         x
                ...

        --- RIGHT ---

        lwpchan_t

        _kthread
                ...
                t_lwpchan       .lwpchan_t
                ...

2. If a structure contains different members depending on the values
of preprocessing tokens, that structure's template entry must include
either no explicit list of members or only those whose presence is
unconditional.

More information about the forthdebug template format can be found in
the comments at the beginning of tools/ctf/stabs/common/forth.c.

-- 
Keith M Wesolowski		"Sir, we're surrounded!" 
Solaris Kernel Team		"Excellent; we can attack in any direction!"