<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/test/python_api/value/linked_list/main.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>Move lldb/test to lldb/packages/Python/lldbsuite/test.</title>
<updated>2015-10-28T17:43:26+00:00</updated>
<author>
<name>Zachary Turner</name>
<email>zturner@google.com</email>
</author>
<published>2015-10-28T17:43:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c432c8f856e0bd84de980a9d9bb2d31b06fa95b1'/>
<id>c432c8f856e0bd84de980a9d9bb2d31b06fa95b1</id>
<content type='text'>
This is the conclusion of an effort to get LLDB's Python code
structured into a bona-fide Python package.  This has a number
of benefits, but most notably the ability to more easily share
Python code between different but related pieces of LLDB's Python
infrastructure (for example, `scripts` can now share code with
`test`).

llvm-svn: 251532
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the conclusion of an effort to get LLDB's Python code
structured into a bona-fide Python package.  This has a number
of benefits, but most notably the ability to more easily share
Python code between different but related pieces of LLDB's Python
infrastructure (for example, `scripts` can now share code with
`test`).

llvm-svn: 251532
</pre>
</div>
</content>
</entry>
<entry>
<title>Add logic to SBValue.linked_list_iter() to detect infinite loop and to bail out early.</title>
<updated>2011-08-11T01:19:46+00:00</updated>
<author>
<name>Johnny Chen</name>
<email>johnny.chen@apple.com</email>
</author>
<published>2011-08-11T01:19:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e1894cf97cc1f264ad3469e06f122cd8d995c3c8'/>
<id>e1894cf97cc1f264ad3469e06f122cd8d995c3c8</id>
<content type='text'>
Add code to test case to create an evil linked list with:

    task_evil -&gt; task_2 -&gt; task_3 -&gt; task_evil ...

and to check that the linked list iterator only iterates 3 times.

llvm-svn: 137291
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add code to test case to create an evil linked list with:

    task_evil -&gt; task_2 -&gt; task_3 -&gt; task_evil ...

and to check that the linked list iterator only iterates 3 times.

llvm-svn: 137291
</pre>
</div>
</content>
</entry>
<entry>
<title>Change the SBValue.linked_list_iter() to treat the value object as a homogeneous linked list data structure</title>
<updated>2011-08-11T00:49:03+00:00</updated>
<author>
<name>Johnny Chen</name>
<email>johnny.chen@apple.com</email>
</author>
<published>2011-08-11T00:49:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9c1b703ac45a04633ef612eb346b99120964ee53'/>
<id>9c1b703ac45a04633ef612eb346b99120964ee53</id>
<content type='text'>
where an empty linked list is represented as a value object with a NULL value, instead of a special value
object which 'points' to NULL.

Also modifies the test case to comply.

rdar://problem/9933692

llvm-svn: 137289
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
where an empty linked list is represented as a value object with a NULL value, instead of a special value
object which 'points' to NULL.

Also modifies the test case to comply.

rdar://problem/9933692

llvm-svn: 137289
</pre>
</div>
</content>
</entry>
<entry>
<title>The SBValue.linked_list_iter() API failed for an empty list.</title>
<updated>2011-07-27T21:14:01+00:00</updated>
<author>
<name>Johnny Chen</name>
<email>johnny.chen@apple.com</email>
</author>
<published>2011-07-27T21:14:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bfdf9a36d97932f14cceb58d2d0d712f6f1e9d6d'/>
<id>bfdf9a36d97932f14cceb58d2d0d712f6f1e9d6d</id>
<content type='text'>
Fix the bug and add a test case.

llvm-svn: 136265
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the bug and add a test case.

llvm-svn: 136265
</pre>
</div>
</content>
</entry>
<entry>
<title>Provide an add-on API to SBValue class by post-processing to provide a way</title>
<updated>2011-07-25T19:32:35+00:00</updated>
<author>
<name>Johnny Chen</name>
<email>johnny.chen@apple.com</email>
</author>
<published>2011-07-25T19:32:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=482250533847640bb98500e04ba6af3bb968228a'/>
<id>482250533847640bb98500e04ba6af3bb968228a</id>
<content type='text'>
to iterate through an SBValue instance by treating it as the head of a linked
list.  API program must provide two args to the linked_list_iter() method:
the first being the child member name which points to the next item on the list
and the second being a Python function which an SBValue (for the next item) and
returns True if end of list is reached, otherwise it returns False.

For example, suppose we have the following sample program.

#include &lt;stdio.h&gt;

class Task {
public:
    int id;
    Task *next;
    Task(int i, Task *n):
        id(i),
        next(n)
    {}
};


int main (int argc, char const *argv[])
{
    Task *task_head = new Task(-1, NULL);
    Task *task1 = new Task(1, NULL);
    Task *task2 = new Task(2, NULL);
    Task *task3 = new Task(3, NULL); // Orphaned.
    Task *task4 = new Task(4, NULL);
    Task *task5 = new Task(5, NULL);

    task_head-&gt;next = task1;
    task1-&gt;next = task2;
    task2-&gt;next = task4;
    task4-&gt;next = task5;

    int total = 0; // Break at this line
    Task *t = task_head;
    while (t != NULL) {
        if (t-&gt;id &gt;= 0)
            ++total;
        t = t-&gt;next;
    }
    printf("We have a total number of %d tasks\n", total);
    return 0;
}

The test program produces the following output while exercising the linked_list_iter() SBVAlue API:

task_head:
	TypeName      -&gt; Task *
	ByteSize      -&gt; 8
	NumChildren   -&gt; 2
	Value         -&gt; 0x0000000106400380
	ValueType     -&gt; local_variable
	Summary       -&gt; None
	IsPointerType -&gt; True
	Location      -&gt; 0x00007fff65f06e60
(Task *) next = 0x0000000106400390
  (int) id = 1
  (Task *) next = 0x00000001064003a0

(Task *) next = 0x00000001064003a0
  (int) id = 2
  (Task *) next = 0x00000001064003c0

(Task *) next = 0x00000001064003c0
  (int) id = 4
  (Task *) next = 0x00000001064003d0

(Task *) next = 0x00000001064003d0
  (int) id = 5
  (Task *) next = 0x0000000000000000

llvm-svn: 135938
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to iterate through an SBValue instance by treating it as the head of a linked
list.  API program must provide two args to the linked_list_iter() method:
the first being the child member name which points to the next item on the list
and the second being a Python function which an SBValue (for the next item) and
returns True if end of list is reached, otherwise it returns False.

For example, suppose we have the following sample program.

#include &lt;stdio.h&gt;

class Task {
public:
    int id;
    Task *next;
    Task(int i, Task *n):
        id(i),
        next(n)
    {}
};


int main (int argc, char const *argv[])
{
    Task *task_head = new Task(-1, NULL);
    Task *task1 = new Task(1, NULL);
    Task *task2 = new Task(2, NULL);
    Task *task3 = new Task(3, NULL); // Orphaned.
    Task *task4 = new Task(4, NULL);
    Task *task5 = new Task(5, NULL);

    task_head-&gt;next = task1;
    task1-&gt;next = task2;
    task2-&gt;next = task4;
    task4-&gt;next = task5;

    int total = 0; // Break at this line
    Task *t = task_head;
    while (t != NULL) {
        if (t-&gt;id &gt;= 0)
            ++total;
        t = t-&gt;next;
    }
    printf("We have a total number of %d tasks\n", total);
    return 0;
}

The test program produces the following output while exercising the linked_list_iter() SBVAlue API:

task_head:
	TypeName      -&gt; Task *
	ByteSize      -&gt; 8
	NumChildren   -&gt; 2
	Value         -&gt; 0x0000000106400380
	ValueType     -&gt; local_variable
	Summary       -&gt; None
	IsPointerType -&gt; True
	Location      -&gt; 0x00007fff65f06e60
(Task *) next = 0x0000000106400390
  (int) id = 1
  (Task *) next = 0x00000001064003a0

(Task *) next = 0x00000001064003a0
  (int) id = 2
  (Task *) next = 0x00000001064003c0

(Task *) next = 0x00000001064003c0
  (int) id = 4
  (Task *) next = 0x00000001064003d0

(Task *) next = 0x00000001064003d0
  (int) id = 5
  (Task *) next = 0x0000000000000000

llvm-svn: 135938
</pre>
</div>
</content>
</entry>
</feed>
