OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 ['Print', 0x004010a0, 0x00402230], | 220 ['Print', 0x004010a0, 0x00402230], |
221 ['v8::String::?1Utf8Value', 0x00402230, 0x004964ba], | 221 ['v8::String::?1Utf8Value', 0x00402230, 0x004964ba], |
222 ['v8::DefaultFatalErrorHandler', 0x00401b70, 0x004020b0], | 222 ['v8::DefaultFatalErrorHandler', 0x00401b70, 0x004020b0], |
223 ['v8::EnsureInitialized', 0x004020b0, 0x0057c000]], | 223 ['v8::EnsureInitialized', 0x004020b0, 0x0057c000]], |
224 shell_syms); | 224 shell_syms); |
225 | 225 |
226 WindowsCppEntriesProvider.prototype.loadSymbols = oldLoadSymbols; | 226 WindowsCppEntriesProvider.prototype.loadSymbols = oldLoadSymbols; |
227 })(); | 227 })(); |
228 | 228 |
229 | 229 |
| 230 // http://code.google.com/p/v8/issues/detail?id=427 |
| 231 (function testWindowsProcessExeAndDllMapFile() { |
| 232 function exeSymbols(exeName) { |
| 233 return [ |
| 234 ' 0000:00000000 ___ImageBase 00400000 <linker-defi
ned>', |
| 235 ' 0001:00000780 ?RunMain@@YAHHQAPAD@Z 00401780 f shell.obj', |
| 236 ' 0001:00000ac0 _main 00401ac0 f shell.obj', |
| 237 '' |
| 238 ].join('\r\n'); |
| 239 } |
| 240 |
| 241 function dllSymbols(dllName) { |
| 242 return [ |
| 243 ' 0000:00000000 ___ImageBase 01c30000 <linker-defi
ned>', |
| 244 ' 0001:00000780 _DllMain@12 01c31780 f libcmt:dllma
in.obj', |
| 245 ' 0001:00000ac0 ___DllMainCRTStartup 01c31ac0 f libcmt:dllcr
t0.obj', |
| 246 '' |
| 247 ].join('\r\n'); |
| 248 } |
| 249 |
| 250 var oldRead = read; |
| 251 |
| 252 read = exeSymbols; |
| 253 var exe_exe_syms = []; |
| 254 (new WindowsCppEntriesProvider()).parseVmSymbols( |
| 255 'chrome.exe', 0x00400000, 0x00472000, |
| 256 function (name, start, end) { |
| 257 exe_exe_syms.push(Array.prototype.slice.apply(arguments, [0])); |
| 258 }); |
| 259 assertEquals( |
| 260 [['RunMain', 0x00401780, 0x00401ac0], |
| 261 ['_main', 0x00401ac0, 0x00472000]], |
| 262 exe_exe_syms, '.exe with .exe symbols'); |
| 263 |
| 264 read = dllSymbols; |
| 265 var exe_dll_syms = []; |
| 266 (new WindowsCppEntriesProvider()).parseVmSymbols( |
| 267 'chrome.exe', 0x00400000, 0x00472000, |
| 268 function (name, start, end) { |
| 269 exe_dll_syms.push(Array.prototype.slice.apply(arguments, [0])); |
| 270 }); |
| 271 assertEquals( |
| 272 [], |
| 273 exe_dll_syms, '.exe with .dll symbols'); |
| 274 |
| 275 read = dllSymbols; |
| 276 var dll_dll_syms = []; |
| 277 (new WindowsCppEntriesProvider()).parseVmSymbols( |
| 278 'chrome.dll', 0x01c30000, 0x02b80000, |
| 279 function (name, start, end) { |
| 280 dll_dll_syms.push(Array.prototype.slice.apply(arguments, [0])); |
| 281 }); |
| 282 assertEquals( |
| 283 [['_DllMain@12', 0x01c31780, 0x01c31ac0], |
| 284 ['___DllMainCRTStartup', 0x01c31ac0, 0x02b80000]], |
| 285 dll_dll_syms, '.dll with .dll symbols'); |
| 286 |
| 287 read = exeSymbols; |
| 288 var dll_exe_syms = []; |
| 289 (new WindowsCppEntriesProvider()).parseVmSymbols( |
| 290 'chrome.dll', 0x01c30000, 0x02b80000, |
| 291 function (name, start, end) { |
| 292 dll_exe_syms.push(Array.prototype.slice.apply(arguments, [0])); |
| 293 }); |
| 294 assertEquals( |
| 295 [], |
| 296 dll_exe_syms, '.dll with .exe symbols'); |
| 297 |
| 298 read = oldRead; |
| 299 })(); |
| 300 |
| 301 |
230 function CppEntriesProviderMock() { | 302 function CppEntriesProviderMock() { |
231 }; | 303 }; |
232 | 304 |
233 | 305 |
234 CppEntriesProviderMock.prototype.parseVmSymbols = function( | 306 CppEntriesProviderMock.prototype.parseVmSymbols = function( |
235 name, startAddr, endAddr, symbolAdder) { | 307 name, startAddr, endAddr, symbolAdder) { |
236 var symbols = { | 308 var symbols = { |
237 'shell': | 309 'shell': |
238 [['v8::internal::JSObject::LocalLookupRealNamedProperty(v8::internal::St
ring*, v8::internal::LookupResult*)', 0x080f8800, 0x080f8d90], | 310 [['v8::internal::JSObject::LocalLookupRealNamedProperty(v8::internal::St
ring*, v8::internal::LookupResult*)', 0x080f8800, 0x080f8d90], |
239 ['v8::internal::HashTable<v8::internal::StringDictionaryShape, v8::inte
rnal::String*>::FindEntry(v8::internal::String*)', 0x080f8210, 0x080f8800], | 311 ['v8::internal::HashTable<v8::internal::StringDictionaryShape, v8::inte
rnal::String*>::FindEntry(v8::internal::String*)', 0x080f8210, 0x080f8800], |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 'tickprocessor-test.log', 'tickprocessor-test.ignore-unknown'], | 400 'tickprocessor-test.log', 'tickprocessor-test.ignore-unknown'], |
329 'GcState': [ | 401 'GcState': [ |
330 false, false, TickProcessor.VmStates.GC, | 402 false, false, TickProcessor.VmStates.GC, |
331 'tickprocessor-test.log', 'tickprocessor-test.gc-state'] | 403 'tickprocessor-test.log', 'tickprocessor-test.gc-state'] |
332 }; | 404 }; |
333 for (var testName in testData) { | 405 for (var testName in testData) { |
334 print('=== testProcessing-' + testName + ' ==='); | 406 print('=== testProcessing-' + testName + ' ==='); |
335 driveTickProcessorTest.apply(null, testData[testName]); | 407 driveTickProcessorTest.apply(null, testData[testName]); |
336 } | 408 } |
337 })(); | 409 })(); |
OLD | NEW |