| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 278 |
| 279 walker->frames[i].address = reinterpret_cast<void*>(pc); | 279 walker->frames[i].address = reinterpret_cast<void*>(pc); |
| 280 | 280 |
| 281 // Make sure line termination is in place. | 281 // Make sure line termination is in place. |
| 282 walker->frames[i].text[OS::kStackWalkMaxTextLen - 1] = '\0'; | 282 walker->frames[i].text[OS::kStackWalkMaxTextLen - 1] = '\0'; |
| 283 | 283 |
| 284 Vector<char> text = MutableCStrVector(walker->frames[i].text, | 284 Vector<char> text = MutableCStrVector(walker->frames[i].text, |
| 285 OS::kStackWalkMaxTextLen); | 285 OS::kStackWalkMaxTextLen); |
| 286 | 286 |
| 287 if (dladdr(reinterpret_cast<void*>(pc), &info) == 0) { | 287 if (dladdr(reinterpret_cast<void*>(pc), &info) == 0) { |
| 288 OS::SNPrintF(text, "[0x%p]", pc); | 288 OS::SNPrintF(text, "[%p]", pc); |
| 289 } else if ((info.dli_fname != NULL && info.dli_sname != NULL)) { | 289 } else if ((info.dli_fname != NULL && info.dli_sname != NULL)) { |
| 290 // We have symbol info. | 290 // We have symbol info. |
| 291 OS::SNPrintF(text, "%s'%s+0x%x", info.dli_fname, info.dli_sname, pc); | 291 OS::SNPrintF(text, "%s'%s+0x%x", info.dli_fname, info.dli_sname, pc); |
| 292 } else { | 292 } else { |
| 293 // No local symbol info. | 293 // No local symbol info. |
| 294 OS::SNPrintF(text, | 294 OS::SNPrintF(text, |
| 295 "%s'0x%p [0x%p]", | 295 "%s'%p [%p]", |
| 296 info.dli_fname, | 296 info.dli_fname, |
| 297 pc - reinterpret_cast<uintptr_t>(info.dli_fbase), | 297 pc - reinterpret_cast<uintptr_t>(info.dli_fbase), |
| 298 pc); | 298 pc); |
| 299 } | 299 } |
| 300 walker->index++; | 300 walker->index++; |
| 301 return 0; | 301 return 0; |
| 302 } | 302 } |
| 303 | 303 |
| 304 | 304 |
| 305 int OS::StackWalk(Vector<OS::StackFrame> frames) { | 305 int OS::StackWalk(Vector<OS::StackFrame> frames) { |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 limit_mutex = CreateMutex(); | 668 limit_mutex = CreateMutex(); |
| 669 } | 669 } |
| 670 | 670 |
| 671 | 671 |
| 672 void OS::TearDown() { | 672 void OS::TearDown() { |
| 673 delete limit_mutex; | 673 delete limit_mutex; |
| 674 } | 674 } |
| 675 | 675 |
| 676 | 676 |
| 677 } } // namespace v8::internal | 677 } } // namespace v8::internal |
| OLD | NEW |