| 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 13 matching lines...) Expand all Loading... |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 | 28 |
| 29 // This controls whether this sample is compiled with debugger support. | 29 // This controls whether this sample is compiled with debugger support. |
| 30 // You may trace its usages in source text to see what parts of program | 30 // You may trace its usages in source text to see what parts of program |
| 31 // are responsible for debugging support. | 31 // are responsible for debugging support. |
| 32 // Note that V8 itself should be compiled with enabled debugger support | 32 // Note that V8 itself should be compiled with enabled debugger support |
| 33 // to have it all working. | 33 // to have it all working. |
| 34 #define SUPPORT_DEBUGGING | 34 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 35 # define SUPPORT_DEBUGGING |
| 36 #endif |
| 35 | 37 |
| 36 #include <v8.h> | 38 #include <v8.h> |
| 37 | 39 |
| 38 #ifdef SUPPORT_DEBUGGING | 40 #ifdef SUPPORT_DEBUGGING |
| 39 #include <v8-debug.h> | 41 #include <v8-debug.h> |
| 40 #endif | 42 #endif |
| 41 | 43 |
| 42 #include <fcntl.h> | 44 #include <fcntl.h> |
| 43 #include <string.h> | 45 #include <string.h> |
| 44 #include <stdio.h> | 46 #include <stdio.h> |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 } | 440 } |
| 439 // Remove newline char | 441 // Remove newline char |
| 440 for (char* pos = buffer; *pos != '\0'; pos++) { | 442 for (char* pos = buffer; *pos != '\0'; pos++) { |
| 441 if (*pos == '\n') { | 443 if (*pos == '\n') { |
| 442 *pos = '\0'; | 444 *pos = '\0'; |
| 443 break; | 445 break; |
| 444 } | 446 } |
| 445 } | 447 } |
| 446 return v8::String::New(buffer); | 448 return v8::String::New(buffer); |
| 447 } | 449 } |
| OLD | NEW |