From 612a925563bb759bfd475b7323161420c9717309 Mon Sep 17 00:00:00 2001 From: "jmedley@chromium.org" Date: Thu, 21 Aug 2014 04:49:44 +0000 Subject: Second batch of corrections for incorrect paths. BUG=none R= binji@chromium.org, jfb@chromium.org TEST=none NOTRY=true (documentation only change) Review URL: https://codereview.chromium.org/488133003 Cr-Commit-Position: refs/heads/master@{#291006} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291006 0039d316-1c4b-4281-b951-d872f2087c98 --- .../doc_generated/community/index.html | 2 +- .../doc_generated/devguide/coding/3D-graphics.html | 6 +- .../devguide/coding/native-client-modules.html | 6 +- .../devguide/coding/progress-events.html | 4 +- .../devguide/coding/view-focus-input-events.html | 12 +-- .../doc_generated/devguide/devcycle/debugging.html | 97 ++++++++++---------- .../devguide/devcycle/dynamic-loading.html | 8 +- .../src/doc/devguide/coding/3D-graphics.rst | 6 +- .../doc/devguide/coding/native-client-modules.rst | 6 +- .../src/doc/devguide/coding/progress-events.rst | 4 +- .../devguide/coding/view-focus-input-events.rst | 12 +-- .../src/doc/devguide/devcycle/debugging.rst | 102 +++++++++++---------- .../src/doc/devguide/devcycle/dynamic-loading.rst | 9 +- 13 files changed, 147 insertions(+), 127 deletions(-) diff --git a/native_client_sdk/doc_generated/community/index.html b/native_client_sdk/doc_generated/community/index.html index 6ff7409..e8bb503 100644 --- a/native_client_sdk/doc_generated/community/index.html +++ b/native_client_sdk/doc_generated/community/index.html @@ -3,7 +3,7 @@

Community

This section contains pages related to the Native Client community - both -implementors (contributors to the open-source Native Client project) and developers, who use Native Client to develop web +implementors (contributors to the open-source Native Client project) and developers, who use Native Client to develop web applications.

For a list of active forums where you can ask questions, check the help page.

diff --git a/native_client_sdk/doc_generated/devguide/coding/3D-graphics.html b/native_client_sdk/doc_generated/devguide/coding/3D-graphics.html index c4503f1..1b2b712 100644 --- a/native_client_sdk/doc_generated/devguide/coding/3D-graphics.html +++ b/native_client_sdk/doc_generated/devguide/coding/3D-graphics.html @@ -394,12 +394,12 @@ to avoid client side buffers. Use Vertex Buffer Objects (VBOs) instead. to a single point. You could create a buffer and bind it to both GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER, but that would be expensive overhead and it is not recommended. -
  • Don’t call ``glGet*`` or ``glCheck*`` during rendering. This is normal +
  • Don’t call glGet* or glCheck* during rendering. This is normal advice for OpenGL programs, but is particularly important for 3D on Chrome. Calls to any OpenGL ES 2.0 function whose name begins with these strings blocks the Native Client thread. This includes glGetError; avoid calling it in release builds.
  • -
  • Don’t use fixed point (``GL_FIXED``) vertex attributes. Fixed point +
  • Don’t use fixed point (GL_FIXED) vertex attributes. Fixed point attributes are not supported in OpenGL ES 2.0, so emulating them in OpenGL ES 2.0 is slow. By default, GL_FIXED support is turned off in the Pepper 3D API.
  • @@ -408,7 +408,7 @@ API. 2.0 implementation when you update a portion of a buffer (with glSubBufferData for example) the entire buffer must be reprocessed. To avoid this problem, keep static and dynamic data in different buffers. -
  • Don’t call ``glDisable(GL_TEXTURE_2D)``. This is an OpenGL ES 2.0 +
  • Don’t call glDisable(GL_TEXTURE_2D). This is an OpenGL ES 2.0 error. Each time it is called, an error messages will appear in Chrome’s about:gpu tab.
  • diff --git a/native_client_sdk/doc_generated/devguide/coding/native-client-modules.html b/native_client_sdk/doc_generated/devguide/coding/native-client-modules.html index eb0477b..a429187 100644 --- a/native_client_sdk/doc_generated/devguide/coding/native-client-modules.html +++ b/native_client_sdk/doc_generated/devguide/coding/native-client-modules.html @@ -123,9 +123,9 @@ the NaCl SDK), these three components are specified in the file hello_tutorial.cc. Here is the factory function:

     namespace pp {
    -Module* CreateModule() {
    -  return new HelloTutorialModule();
    -}
    +  Module* CreateModule() {
    +    return new HelloTutorialModule();
    +  }
     }
     

    The CreateModule() factory function is the main binding point between a diff --git a/native_client_sdk/doc_generated/devguide/coding/progress-events.html b/native_client_sdk/doc_generated/devguide/coding/progress-events.html index b2a5e57..afca37c 100644 --- a/native_client_sdk/doc_generated/devguide/coding/progress-events.html +++ b/native_client_sdk/doc_generated/devguide/coding/progress-events.html @@ -20,8 +20,8 @@ chapter assumes you are familiar with the material presented in the Technical Overview.

    Module loading and progress events

    The Native Client runtime reports a set of state changes during the module diff --git a/native_client_sdk/doc_generated/devguide/coding/view-focus-input-events.html b/native_client_sdk/doc_generated/devguide/coding/view-focus-input-events.html index f311110..fd2daed 100644 --- a/native_client_sdk/doc_generated/devguide/coding/view-focus-input-events.html +++ b/native_client_sdk/doc_generated/devguide/coding/view-focus-input-events.html @@ -28,12 +28,12 @@ programming techniques. The input_events example is used to illustrate how your module can react to keyboard and mouse input event. The mouse_lock example is used to illustrate how your module can react to view change events. You can find these examples in the -/examples/api/input_events and /examples/api/mouse_lock -directories in the Native Client SDK. There is also the -ppapi_simple library that can be used to to implement most of the -boiler plate. The pi_generator example in -/examples/demo/pi_generator uses ppapi_simple to manage view -change events and 2D graphics.

    +/pepper_<version>/examples/api/input_event and +/pepper_<version>/examples/api/mouse_lock directories in the Native Client +SDK. There is also the ppapi_simple library that can be used to to implement +most of the boiler plate. The pi_generator example in +/pepper_<version>/examples/demo/pi_generator uses ppapi_simple to manage +view change events and 2D graphics.

    Overview

    When a user interacts with the web page using a keyboard, mouse or some other input device, the browser generates input events. In a traditional web diff --git a/native_client_sdk/doc_generated/devguide/devcycle/debugging.html b/native_client_sdk/doc_generated/devguide/devcycle/debugging.html index ddd55f2..3dfbfbf 100644 --- a/native_client_sdk/doc_generated/devguide/devcycle/debugging.html +++ b/native_client_sdk/doc_generated/devguide/devcycle/debugging.html @@ -26,7 +26,7 @@ and measure your application’s performance.

  • Debugging with Visual Studio
  • Debugging with nacl-gdb

    @@ -51,15 +51,15 @@ application:

    memory information are visible. If they are not, right click in the header row and select the memory items from the popup menu that appears.
  • -

    A browser window running a Native Client application will have at least two -processes associated with it: a process for the app’s top level (the render -process managing the page including its HTML and any JavaScript) and one or -more processes for each instance of a Native Client module embedded in the page -(each process running native code from one nexe file). The top-level process -appears with the application’s icon and begins with the text “App:”. A Native -Client process appears with a Chrome extension icon (a jigsaw puzzle piece -puzzle) and begins with the text “Native Client module” followed by the URL -of its manifest file.

    +

    A browser window running a Native Client application has at least two processes +associated with it: a process for the app’s top level (the render process +managing the page including its HTML and JavaScript) and one or more +processes for each instance of a Native Client module embedded in the page +(each process running native code from one nexe or pexe file). The top-level +process appears with the application’s icon and begins with the text “Tab:”. +A Native Client process appears with a Chrome extension icon (a jigsaw puzzle +piece puzzle) and begins with the text “Native Client module:” followed by the +URL of its manifest file.

    From the Task Manager you can view the changing memory allocations of all the processes associated with a Native Client application. Each process has its own memory footprint. You can also see the rendering rate displayed as frames per @@ -71,18 +71,17 @@ application process, so look for the rendering rate there.

    increase the amount of Native Client’s diagnostic output by setting the following environment variables:

    Basic debugging

    Writing messages to the JavaScript console

    -

    You can send messages from your C/C++ code to JavaScript using the PostMessage -call in the Pepper messaging system. When the -JavaScript code receives a message, its message event handler can call -console.log() to write -the message to the JavaScript console in -Chrome’s Developer Tools.

    +

    You can send messages from your C/C++ code to JavaScript using the +PostMessage() call in the Pepper messaging system. When the JavaScript code receives a message, its +message event handler can call console.log() to write the message to the +JavaScript console in Chrome’s Developer Tools.

    Debugging with printf

    Your C/C++ code can perform inline printf debugging to stdout and stderr by calling fprintf() directly, or by using cover functions like these:

    @@ -98,7 +97,8 @@ void errormsg(const char* pMsg){

    By default stdout and stderr will appear in Chrome’s stdout and stderr stream but they can also be redirected as described below.

    Redirecting output to log files

    -

    You can redirect stdout and stderr to output files by setting these environment variables:

    +

    You can redirect stdout and stderr to output files by setting these environment +variables:

    Redirecting output to the JavaScript console

    You can also cause output from printf statements in your C/C++ code to be @@ -122,17 +122,17 @@ relayed to the JavaScript side of your application through the Pepper messaging system, where you can then write the output to the JavaScript console. Follow these steps:

      -
    1. Set the NACL_EXE_STDOUT and NACL_EXE_STDERR environment variables as +

    2. Set the NACL_EXE_STDOUT and NACL_EXE_STDERR environment variables as follows:

        -
      • NACL_EXE_STDOUT=DEBUG_ONLY:dev://postmessage

        +
      • NACL_EXE_STDOUT=DEBUG_ONLY:dev://postmessage

      • -
      • NACL_EXE_STDERR=DEBUG_ONLY:dev://postmessage

        +
      • NACL_EXE_STDERR=DEBUG_ONLY:dev://postmessage

      -

      These settings tell Native Client to use PostMessage() to send output that -your Native Client module writes to stdout and stderr to the JavaScript side -of your application.

      +

      These settings tell Native Client to use PostMessage() to send output +that your Native Client module writes to stdout and stderr to the JavaScript +side of your application.

    3. Register a JavaScript handler to receive messages from your Native Client module:

      @@ -162,7 +162,7 @@ JavaScript, your handler will need to be more complex.

      Once you’ve implemented a message handler and set up the environment variables as described above, you can check the JavaScript console to see output that your Native Client module prints to stdout and stderr. Keep in -mind that your module makes a call to PostMessage() every time it flushes +mind that your module makes a call to PostMessage() every time it flushes stdout or stderr. Your application’s performance will degrade considerably if your module prints and flushes frequently, or if it makes frequent Pepper calls to begin with (e.g., to render).

      @@ -189,14 +189,14 @@ link it to the running code.

      Debugging with nacl-gdb

      The Native Client SDK includes a command-line debugger that you can use to debug Native Client modules. The debugger is based on the GNU debugger gdb, and is located at -toolchain/<platform>_x86_newlib/bin/x86_64-nacl-gdb (where <platform> -is the platform of your development machine: win, mac, or +pepper_<version>/toolchain/<platform>_x86_newlib/bin/x86_64-nacl-gdb (where +<platform> is the platform of your development machine: win, mac, or linux).

      Note that this same copy of GDB can be used to debug any NaCl program, whether built using newlib or glibc for x86-32, x86-64 or ARM. In the SDK, i686-nacl-gdb is an alias for x86_64-nacl-gdb, and the newlib and glibc toolchains both contain the same version of GDB.

      -

      Debugging PNaCl pexes (with Pepper 35+)

      +

      Debugging PNaCl pexes (Pepper 35 or later)

      If you want to use GDB to debug a program that is compiled with the PNaCl toolchain, you must have a copy of the pexe from before running pnacl-finalize. The pnacl-finalize tool converts LLVM bitcode @@ -210,7 +210,7 @@ is not considered stable. This means that a debug copy of the PNaCl application created by a Pepper N SDK is only guaranteed to run with a matching Chrome version N. If the version of the debug bitcode pexe does not match that of Chrome then the translation process may fail, and -you will see and error message in the JavaScript console.

      +you will see an error message in the JavaScript console.

      Also, make sure you are passing the -g compile option to pnacl-clang to enable generating debugging info. You might also want to omit -O2 from the compile-time and link-time options, otherwise GDB not might be able to print variables’ values when @@ -257,10 +257,12 @@ options.

    4. Secondly, use pnacl-translate to convert your pexe to one or more nexe files. For example:

      -<NACL_SDK_ROOT>/toolchain/win_pnacl/bin/pnacl-translate ^
      -  --allow-llvm-bitcode-input hello_world.pexe -arch x86-32 -o hello_world_x86_32.nexe
      -<NACL_SDK_ROOT>/toolchain/win_pnacl/bin/pnacl-translate ^
      -  --allow-llvm-bitcode-input hello_world.pexe -arch x86-64 -o hello_world_x86_64.nexe
      +nacl_sdk/pepper_<version>/toolchain/win_pnacl/bin/pnacl-translate \
      +  --allow-llvm-bitcode-input hello_world.pexe -arch x86-32 \
      +  -o hello_world_x86_32.nexe
      +nacl_sdk/pepper_<version>/toolchain/win_pnacl/bin/pnacl-translate \
      +  --allow-llvm-bitcode-input hello_world.pexe -arch x86-64 \
      +  -o hello_world_x86_64.nexe
       

      For this, use the non-finalized pexe file produced by pnacl-clang, not the pexe file produced by pnacl-finalize. @@ -373,16 +375,16 @@ nacl-gdb and run the continue command.

    5. Go to the directory with your source code, and run nacl-gdb from there. For example:

      -cd <NACL_SDK_ROOT>/examples/hello_world_gles
      -<NACL_SDK_ROOT>/toolchain/win_x86_newlib/bin/x86_64-nacl-gdb
      +cd nacl_sdk/pepper_<version>/examples/demo/drive
      +nacl_sdk/pepper_<version>/toolchain/win_x86_newlib/bin/x86_64-nacl-gdb
       

      The debugger will start and show you a gdb prompt:

       (gdb)
       
    6. -
    7. For debugging PNaCl pexes run the following gdb command lines -(skip to the next item if you are using NaCl instead of PNaCl):

      +
    8. Run the debugging command lines.

      +

      For PNaCl:

       (gdb) target remote localhost:4014
       (gdb) remote get nexe <path-to-save-translated-nexe-with-debug-info>
      @@ -390,8 +392,7 @@ cd <NACL_SDK_ROOT>/examples/hello_world_gles
       (gdb) remote get irt <path-to-save-NaCl-integrated-runtime>
       (gdb) nacl-irt <path-to-saved-NaCl-integrated-runtime>
       
      -
    9. -
    10. For NaCl nexes, run the following commands from the gdb command line:

      +

      For NaCl:

       (gdb) target remote localhost:4014
       (gdb) nacl-manifest <path-to-your-.nmf-file>
      @@ -431,7 +432,7 @@ looks something like C:/Users/<username>/AppData/Local/Google/Chrome
       SxS/Application/23.0.1247.1/nacl_irt_x86_64.nexe.
       The remote get irt <path> saves that to the current working
       directory so that you do not need to find where exactly the IRT
      -is stored alongside Chrome.

      +is stored.

      nacl-irt <path>

      Tells the debugger where to find the Native Client Integrated Runtime @@ -455,13 +456,13 @@ quotation marks around the path.

      Windows:

       target remote localhost:4014
      -nacl-manifest "C:/<NACL_SDK_ROOT>/examples/hello_world_gles/newlib/Debug/hello_world_gles.nmf"
      +nacl-manifest "C:/nacl_sdk/pepper_<version>/examples/hello_world_gles/newlib/Debug/hello_world_gles.nmf"
       nacl-irt "C:/Users/<username>/AppData/Local/Google/Chrome SxS/Application/23.0.1247.1/nacl_irt_x86_64.nexe"
       

      To save yourself some typing, you can put put these nacl-gdb commands in a script file, and execute the file when you run nacl-gdb, like so:

      -<NACL_SDK_ROOT>/toolchain/win_x86_newlib/bin/x86_64-nacl-gdb -x <nacl-script-file>
      +nacl_sdk/pepper_<version>/toolchain/win_x86_newlib/bin/x86_64-nacl-gdb -x <nacl-script-file>
       

      If nacl-gdb connects successfully to Chrome, it displays a message such as the one below, followed by a gdb prompt:

      diff --git a/native_client_sdk/doc_generated/devguide/devcycle/dynamic-loading.html b/native_client_sdk/doc_generated/devguide/devcycle/dynamic-loading.html index 7de0c6c..003a20d 100644 --- a/native_client_sdk/doc_generated/devguide/devcycle/dynamic-loading.html +++ b/native_client_sdk/doc_generated/devguide/devcycle/dynamic-loading.html @@ -106,13 +106,19 @@ file and several libraries, which are on the order of 1.5MB).
    11. due to licensing considerations), we recommend that you use the glibc library.

      +