| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 walker->frames[i].address = reinterpret_cast<void*>(pc); | 277 walker->frames[i].address = reinterpret_cast<void*>(pc); |
| 278 | 278 |
| 279 // Make sure line termination is in place. | 279 // Make sure line termination is in place. |
| 280 walker->frames[i].text[OS::kStackWalkMaxTextLen - 1] = '\0'; | 280 walker->frames[i].text[OS::kStackWalkMaxTextLen - 1] = '\0'; |
| 281 | 281 |
| 282 Vector<char> text = MutableCStrVector(walker->frames[i].text, | 282 Vector<char> text = MutableCStrVector(walker->frames[i].text, |
| 283 OS::kStackWalkMaxTextLen); | 283 OS::kStackWalkMaxTextLen); |
| 284 | 284 |
| 285 if (dladdr(reinterpret_cast<void*>(pc), &info) == 0) { | 285 if (dladdr(reinterpret_cast<void*>(pc), &info) == 0) { |
| 286 OS::SNPrintF(text, "[0x%p]", pc); | 286 OS::SNPrintF(text, "[%p]", pc); |
| 287 } else if ((info.dli_fname != NULL && info.dli_sname != NULL)) { | 287 } else if ((info.dli_fname != NULL && info.dli_sname != NULL)) { |
| 288 // We have symbol info. | 288 // We have symbol info. |
| 289 OS::SNPrintF(text, "%s'%s+0x%x", info.dli_fname, info.dli_sname, pc); | 289 OS::SNPrintF(text, "%s'%s+0x%x", info.dli_fname, info.dli_sname, pc); |
| 290 } else { | 290 } else { |
| 291 // No local symbol info. | 291 // No local symbol info. |
| 292 OS::SNPrintF(text, | 292 OS::SNPrintF(text, |
| 293 "%s'0x%p [0x%p]", | 293 "%s'%p [%p]", |
| 294 info.dli_fname, | 294 info.dli_fname, |
| 295 pc - reinterpret_cast<uintptr_t>(info.dli_fbase), | 295 pc - reinterpret_cast<uintptr_t>(info.dli_fbase), |
| 296 pc); | 296 pc); |
| 297 } | 297 } |
| 298 walker->index++; | 298 walker->index++; |
| 299 return 0; | 299 return 0; |
| 300 } | 300 } |
| 301 | 301 |
| 302 | 302 |
| 303 int OS::StackWalk(Vector<OS::StackFrame> frames) { | 303 int OS::StackWalk(Vector<OS::StackFrame> frames) { |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 } | 894 } |
| 895 | 895 |
| 896 | 896 |
| 897 void Sampler::Stop() { | 897 void Sampler::Stop() { |
| 898 ASSERT(IsActive()); | 898 ASSERT(IsActive()); |
| 899 SignalSender::RemoveActiveSampler(this); | 899 SignalSender::RemoveActiveSampler(this); |
| 900 SetActive(false); | 900 SetActive(false); |
| 901 } | 901 } |
| 902 | 902 |
| 903 } } // namespace v8::internal | 903 } } // namespace v8::internal |
| OLD | NEW |