View difference between Paste ID: jqMtJT7K and pz4Qz6RP
SHOW: | | - or go back to the newest paste.
1
(lldb) r
2-
There is a running process, kill it and restart?: [Y/n] y
2+
Process 17536 launched: './queueTest1' (x86_64)
3-
Process 15721 exited with status = 9 (0x00000009)
3+
4-
Process 17478 launched: './queueTest1' (x86_64)
4+
Inserting:  42: first insert
5
 17: first 17 42
6-
Process 17478 stopped
6+
{
7-
* thread #1: tid = 0x7b20a, 0x0000000100000a1e queueTest1`que_insert(queue=0x00000001001039b0, data=0x000000000000002a) + 62 at queueADT.c:62, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
7+
  next: 42,
8-
    frame #0: 0x0000000100000a1e queueTest1`que_insert(queue=0x00000001001039b0, data=0x000000000000002a) + 62 at queueADT.c:62
8+
  prev: NULL
9-
   59  	    n = malloc(sizeof(n));
9+
}
10-
   60  	    n->next = NULL;
10+
11-
   61  	    n->previous = NULL;
11+
insert success
12-
-> 62  	    n->data = data;
12+
 -12: first -12 4296030752
13-
   63
13+
{
14-
   64  	    // if compare function doesn't exist, place in front of queue
14+
  next: 4296030752,
15-
   65  	    if(queue->cmp == NULL) {
15+
  prev: NULL
16
}
17
18
insert success
19
 9982: first 9982 4296030768
20
{
21
  next: 4296030768,
22
  prev: NULL
23
}
24
25
insert success
26
 476: first 476 4296030784
27
{
28
  next: 4296030784,
29
  prev: NULL
30
}
31
32
insert success
33
 2912: first 2912 4296030800
34
{
35
  next: 4296030800,
36
  prev: NULL
37
}
38
39
insert success
40
 -22: first -22 4296030816
41
{
42
  next: 4296030816,
43
  prev: NULL
44
}
45
46
insert success
47
 3291213: end
48
{
49
  next: NULL,
50
  prev: 42
51
}
52
53
insert success
54
 7782: first 7782 4296030832
55
{
56
  next: 4296030832,
57
  prev: NULL
58
}
59
60
insert success
61
62
Process 17536 stopped
63
* thread #1: tid = 0x7b663, 0x0000000100000d2a queueTest1`que_remove(queue=0x00000001001039b0) + 154 at queueADT.c:139, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1e6e)
64
    frame #0: 0x0000000100000d2a queueTest1`que_remove(queue=0x00000001001039b0) + 154 at queueADT.c:139
65
   136 	        queue->back = NULL;
66
   137 	        free(endNode);
67
   138 	    } else {
68
-> 139 	        // otherwise move back to the previous node
69
   140 	        queue->back = queue->back->previous;
70
   141