1    /* 
     2     *  Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     * 
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     * 
    11     * */
    12    package xdc.rov
    13    
    14    /*!
    15     *  ======== ICallStack ========
    16     *  A call stack interface (optionally) implementated by ROV servers
    17     *
    18     *  Instances of this interface maintain a "local" set of processor
    19     *  registers sufficient to enable call stack parsing - walking up the C
    20     *  callstack and determining all nested calls up to the current program
    21     *  counter (specified by the local registers).  This "local" set of
    22     *  registers is, of course, processor specific and must include both
    23     *  the program counter ("PC") and a frame pointer (processor-specific
    24     *  register name).
    25     */
    26    metaonly interface ICallStack {
    27    
    28    instance:
    29        /*
    30         *  ======== clearRegisters ========
    31         *  Clear all local register values
    32         */
    33        Void clearRegisters();
    34    
    35        /*
    36         *  ======== fetchRegisters ========
    37         *  Fetch the current values of the specified registers
    38         *
    39         *  This method reads the current value of the registers from the device
    40         *  (or core dump file or ...) and sets the local register set
    41         *  accordingly.  For example, if the frame pointer register is named
    42         *  "FP" the following sequence should produce a stack trace:
    43         *  @p(code)
    44         *      callstack.fetch(["PC", "FP"]);
    45         *      print(callstack.toText());
    46         *  @p
    47         */
    48        Void fetchRegisters(String names[]);
    49    
    50        /*
    51         *  ======== getRegister ========
    52         *  Get the local value of the named register
    53         */
    54        Long getRegister(String name);
    55    
    56        /*
    57         *  ======== setRegister ========
    58         *  Set the local value of the named register
    59         */
    60        Void setRegister(String name, Long value);
    61    
    62        /*
    63         *  ======== toText ========
    64         *  Return entire call stack as a string
    65         *  
    66         *  Create a string representation of the current call stack based
    67         *  on the currently set register values.
    68         */
    69        String toText();
    70    }
    71    
    72    /*
    73     *  @(#) xdc.rov; 1, 0, 1,0; 8-8-2017 17:30:39; /db/ztree/library/trees/xdc/xdc-D20/src/packages/
    74     */
    75