148 string tmpline, tmpaddr; |
149 string tmpline, tmpaddr; |
149 boost::cmatch what; |
150 boost::cmatch what; |
150 while(getline(logfd, tmpline)) |
151 while(getline(logfd, tmpline)) |
151 { |
152 { |
152 TPlacedEntry tmpEntry; |
153 TPlacedEntry tmpEntry; |
153 if(regex_search(tmpline, what, endFlag)) |
154 if(regex_search(tmpline.c_str(), what, endFlag)) |
154 { |
155 { |
155 break; |
156 break; |
156 } |
157 } |
157 if(regex_search(tmpline, what, sourceFile)) |
158 if(regex_search(tmpline.c_str(), what, sourceFile)) |
158 { |
159 { |
159 tmpEntry.iFileName.assign(what[1].first, what[1].second-what[1].first); |
160 tmpEntry.iFileName.assign(what[1].first, what[1].second-what[1].first); |
160 tmpaddr.assign(what[2].first, what[2].second-what[2].first); |
161 tmpaddr.assign(what[2].first, what[2].second-what[2].first); |
161 tmpEntry.iDataAddress = strtol(tmpaddr.c_str(), NULL, 16); |
162 tmpEntry.iDataAddress = strtol(tmpaddr.c_str(), NULL, 16); |
162 symgen->AddEntry(tmpEntry); |
163 symgen->AddEntry(tmpEntry); |
163 } |
164 } |
164 else if(regex_search(tmpline, what, executableFile)) |
165 else if(regex_search(tmpline.c_str(), what, executableFile)) |
165 { |
166 { |
166 tmpEntry.iFileName.assign(what[1].first, what[1].second-what[1].first); |
167 tmpEntry.iFileName.assign(what[1].first, what[1].second-what[1].first); |
167 while(getline(logfd, tmpline) && tmpline != "") |
168 while(getline(logfd, tmpline) && tmpline != "") |
168 { |
169 { |
169 if(regex_search(tmpline, what, codeStart)) |
170 if(regex_search(tmpline.c_str(), what, codeStart)) |
170 { |
171 { |
171 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
172 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
172 tmpEntry.iCodeAddress = strtol(tmpaddr.c_str(), NULL, 16); |
173 tmpEntry.iCodeAddress = strtol(tmpaddr.c_str(), NULL, 16); |
173 } |
174 } |
174 else if(regex_search(tmpline, what, dataStart)) |
175 else if(regex_search(tmpline.c_str(), what, dataStart)) |
175 { |
176 { |
176 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
177 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
177 tmpEntry.iDataAddress = strtol(tmpaddr.c_str(), NULL, 16); |
178 tmpEntry.iDataAddress = strtol(tmpaddr.c_str(), NULL, 16); |
178 } |
179 } |
179 else if(regex_search(tmpline, what, dataBssStart)) |
180 else if(regex_search(tmpline.c_str(), what, dataBssStart)) |
180 { |
181 { |
181 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
182 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
182 tmpEntry.iDataBssLinearBase = strtol(tmpaddr.c_str(), NULL, 16); |
183 tmpEntry.iDataBssLinearBase = strtol(tmpaddr.c_str(), NULL, 16); |
183 } |
184 } |
184 else if(regex_search(tmpline, what, textSize)) |
185 else if(regex_search(tmpline.c_str(), what, textSize)) |
185 { |
186 { |
186 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
187 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
187 tmpEntry.iTextSize = strtol(tmpaddr.c_str(), NULL, 16); |
188 tmpEntry.iTextSize = strtol(tmpaddr.c_str(), NULL, 16); |
188 } |
189 } |
189 else if(regex_search(tmpline, what, dataSize)) |
190 else if(regex_search(tmpline.c_str(), what, dataSize)) |
190 { |
191 { |
191 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
192 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
192 tmpEntry.iDataSize = strtol(tmpaddr.c_str(), NULL, 16); |
193 tmpEntry.iDataSize = strtol(tmpaddr.c_str(), NULL, 16); |
193 } |
194 } |
194 else if(regex_search(tmpline, what, bssSize)) |
195 else if(regex_search(tmpline.c_str(), what, bssSize)) |
195 { |
196 { |
196 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
197 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
197 tmpEntry.iBssSize = strtol(tmpaddr.c_str(), NULL, 16); |
198 tmpEntry.iBssSize = strtol(tmpaddr.c_str(), NULL, 16); |
198 } |
199 } |
199 else if(regex_search(tmpline, what, totalDataSize)) |
200 else if(regex_search(tmpline.c_str(), what, totalDataSize)) |
200 { |
201 { |
201 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
202 tmpaddr.assign(what[1].first, what[1].second-what[1].first); |
202 tmpEntry.iTotalDataSize = strtol(tmpaddr.c_str(), NULL, 16); |
203 tmpEntry.iTotalDataSize = strtol(tmpaddr.c_str(), NULL, 16); |
203 } |
204 } |
204 } |
205 } |