dsdp/tm/tcf_0_3_x/org.eclipse.tm.tcf.docs/TCF Context Identifier Explanation.html
author dadubrow
Thu, 05 Aug 2010 13:18:02 -0500
changeset 145 d9692fb089a1
parent 70 11a6943ebeb2
permissions -rw-r--r--
not shipping pulsar plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
70
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     2
<HTML>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     3
<HEAD>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     4
        <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1251">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     5
        <TITLE>TCF Context Identifier Explanation</TITLE>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     6
        <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.2  (Win32)">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     7
        <META NAME="CREATED" CONTENT="20070830;12134342">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     8
        <META NAME="CHANGEDBY" CONTENT="Eugene Tarassov">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
     9
        <META NAME="CHANGED" CONTENT="20070830;12351368">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    10
        <STYLE TYPE="text/css">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    11
        <!--
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    12
                H1 { color: #000000 }
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    13
                P { color: #000000 }
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    14
                P.western { font-size: 13pt }
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    15
                H2 { color: #000000 }
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    16
        -->
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    17
        </STYLE>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    18
</HEAD>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    19
<BODY LANG="en-US" TEXT="#000000" DIR="LTR">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    20
<P CLASS="western" STYLE="border-top: none; border-bottom: 1.00pt solid #4f81bd; border-left: none; border-right: none; padding-top: 0in; padding-bottom: 0.06in; padding-left: 0in; padding-right: 0in">
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    21
<FONT COLOR="#17365d"><FONT FACE="Cambria"><FONT SIZE=6 STYLE="font-size: 26pt">TCF
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    22
Context Identifier Explanation</FONT></FONT></FONT></P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    23
<P CLASS="western"><FONT COLOR="#4f81bd"><FONT FACE="Cambria"><FONT SIZE=3><I>Felix
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    24
Burton, Wind River, Version 2</I></FONT></FONT></FONT></P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    25
<H1><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Introduction</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    26
<P CLASS="western">Most if not all TCF services functions need some
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    27
way to identify what entity e.g. process, thread, task, semaphore,
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    28
breakpoint, flash device, device on JTAG scan chain, etc they should
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    29
operate on. To do this TCF uses a context identifier (aka ContextId).
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    30
This document is attempting to explain how ContextIds are intended to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    31
be used. This is document does not define actual services or exact
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    32
context hierarchies, but for the purpose of making things more
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    33
concrete examples may be used.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    34
<H2 LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.04in"><FONT COLOR="#4f81bd"><FONT FACE="Cambria"><FONT SIZE=3 STYLE="font-size: 13pt"><B>Why
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    35
a single ContextId?</B></FONT></FONT></FONT></H2>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    36
<P CLASS="western">A prudent question to ask is why use a single
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    37
ContextId instead of having separate IDs for each notion e.g. a
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    38
ProcessId, ThreadId, BreakpointId, JTAGDeviceId, etc. Having separate
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    39
IDs is used in many existing debug APIs and protocols and may seem
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    40
intuitive. However, there are several issues with this approach:</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    41
<P CLASS="western">1. It is inflexible in that it requires each
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    42
function to upfront know how many levels are needed and what type of
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    43
context each level represent.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    44
<P CLASS="western">2. This in turn makes it difficult to use the same
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    45
API for different environments since they often have different types
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    46
of IDs and has different number of levels. For example Linux have
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    47
processes and threads while OCD have cores.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    48
<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Context
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    49
identifier</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    50
<P CLASS="western">ContextIds are opaque handles that only have
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    51
meaning to the service that created them or its peer services. They
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    52
are created for clients, by service implementations to identify some
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    53
entity handled by the services. Clients can use contextIds in the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    54
following ways:</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    55
<P CLASS="western">1. Pass to the originating service or peer
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    56
services</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    57
<P CLASS="western">2. Compare for equality with other contextIds
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    58
retrieved from the originating service or peer services.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    59
<P CLASS="western">More specifically, clients should not try to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    60
decode or extract information from the contextId, instead they should
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    61
make requests to the originating service or peer services using the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    62
contextId for information or action.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    63
<P CLASS="western">As can be seen from the above, contextIds created
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    64
by one service can be used by its peer services. The service should
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    65
either to do something useful or to give an error indicating that the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    66
contextId is not relevant to that particular service. To guarantee
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    67
that a contextId created by service A and passed to service B is not
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    68
misinterpreted to be something other that what service A intended,
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    69
there must be a global naming scheme for contextId within a target.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    70
<P CLASS="western">This allows two or more services to create the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    71
same contextId when they operate on the same entity. It means that a
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    72
single contextId can have multiple aspects that are handled by
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    73
different services, thereby allowing decoupling of service
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    74
interfaces.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    75
<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Context
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    76
hierarchies</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    77
<P CLASS="western">Entities represented by contextIds typically
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    78
relate to similar entities in a list or parent/child relationship.
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    79
Examples, 1) Linux processes have children threads, 2) a suspended
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    80
thread has a list of stack frames, and 3) threads have register
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    81
groups which have registers which can have fields. These
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    82
relationships form context hierarchies.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    83
<P CLASS="western">Depending on the system there may be several
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    84
different context hierarchies. For example contexts available for
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    85
JTAG debugging include:</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    86
<P CLASS="western">1. debugging</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    87
<P CLASS="western">2. memory access</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    88
<P CLASS="western">3. register access</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    89
<P CLASS="western">4. JTAG access</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    90
<P CLASS="western">Interestingly there may also be relations between
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    91
the different hierarchies. For example contexts available for
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    92
debugging may correspond with contexts available for memory access. A
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    93
typical example of this is Linux where a contextId representing a
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    94
process can be used for debugging as well as memory access, open file
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    95
table access, memory map access, etc. In such cases, the same
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    96
contextId should be used in all hierarchies. This allows clients to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    97
detect when hierarchies come together or split apart so the client
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    98
can represent the relationships properly to the user for example in a
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
    99
GUI.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   100
<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Accessing
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   101
context information</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   102
<P CLASS="western">Information associated with a contextId can be
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   103
sufficiently large to make it impractical to transfer all associated
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   104
information to the client in a single request. To reduce the amount
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   105
of information transferred while still allowing the implementation to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   106
be relatively simple; the information is categorized as follows:</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   107
<P CLASS="western">1. Child context references per service</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   108
<P CLASS="western">2. Slow changing properties per service, a.k.a.
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   109
properties</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   110
<P CLASS="western">3. Fast changing properties per service, a.k.a.
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   111
state or status 
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   112
</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   113
<P CLASS="western">Category 1 provides a simple way to express
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   114
unbounded lists of related contextIds. If such a list becomes too
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   115
large the service can split the list into a list of lists, list of
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   116
lists or lists, etc as needed.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   117
<P CLASS="western">Category 2 and 3 provides a simple way to express
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   118
arbitrary information about the context in the form of a key/value
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   119
pair. Properties may also contain contextId references for example
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   120
for the parent context.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   121
<P CLASS="western">The split between category 2 and 3 allows the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   122
service to handle fast changing information in a more optimal way and
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   123
allows it to handle slow changing information in a more simple way.
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   124
It is up to the service to define what information is slow vs. fast
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   125
changing.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   126
<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>ContextId
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   127
formatting</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   128
<P CLASS="western">The ContextId is represented as string between
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   129
clients and services. The formatting of the string with one exception
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   130
is completely up to the implementation that created the contextId.
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   131
The exception is the ContextId prefix explained below. The remainder
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   132
of the string can be formatted in any way that the service descries.
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   133
Two typical ways comes to mind:</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   134
<P CLASS="western">1. Hierarchical list where each level is spelled
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   135
out. For example on Linux:</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   136
<P CLASS="western" STYLE="margin-left: 0.79in">a. A process could be
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   137
identified by &ldquo;ppid&rdquo; and a thread by &ldquo;ppid,ttid&rdquo;</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   138
<P CLASS="western" STYLE="margin-left: 0.79in">b. A register set by
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   139
&ldquo;ppid,ttid,rset&rdquo;</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   140
<P CLASS="western" STYLE="margin-left: 0.79in">c. A stack frame by
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   141
&ldquo;ppid,ttid,slevel&rdquo;</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   142
<P CLASS="western" STYLE="margin-left: 0.79in">d. A local variable on
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   143
a specific stack level by &ldquo;ppid,ttid,slevel,vname&rdquo;</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   144
<P CLASS="western">2. Flat ID that the generating service used to do
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   145
table lookup for more information. For example</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   146
<P CLASS="western" STYLE="margin-left: 0.79in">a. Index into an array
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   147
&ldquo;tableIndex,generationNumber&rdquo;</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   148
<P CLASS="western" STYLE="margin-left: 0.79in">b. Key used for hash
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   149
lookup &ldquo;sequentialNumber&rdquo;</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   150
<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>ContextId
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   151
prefix</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   152
<P CLASS="western">When information from more than one channel is
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   153
joined together to when value-adding services between the two
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   154
endpoints create contextIds it must be possible to for every service
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   155
to determine if a contextId was created by it or a foreign entity. To
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   156
do this, each service manager is assigned a unique contextId prefix
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   157
that all its generated contextIds should be prefixed with followed by
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   158
the colon (:) character. For example imagine that GDB was designed to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   159
be a value-adding service, contextIds created on this level could be
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   160
prefixed by &ldquo;gdb:&rdquo; to guarantee that the target would be
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   161
able to return error if such contextId was given to it instead of to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   162
the services in GDB.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   163
<P CLASS="western">The prefix used by a service manager is
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   164
dynamically assigned by the client initiating the connection. A
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   165
limited TCF endpoint implementation is not required to support
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   166
contextId prefixing. However, in such case it is only be possible to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   167
have value-adding services if they intercept all services on the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   168
endpoint.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   169
<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Context
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   170
information caching</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   171
<P CLASS="western">Clients will most likely need to cache context
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   172
information in order to keep the amount of information transferred to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   173
a minimum. Such caching should be based on the contextId, service
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   174
name, and type of data i.e. children contextIds, properties or state.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   175
<P CLASS="western">The suggested implementation is to use a two stage
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   176
cache lookup, where the first stage is using only the contextId and
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   177
the second stage using the service name and the type of data. The
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   178
reason for the two stage approach is to allow easy flushing of the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   179
cached information when contextIds are removed.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   180
<P CLASS="western">Services support caching in clients by sending
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   181
events for any changes to the information. The following events are
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   182
expected to be generated by services when needed:</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   183
<P CLASS="western">1. Children added. The event includes the parent
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   184
contextId, service name and list of contextIds and their properties
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   185
to be added to the cache. Clients that have not populated the cache
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   186
for the specified parent contextId should ignore this event.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   187
<P CLASS="western">2. Children removed. The event includes the parent
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   188
contextId, service name and list of contextIds to be removed from the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   189
list. When received, clients should update cache by removing all
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   190
listed contextIds for the specified parent contextId and service
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   191
name.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   192
<P CLASS="western">3. Children changed. The event includes the parent
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   193
contextId and service name. This event does not include the updated
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   194
list of contextIds; instead clients are expected to reread the list
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   195
of children if they need it. When received, clients should invalidate
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   196
the list of children contextIds for the specified parent contextId
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   197
and service name.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   198
<P CLASS="western">4. Properties changed. This event includes a list
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   199
of contextId, service name and properties. When received, clients
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   200
should update cache with the new properties.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   201
<P CLASS="western">5. State or status changed. This event includes
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   202
contextId, service name and state or status. When received, clients
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   203
should update cache with the new state or status.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   204
<P CLASS="western">Invalidating or removing entries from the list of
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   205
children contextIds should also result in recursively invalidating
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   206
all cache entries for the removed contextIds. This is necessary to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   207
avoid stale cache entries to linger when a removed contextId is
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   208
reused for a new context.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   209
<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Relationship
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   210
between services</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   211
<P CLASS="western">Even though service interfaces should not have any
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   212
direct dependencies, they can have context hierarchy relationships.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   213
<P CLASS="western">A good example of such relationship is between the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   214
&ldquo;run control&rdquo; service and the &ldquo;memory&rdquo;
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   215
service. It seems to make sense to specify that the run control
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   216
hierarchy is &ldquo;rooted&rdquo; in the memory hierarchy since it is
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   217
hard to imagine executing instructions without a memory that stores
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   218
the instructions.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   219
<P CLASS="western">Another example is for run control, register and
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   220
stack trace services where it seems logical to define registers and
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   221
stack frame hierarchies to be &ldquo;rooted&rdquo; in the run control
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   222
hierarchy.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   223
<P CLASS="western">By &ldquo;rooted&rdquo; we mean that roots for one
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   224
hierarchy can be found in another hierarchy.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   225
<P CLASS="western">Usually clients need only one particular hierarchy
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   226
at the time, however some clients, for example in Eclipse the Debug
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   227
View is designed to be provide selection for run control, memory
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   228
view, locals view, registers view, etc in one place, so it needs to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   229
merge memory, run control and stack trace hierarchies in order to
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   230
provide single tree for selection.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   231
<P CLASS="western">The services interface specification should define
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   232
the rooting of its context hierarchy, if any. As mentioned in the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   233
example above, run control service is rooted in the memory hierarchy,
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   234
and register and stack trace services are rooted in the run control
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   235
hierarchy.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   236
<P CLASS="western">It may be possible to a service context hierarchy
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   237
to be rooted in multiple hierarchies.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   238
<P CLASS="western">Which context hierarchies are merged is up to the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   239
implementer of the client.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   240
<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Context
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   241
hierarchy roots</B></FONT></FONT></FONT></H1>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   242
<P CLASS="western">For some services it is possible to use &ldquo;null&rdquo;
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   243
as a special parent contextId to the &ldquo;get children&rdquo;
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   244
command to retrieve a list of root contextIds. The service interface
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   245
definition should specify if retrieval of roots is supported by the
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   246
service.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   247
<P CLASS="western">Example services that would support the &ldquo;null&rdquo;
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   248
parent contextId are JTAG access and kernel awareness services since
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   249
this is global information in the target.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   250
<P CLASS="western">Example services that would not support the &ldquo;null&rdquo;
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   251
parent contextId are register and stack trace services since parent
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   252
contextId for registers and stack frames is usual obtained through
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   253
run control service.</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   254
<P CLASS="western"><BR><BR>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   255
</P>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   256
</BODY>
11a6943ebeb2 add dsdp/tm/tcf_0_3_x
duane.cawthron@nokia.com
parents:
diff changeset
   257
</HTML>