OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 symbols = backtrace_symbols(addresses, frames_count); | 314 symbols = backtrace_symbols(addresses, frames_count); |
315 if (symbols == NULL) { | 315 if (symbols == NULL) { |
316 DeleteArray(addresses); | 316 DeleteArray(addresses); |
317 return kStackWalkError; | 317 return kStackWalkError; |
318 } | 318 } |
319 | 319 |
320 for (int i = 0; i < frames_count; i++) { | 320 for (int i = 0; i < frames_count; i++) { |
321 frames[i].address = addresses[i]; | 321 frames[i].address = addresses[i]; |
322 // Format a text representation of the frame based on the information | 322 // Format a text representation of the frame based on the information |
323 // available. | 323 // available. |
324 SNPrintF(MutableCStrVector(frames[i].text, | 324 SNPrintF(MutableCStrVector(frames[i].text, |
325 kStackWalkMaxTextLen), | 325 kStackWalkMaxTextLen), |
326 "%s", | 326 "%s", |
327 symbols[i]); | 327 symbols[i]); |
328 // Make sure line termination is in place. | 328 // Make sure line termination is in place. |
329 frames[i].text[kStackWalkMaxTextLen - 1] = '\0'; | 329 frames[i].text[kStackWalkMaxTextLen - 1] = '\0'; |
330 } | 330 } |
331 | 331 |
332 DeleteArray(addresses); | 332 DeleteArray(addresses); |
333 free(symbols); | 333 free(symbols); |
334 | 334 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 } | 634 } |
635 | 635 |
636 // This sampler is no longer the active sampler. | 636 // This sampler is no longer the active sampler. |
637 active_sampler_ = NULL; | 637 active_sampler_ = NULL; |
638 active_ = false; | 638 active_ = false; |
639 } | 639 } |
640 | 640 |
641 #endif // ENABLE_LOGGING_AND_PROFILING | 641 #endif // ENABLE_LOGGING_AND_PROFILING |
642 | 642 |
643 } } // namespace v8::internal | 643 } } // namespace v8::internal |
OLD | NEW |