Motr  M0
M0ListPrint Class Reference
Inheritance diagram for M0ListPrint:
Inheritance graph
Collaboration diagram for M0ListPrint:
Collaboration graph

Public Member Functions

def __init__ (self)
 
def invoke (self, arg, from_tty)
 
def get_head (self, argv)
 
def get_offset (self, argv)
 

Detailed Description

Prints m0_list/m0_tl elements.

Usage: m0-list-print [&]list [[struct|union] tag link [visit|"in-detail"]]

First argument is only mandatory argument. It can be of type
- struct m0_list or struct m0_list *,
- struct m0_tl or struct m0_tl *
If this is the only argument supplied, then m0-list-print prints
address of each of links forming the list.
Example:
(gdb) m0-list-print session->s_slot_table[0]->sl_item_list
0x6257d0
0x7fffd80009d0
Total: 2

Later three arguments can be either all present or all absent.
The three arguments together specify name of link field
within ambient object. This form of m0-list-print prints pointers to
ambient objects.
Example:
(gdb) m0-list-print session->s_slot_table[0]->sl_item_list struct m0_rpc_item ri_slot_refs[0].sr_link
0x6256e0
0x7fffd80008e0
Total: 2

The last parameter is optional, if present controls how the elements
are displayed:
- If the last parameter == "in-detail", then it prints all the contents of
  ambient objects(not addreses) of the list
- Otherwise the last argument 'visit' if present is name of a user-defined command
  that takes one argument(think m0-list-print as a list traversing function
  with pointer to 'visit' function as arguemnt).
  The visit command will be executed for each object in list.
  The implementation of visit command can decide which objects to print and how.
Example:
(gdb) m0-list-print fop_types_list struct m0_fop_type ft_linkage in-detail
<Prints all m0_fop_type objects from fop_types_list>

(gdb) define session_visit
>set $s = (struct m0_rpc_session *)$arg0
>printf "session %p id %lu state %d\\n", $s, $s->s_session_id, $s->s_state
>end
(gdb) m0-list-print session->s_conn->c_sessions struct m0_rpc_session s_link session_visit
session 0x604c60 id 191837184000000002 state 4
session 0x624e50 id 0 state 4
Total: 2
(gdb) m0-list-print session->s_conn->c_sessions struct m0_rpc_session s_link
0x604c60
0x624e50
Total: 2

Definition at line 74 of file gdb-extensions.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Definition at line 127 of file gdb-extensions.py.

Member Function Documentation

◆ get_head()

def get_head (   self,
  argv 
)

Definition at line 168 of file gdb-extensions.py.

Here is the caller graph for this function:

◆ get_offset()

def get_offset (   self,
  argv 
)

Definition at line 188 of file gdb-extensions.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invoke()

def invoke (   self,
  arg,
  from_tty 
)

Definition at line 131 of file gdb-extensions.py.

Here is the call graph for this function:

The documentation for this class was generated from the following file: