Lines Matching refs:dictionary
20 We have a simple C program (dictionary.c) that reads in a text file,
39 $ ./dictionary Romeo-and-Juliet.txt
116 `SBFrame.FindVariable` on the lldb.frame object to give us our dictionary
121 root = lldb.frame.FindVariable ("dictionary")
124 current frame to find the variable named "dictionary" and return it. We then
182 is in our tree or not. To actually use it in LLDB on our dictionary program,
188 (lldb) process attach -n "dictionary"
198 * thread #1: tid = 0x2c03, 0x0000000100001830 dictionary`find_word + 16
199 at dictionary.c:105, stop reason = breakpoint 1.1
200 frame #0: 0x0000000100001830 dictionary`find_word + 16 at dictionary.c:105
202 103 find_word (tree_node *dictionary, char *word)
204 -> 105 if (!word || !dictionary)
207 108 int compare_value = strcmp (word, dictionary->word);
211 >>> root = lldb.frame.FindVariable ("dictionary")
219 The first bit of code above shows starting lldb, attaching to the dictionary
237 root = lldb.frame.FindVariable ("dictionary")
240 gets our program variable "dictionary" (which contains the binary search tree)
383 File: /Volumes/Data/HD2/carolinetice/Desktop/LLDB-Web-Examples/dictionary.c.
386 103 find_word (tree_node *dictionary, char *word)
388 105 if (!word || !dictionary)
391 108 int compare_value = strcmp (word, dictionary->word);
396 113 return find_word (dictionary->left, word);
398 115 return find_word (dictionary->right, word);
408 Breakpoint created: 2: file ='dictionary.c', line = 113, locations = 1, resolved = 1
410 Breakpoint created: 3: file ='dictionary.c', line = 115, locations = 1, resolved = 1
437 …* thread #1: tid = 0x2d03, 0x000000010000189f dictionary`find_word + 127 at dictionary.c:115, stop…
438 frame #0: 0x000000010000189f dictionary`find_word + 127 at dictionary.c:115
440 113 return find_word (dictionary->left, word);
442 -> 115 return find_word (dictionary->right, word);
458 (lldb) expr dictionary->word
479 (lldb) expr dictionary->left->left->right->right->left->word
511 dictionary.c. These functions contain calls to LLDB API
516 for more information about dictionary.c go to
531 the one defined in dictionary.c It uses LLDB API
582 the one defined in dictionary.c It uses LLDB API
605 the one defined in dictionary.c It uses LLDB API
619 dictionary.c - Sample dictionary program, with bug
623 //===-- dictionary.c ---------------------------------------------*- C -*-===//
704 void populate_dictionary(tree_node **dictionary, char *filename) {
713 if (*dictionary == NULL) {
718 *dictionary = new_node;
720 insert(*dictionary, new_word);
728 int find_word(tree_node *dictionary, char *word) {
729 if (!word || !dictionary)
732 int compare_value = strcmp(word, dictionary->word);
737 return find_word(dictionary->left, word);
739 return find_word(dictionary->right, word);
744 void print_tree(tree_node *dictionary) {
745 if (!dictionary)
748 if (dictionary->left)
749 print_tree(dictionary->left);
751 printf("%s\n", dictionary->word);
753 if (dictionary->right)
754 print_tree(dictionary->right);
758 tree_node *dictionary = NULL;
769 populate_dictionary(&dictionary, filename);
784 if (find_word(dictionary, word))