| 155 | } |
| 156 | |
| 157 | void Writer::writeStackFrame(const RawStackFrame *frame) { |
| 158 | _writeUInt(frame->id); |
| 159 | if (!lookup(frames, frame->id)) { |
| 160 | if (frame->module != NULL) { |
| 161 | _writeByte(trace::BACKTRACE_MODULE); |
| 162 | _writeString(frame->module); |
| 163 | } |
| 164 | if (frame->function != NULL) { |
| 165 | _writeByte(trace::BACKTRACE_FUNCTION); |
| 166 | _writeString(frame->function); |
| 167 | } |
| 168 | if (frame->filename != NULL) { |
| 169 | _writeByte(trace::BACKTRACE_FILENAME); |
| 170 | _writeString(frame->filename); |
| 171 | } |
| 172 | if (frame->linenumber >= 0) { |
| 173 | _writeByte(trace::BACKTRACE_LINENUMBER); |
| 174 | _writeUInt(frame->linenumber); |
| 175 | } |
| 176 | if (frame->offset >= 0) { |
| 177 | _writeByte(trace::BACKTRACE_OFFSET); |
| 178 | _writeUInt(frame->offset); |
| 179 | } |
| 180 | _writeByte(trace::BACKTRACE_END); |
| 181 | frames[frame->id] = true; |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | void |
| 186 | Writer::writeFlags(unsigned flags) { |