Mercurial > hg > Document > Growi
comparison user/anatofuz/note/2021/01/23.md @ 31:38ca0355d32c
backup 2021-01-24
author | autobackup |
---|---|
date | Sun, 24 Jan 2021 00:10:03 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
30:34152cba1865 | 31:38ca0355d32c |
---|---|
1 ```shell | |
2 (gdb) p phils0 | |
3 $1 = (Phils *) 0x7fff2f7f1d60 | |
4 (gdb) p phils0->phils | |
5 $2 = (union Data *) 0x7fff2f7f1db0 | |
6 (gdb) p (struct PhilsImpl*)phils0->phils | |
7 $3 = (struct PhilsImpl *) 0x7fff2f7f1db0 | |
8 (gdb) p *(struct PhilsImpl*)phils0->phils | |
9 $4 = {self = 0, Leftfork = 0x7fff2f7f1b50, Rightfork = 0x7fff2f7f1acc, next = C_checkAndSetAtomicReference} | |
10 ``` | |
11 | |
12 | |
13 ```c | |
14 (gdb) p phils0 | |
15 $1 = (Phils *) 0x7fff2f7f1d60 | |
16 (gdb) p phils0->phils | |
17 $2 = (union Data *) 0x7fff2f7f1db0 | |
18 (gdb) p (struct PhilsImpl*)phils0->phils | |
19 $3 = (struct PhilsImpl *) 0x7fff2f7f1db0 | |
20 (gdb) p *(struct PhilsImpl*)phils0->phils | |
21 $4 = {self = 0, Leftfork = 0x7fff2f7f1b50, Rightfork = 0x7fff2f7f1acc, next = C_checkAndSetAtomicReference} | |
22 (gdb) n | |
23 60 Phils* phils4 = createPhilsImpl(context,4,fork4,fork0); // model checking : phils4 | |
24 (gdb) n | |
25 63 context->task = NEW(struct Context); | |
26 (gdb) n | |
27 64 initContext(context->task); | |
28 (gdb) n | |
29 65 context->task->next = phils0->thinking; | |
30 (gdb) n | |
31 66 context->task->idgCount = 0; | |
32 (gdb) n | |
33 67 context->task->idg = context->task->dataNum; | |
34 (gdb) n | |
35 68 context->task->maxIdg = context->task->idg + 0; | |
36 (gdb) n | |
37 69 context->task->odg = context->task->maxIdg; | |
38 (gdb) n | |
39 70 context->task->maxOdg = context->task->odg + 0; | |
40 (gdb) n | |
41 71 GET_META(phils0)->wait = createSynchronizedQueue(context); | |
42 (gdb) n | |
43 72 GeareTaskData(context, Phils) = (union Data*)phils0; | |
44 (gdb) n | |
45 73 Gearef(context->task, Phils)->phils = (union Data*) phils0; | |
46 (gdb) n | |
47 74 Gearef(context->task, Phils)->next = C_exit_code; | |
48 (gdb) n | |
49 75 element = &ALLOCATE(context, Element)->Element; | |
50 (gdb) n | |
51 76 element->data = (union Data*)context->task; | |
52 (gdb) n | |
53 77 element->next = context->taskList; | |
54 (gdb) p context->task[Phils] | |
55 A syntax error in expression, near `]'. | |
56 (gdb) p context->task[D_Phils] | |
57 $5 = {next = C_checkAndSetAtomicReference, worker = 0x0, taskManager = 0x0, codeNum = 0, code = 0x0, data = 0x0, metaDataStart = 0x0, metaData = 0x0, heapStart = 0x0, | |
58 heap = 0x0, heapLimit = 0, dataNum = 0, idgCount = 0, idg = 0, maxIdg = 0, odg = 0, maxOdg = 0, gpu = 0, task = 0x0, taskList = 0x0, iterate = 0, iterator = 0x0} | |
59 (gdb) p context->task->data[D_Phils] | |
60 $6 = (union Data *) 0x7fff2f7f1d60 | |
61 (gdb) p context->task->data[D_Phils]->phils | |
62 There is no member named phils. | |
63 (gdb) p context->task->data[D_Phils] | |
64 $7 = (union Data *) 0x7fff2f7f1d60 | |
65 (gdb) p (struct Phils*)context->task->data[D_Phils] | |
66 $8 = (struct Phils *) 0x7fff2f7f1d60 | |
67 (gdb) p *(struct Phils*)context->task->data[D_Phils] | |
68 $9 = {phils = 0x7fff2f7f1d60, putdown_lfork = C_putdown_lforkPhilsImpl, putdown_rfork = C_putdown_rforkPhilsImpl, thinking = C_thinkingPhilsImpl, | |
69 pickup_rfork = C_pickup_rforkPhilsImpl, pickup_lfork = C_pickup_lforkPhilsImpl, eating = C_eatingPhilsImpl, next = C_exit_code} | |
70 (gdb) p *(struct Phils*)context->task->data[D_Phils]->phils | |
71 There is no member named phils. | |
72 (gdb) p (struct Phils*)context->task->data[D_Phils]->phils | |
73 There is no member named phils. | |
74 (gdb) p ((struct Phils*)context->task->data[D_Phils])->phils | |
75 $10 = (union Data *) 0x7fff2f7f1d60 | |
76 (gdb) p *(struct PhilsImpl*)((struct Phils*)context->task->data[D_Phils])->phils | |
77 $11 = {self = 796859744, Leftfork = 0x1f0000001e, Rightfork = 0x1900000036, next = C_pickup_lforkPhilsImpl} | |
78 (gdb) p phils0->phils | |
79 $12 = (union Data *) 0x7fff2f7f1d60 | |
80 (gdb) p *(struct PhilsImpl*) phils0->phils | |
81 $13 = {self = 796859744, Leftfork = 0x1f0000001e, Rightfork = 0x1900000036, next = C_pickup_lforkPhilsImpl} | |
82 (gdb) p *(struct PhilsImpl*)phils0->phils | |
83 $14 = {self = 796859744, Leftfork = 0x1f0000001e, Rightfork = 0x1900000036, next = C_pickup_lforkPhilsImpl} | |
84 ``` | |
85 | |
86 | |
87 ``` | |
88 DB<30> p $line | |
89 " AtomicT<int>* fork0 = createAtomicTImpl(contex,-1); // model checking : fork0 | |
90 " | |
91 " AtomicT<int>* fork0 = createAtomicTImpl(contex,-1); // model checking : fork0 | |
92 " | |
93 | |
94 DB<31> p $type | |
95 "AtomicT" | |
96 "AtomicT" | |
97 | |
98 DB<32> n | |
99 main::convertGenerics(generate_context.pl:566): | |
100 566: if ($repimpl) { | |
101 DB<32> p $line | |
102 " AtomicT_int* fork0 = createAtomicT_intImpl(contex,-1); // model checking : fork0 | |
103 " | |
104 " AtomicT_int* fork0 = createAtomicT_intImpl(contex,-1); // model checking : fork0 | |
105 " | |
106 | |
107 DB<33> p $repimpl | |
108 1 | |
109 1 | |
110 | |
111 DB<34> n | |
112 main::convertGenerics(generate_context.pl:567): | |
113 567: $line =~ s/$impl(<.*>)?/$replaceImpls/g; | |
114 DB<34> p $impl | |
115 "AtomicTImpl" | |
116 "AtomicTImpl" | |
117 | |
118 DB<35> | |
119 ``` | |
120 | |
121 ```perl | |
122 +kajika+anatofuz$ perl generate_stub.pl SingleLinkedQueue.cbc | |
123 \ { | |
124 queue { | |
125 clear "C_clearSingleLinkedQueue", | |
126 isEmpty "C_isEmptySingleLinkedQueue", | |
127 put "C_putSingleLinkedQueue", | |
128 take "C_takeSingleLinkedQueue" | |
129 }, | |
130 singleLinkedQueue { | |
131 last "singleLinkedQueue", | |
132 top "new" | |
133 } | |
134 } | |
135 ``` |