In This Book

For example, assume that C is the current language and that char_ptr points to the ￿rst element in the string success :

print char_ptr

\\test_program\main\char_ptr: 7B03A541

*\\test_program\main\char_ptr: "success" print *char_ptr *\\test_program\main\char_ptr: 's'

Instead of using language-sp eci￿c syntax, you can use the -indirectoption to

 

the print command as follows:

4

-indirect all

Follow all pointers encountered and show the value of

 

 

the object pointed to.

 

-indirect count

Follow pointers no further than count levels.

 

-indirect

Follow pointers one level.

 

Examining Linked Lists

Use the print command's -indirectoption to examine linked lists.

Enter -indirect count to print a speci￿c number of records in a linked list. For example, the following command prints the record pointed to by first_item , as well as the next record in the linked list:

print first_item -indirect 2 \\main\first_item: 00088000 *\\main\first_item: (record)

\\main\first_item->item_text: "Class"

\\main\first_item->font: "<F21>"

\\main\first_item->next: 00088C00

*\\main\first_item->next: (record)

\\main\first_item->next->item_text: "Type"

\\main\first_item->next->font: "<F21>"

\\main\first_item->next->next: 00089800

To print an entire linked list you could specify -indirect all . But if the linked list is large, the output ma y become unwieldy, since every link to each record is shown.

Viewing and Manipulating Target Program Data 4-7