list - Information listings from MULTI

Syntax

list(ff,varname)
infolist = list(id,'type')
infolist = list(id,'type',typename)

Description

list(ff,varname) lists the local variables associated with the function accessed by function object ff. Compare to list(id,'variable','varname') which works the same way to return variables from object id.

Some restrictions apply when you use list with function objects. list generates an error in the following circumstances:

infolist = list(id,type) reads information about your MULTI project and returns it in infolist. Different types of information and return formats are possible depending on the input arguments you supply to the list function call. The type argument specifies which information listing to return. To determine the information that list returns, use one of the following as the type parameter string:

Note, list returns dynamic MULTI information that you can alter. Returned listings represent snapshots of the current MULTI IDE configuration only. Be aware that earlier copies of infolist might contain stale information.

Also, list may report incorrect information when you make changes to variables from MATLAB. To report variable information, list uses the MULTI API, which only knows about variables in MULTI. Your changes from MATLAB, such as changing the data type of a variable, do not appear through the API and list. For example, the following operations return incorrect or old data information from list.

infolist = list(id,'project') returns a vector of structures containing project information in the format shown here when you specify option type as project.

infolist Structure ElementDescription

infolist(1).name

Project file name (with path).

infolist(1).type

Project type — project,projlib, or projext, refer to new

infolist(1).targettype

String description of target CPU

infolist(1).srcfiles

Vector of structures that describes project source files. Each structure contains the name and path for each source file — infolist(1).srcfiles.name

infolist(1).buildcfg

Vector of structures that describe build configurations, each with the following entries:

  • infolist(1).buildcfg.name — the build configuration name

  • infolist(1).buildcfg.outpath — the default directory for storing the build output.

infolist(2)....

...

infolist(n)....

...

infolist = list(id,'variable') returns a structure of structures that contains information on all local variables within scope. The list also includes information on all global variables. Note, however, that if a local variable has the same symbol name as a global variable, list returns the information about the local variable.

infolist = list(id,'variable',varname) returns information about the specified variable varname.

infolist = list(id,'variable',varnamelist) returns information about variables in a list specified by varnamelist. The information returned in each structure follows the format below when you specify option type as variable:

infolist Structure ElementDescription

infolist.varname(1).name

Symbol name.

infolist.varname(1).isglobal

Indicates whether symbol is global or local.

infolist.varname(1).location

Information about the location of the symbol.

infolist.varname(1).size

Size per dimension.

infolist.varname(1).uclass

ghsmulti object class that matches the type of this symbol.

infolist.varname(1).bitsize

Size in bits. More information is added to the structure depending on the symbol type.

infolist.(varname1).type

Data type of symbol.

infolist.varname(2)....

...

infolist.varname(n)....

...

list uses the variable name as the field name to refer to the structure information for the variable.

infolist = list(id,'globalvar') returns a structure that contains information on all global variables.

infolist = list(id,'globalvar',varname) returns a structure that contains information on the specified global variable.

infolist = list(id,'globalvar',varnamelist) returns a structure that contains information on global variables in the list. The returned information follows the same format as the syntax infolist = list(id,'variable',...).

infolist = list(id,'function') returns a structure that contains information on all functions in the embedded program.

infolist = list(id,'function',functionname) returns a structure that contains information on the specified function functionname.

infolist = list(id,'function',functionnamelist) returns a structure that contains information on the specified functions in functionnamelist. The returned information follows the format below when you specify option type as function:

infolist Structure ElementDescription

infolist.functionname(1).name

Function name

infolist.functionname(1).filename

Name of file where function is defined

infolist.functionname(1).address

Relevant address information such as start address and end address

infolist.functionname(1).funcvar

Variables local to the function

infolist.functionname(1).uclass

ghsmulti object class that matches the type of this symbol — function

infolist.functionname(1).funcdecl

Function declaration — where information such as the function return type is contained

infolist.functionname(1).islibfunc

Is this a library function?

infolist.functionname(1).linepos

Start and end line positions of function

infolist.functionname(1).funcinfo

Miscellaneous information about the function

infolist.functionname(2)...

...

infolist.functionname(n)...

...

To refer to the function structure information, list uses the function name as the field name.

infolist = list(id,'type') returns a structure that contains information on all defined data types in the embedded program. This method includes struct, enum and union data types and excludes typedefs. The name of a defined type is its C struct tag, enum tag or union tag. If the C tag is not defined, it is referred to by the MULTI compiler as '$faken' where n is an assigned number.

infolist = list(id,'type',typename) returns a structure that contains information on the specified defined data type.

infolist = list(id,'type',typenamelist) returns a structure that contains information on the specified defined data types in the list. The returned information follows the format below when you specify option type as type:

infolist Structure ElementDescription

infolist.typename(1).type

Type name

infolist.typename(1).size

Size of this type

infolist.typename(1).uclass

ghsmulti object class that matches the type of this symbol. Additional information is added depending on the type

infolist.typename(2)....

...

infolist.typename(n)....

...

For the field name, list uses the type name to refer to the type structure information.

The following list provides important information about variable and field names:

Examples

This first example shows list used with a variable, providing information about the variable varname. Notice that the invalid field name _with_underscore gets changed to Q_with_underscore. To make the invalid name valid, list inserts the character Q before the name.

varname1 = '_with_underscore'; % invalid fieldname
list(id,'variable',varname1);
ans =

    Q_with_underscore : [varinfo]
ans. Q_with_underscore 
ans=

       name: '_with_underscore'
   isglobal: 0
   location: [1x62 char]
       size: 1
     uclass: 'numeric'
       type: 'int' 
    bitsize: 16 

To demonstrate using list with a defined C type, variable typename1 includes the type argument. Because valid field names cannot contain the $ character, list changes the $ to DOLLAR.

typename1 = '$fake3'; % name of defined C type with no tag 
list(id,'type',typename1);            
ans =

       DOLLARfake0 : [typeinfo]    

ans.DOLLARfake0=
                 
        type: 'struct $fake0'       
        size: 1     
      uclass: 'structure'     
      sizeof: 1    
     members: [1x1 struct]

When you request information about a project in MULTI, you see a listing like the following that includes structures containing details about your project.

projectinfo=list(id,'project')

projectinfo = 

          name: 'D:\Work\c6711dskafxr_c6000_rtw\c6711dskafxr.pjt'
          type: 'project'
    targettype: 'TMS320C67XX'
      srcfiles: [69x1 struct]
      buildcfg: [3x1 struct]

See Also

info

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS