From 15a05b3639c47014642cf962bc8a4da1c991b30b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 7 Nov 2014 20:19:26 +0800 Subject: [PATCH 1/9] Add script to call symstore --- script/upload-windows-pdb.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 script/upload-windows-pdb.py diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py new file mode 100644 index 000000000000..11b0b0967208 --- /dev/null +++ b/script/upload-windows-pdb.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import os + +from lib.util import execute, rm_rf, safe_mkdir + + +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +SYMBOLS_DIR = 'dist\\symbols' +PDB_LIST = [ + 'out\\Release\\atom.exe.pdb', + 'vendor\\brightray\\vendor\\download\\libchromiumcontent\\Release\\chromiumcontent.dll.pdb', +] + + +def main(): + os.chdir(SOURCE_ROOT) + + rm_rf(SYMBOLS_DIR) + safe_mkdir(SYMBOLS_DIR) + for pdb in PDB_LIST: + run_symstore(pdb, SYMBOLS_DIR, 'AtomShell') + + +def run_symstore(pdb, dest, product): + execute(['symstore', 'add', '/r', '/f', pdb, '/s', dest, '/t', product]) + + +if __name__ == '__main__': + import sys + sys.exit(main()) From caa0634df88949985bd1c18ec99d8a07960c4407 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 7 Nov 2014 20:51:25 +0800 Subject: [PATCH 2/9] Upload symbols to S3 --- script/upload-windows-pdb.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py index 11b0b0967208..d7da8c13d049 100644 --- a/script/upload-windows-pdb.py +++ b/script/upload-windows-pdb.py @@ -1,8 +1,9 @@ #!/usr/bin/env python import os +import glob -from lib.util import execute, rm_rf, safe_mkdir +from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -21,11 +22,19 @@ def main(): for pdb in PDB_LIST: run_symstore(pdb, SYMBOLS_DIR, 'AtomShell') + bucket, access_key, secret_key = s3_config() + files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb') + upload_symbols(bucket, access_key, secret_key, files) + def run_symstore(pdb, dest, product): execute(['symstore', 'add', '/r', '/f', pdb, '/s', dest, '/t', product]) +def upload_symbols(bucket, access_key, secret_key, files): + s3put(bucket, access_key, secret_key, SYMBOLS_DIR, 'atom-shell/symbols', files) + + if __name__ == '__main__': import sys sys.exit(main()) From 45fb3ec41d5ae36595183ab0baa17811eabb289d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 7 Nov 2014 21:45:40 +0800 Subject: [PATCH 3/9] Don't overwrite files on S3 --- script/lib/util.py | 1 + script/upload.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/script/lib/util.py b/script/lib/util.py index 83c3e05148b4..355fec027c45 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -183,6 +183,7 @@ def s3put(bucket, access_key, secret_key, prefix, key_prefix, files): '--secret_key', secret_key, '--prefix', prefix, '--key_prefix', key_prefix, + '--no_overwrite', '--grant', 'public-read' ] + files diff --git a/script/upload.py b/script/upload.py index 2ad7f5ffd8ef..edfa4c963c97 100755 --- a/script/upload.py +++ b/script/upload.py @@ -59,19 +59,19 @@ def main(): upload_atom_shell(github, release_id, os.path.join(DIST_DIR, CHROMEDRIVER_NAME)) - # Upload node's headers to S3. - bucket, access_key, secret_key = s3_config() - upload_node(bucket, access_key, secret_key, ATOM_SHELL_VERSION) - if args.publish_release: - # Press the publish button. - publish_release(github, release_id) + # Upload node's headers to S3. + bucket, access_key, secret_key = s3_config() + upload_node(bucket, access_key, secret_key, ATOM_SHELL_VERSION) # Upload the SHASUMS.txt. execute([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION]) + # Press the publish button. + publish_release(github, release_id) + def parse_args(): parser = argparse.ArgumentParser(description='upload distribution file') From 34521e588055dbcface81ec86191aa9ef9d91cf5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 7 Nov 2014 22:52:00 +0800 Subject: [PATCH 4/9] Upload PDBs to Windows symbol server when publishing --- script/upload.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/upload.py b/script/upload.py index edfa4c963c97..7841017ed11e 100755 --- a/script/upload.py +++ b/script/upload.py @@ -69,6 +69,11 @@ def main(): os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v', ATOM_SHELL_VERSION]) + # Upload PDBs to Windows symbol server. + if TARGET_PLATFORM == 'win32': + execute([sys.executable, + os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')]) + # Press the publish button. publish_release(github, release_id) From 621867e518ecba147774483d05b7f9f3591e971e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 10 Nov 2014 16:09:13 +0800 Subject: [PATCH 5/9] docs: Setting up symbol server in debugger --- docs/README.md | 1 + docs/development/setting-up-symbol-server.md | 56 ++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 docs/development/setting-up-symbol-server.md diff --git a/docs/README.md b/docs/README.md index d22ef38e7238..ed7d803b72da 100644 --- a/docs/README.md +++ b/docs/README.md @@ -56,3 +56,4 @@ Modules for both sides: * [Build instructions (Mac)](development/build-instructions-mac.md) * [Build instructions (Windows)](development/build-instructions-windows.md) * [Build instructions (Linux)](development/build-instructions-linux.md) +* [Setting up symbol server in debugger](development/setting-up-symbol-server.md) diff --git a/docs/development/setting-up-symbol-server.md b/docs/development/setting-up-symbol-server.md new file mode 100644 index 000000000000..3b8b83dc90f0 --- /dev/null +++ b/docs/development/setting-up-symbol-server.md @@ -0,0 +1,56 @@ +# Setting up symbol server in debugger + +Debug symbols allow you to have better debugging sessions. They have information +about the functions contained in executables and dynamic libraries and provide +you with information to get clean call stacks. A Symbol Server allows the +debugger to load the correct symbols, binaries and sources automatically without +forcing users to download large debugging files. The server functions like +[Microsoft's symbol server](http://support.microsoft.com/kb/311503) so the +documentation there can be useful. + +Note that because released atom-shell builds are heavily optimized, debugging is +not always easy. The debugger will not be able to show you the content of all +variables and the execution path can seem strange because of inlining, tail +calls, and other compiler optimizations. The only workaround is to build an +unoptimized local build. + +The official symbol server URL for atom-shell is +http://symbols.mozilla.org/firefox. +You cannot visit this URL directly: you must add it to the symbol path of your +debugging tool. In the examples below, a local cache directory is used to avoid +repeatedly fetching the PDB from the server. Replace `c:\code\symbols` with an +appropriate cache directory on your machine. + +## Using the symbol server in Windbg + +The Windbg symbol path is configured with a string value delimited with asterisk +characters. To use only the atom-shell symbol server, add the following entry to +your symbol path (__note:__ you can replace `c:\code\symbols` with any writable +directory on your computer, if you'd prefer a different location for downloaded +symbols): + +``` +SRV*c:\code\symbols\*http://symbols.mozilla.org/firefox +``` + +Set this string as `_NT_SYMBOL_PATH` in the environment, using the Windbg menus, +or by typing the `.sympath` command. If you would like to get symbols from +Microsoft's symbol server as well, you should list that first: + +``` +SRV*c:\code\symbols\*http://msdl.microsoft.com/download/symbols;SRV*c:\code\symbols\*http://symbols.mozilla.org/firefox +``` + +## Using the symbol server in Visual Studio + + + + +## Troubleshooting: Symbols will not load + +Type the following commands in Windbg to print why symbols are not loading: + +``` +> !sym noisy +> .reload /f chromiumcontent.dll +``` From e5e94ed437d6a2a63d748f26374b2b192f44156d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 10 Nov 2014 23:02:54 +0800 Subject: [PATCH 6/9] Add execution bit --- script/upload-windows-pdb.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 script/upload-windows-pdb.py diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py old mode 100644 new mode 100755 From 6d663d1d0172b716e0dccc1f617b5a09b2905b67 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 10 Nov 2014 23:07:57 +0800 Subject: [PATCH 7/9] Use lowercase for symbol paths --- script/upload-windows-pdb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py index d7da8c13d049..c3e6863e50d2 100755 --- a/script/upload-windows-pdb.py +++ b/script/upload-windows-pdb.py @@ -24,6 +24,7 @@ def main(): bucket, access_key, secret_key = s3_config() files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb') + files = [f.lower() for f in files] upload_symbols(bucket, access_key, secret_key, files) From 4a1b6d76b2d4ebbe0b0b7a9dcac43d43e6eca73a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 10 Nov 2014 23:24:13 +0800 Subject: [PATCH 8/9] docs: Update symbol server address --- docs/development/setting-up-symbol-server.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/development/setting-up-symbol-server.md b/docs/development/setting-up-symbol-server.md index 3b8b83dc90f0..b69c0df02827 100644 --- a/docs/development/setting-up-symbol-server.md +++ b/docs/development/setting-up-symbol-server.md @@ -15,7 +15,7 @@ calls, and other compiler optimizations. The only workaround is to build an unoptimized local build. The official symbol server URL for atom-shell is -http://symbols.mozilla.org/firefox. +http://54.249.141.255:8086/atom-shell/symbols. You cannot visit this URL directly: you must add it to the symbol path of your debugging tool. In the examples below, a local cache directory is used to avoid repeatedly fetching the PDB from the server. Replace `c:\code\symbols` with an @@ -30,7 +30,7 @@ directory on your computer, if you'd prefer a different location for downloaded symbols): ``` -SRV*c:\code\symbols\*http://symbols.mozilla.org/firefox +SRV*c:\code\symbols\*http://54.249.141.255:8086/atom-shell/symbols ``` Set this string as `_NT_SYMBOL_PATH` in the environment, using the Windbg menus, @@ -38,7 +38,7 @@ or by typing the `.sympath` command. If you would like to get symbols from Microsoft's symbol server as well, you should list that first: ``` -SRV*c:\code\symbols\*http://msdl.microsoft.com/download/symbols;SRV*c:\code\symbols\*http://symbols.mozilla.org/firefox +SRV*c:\code\symbols\*http://msdl.microsoft.com/download/symbols;SRV*c:\code\symbols\*http://54.249.141.255:8086/atom-shell/symbols ``` ## Using the symbol server in Visual Studio From 90480fff4e2ad72efec8f2c97f01b3793b8dde42 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 10 Nov 2014 23:33:56 +0800 Subject: [PATCH 9/9] Fix pylint warnings --- script/upload-windows-pdb.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py index c3e6863e50d2..e03e2bcfac7c 100755 --- a/script/upload-windows-pdb.py +++ b/script/upload-windows-pdb.py @@ -8,9 +8,10 @@ from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SYMBOLS_DIR = 'dist\\symbols' +DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent' PDB_LIST = [ 'out\\Release\\atom.exe.pdb', - 'vendor\\brightray\\vendor\\download\\libchromiumcontent\\Release\\chromiumcontent.dll.pdb', + DOWNLOAD_DIR + '\\Release\\chromiumcontent.dll.pdb', ] @@ -33,7 +34,8 @@ def run_symstore(pdb, dest, product): def upload_symbols(bucket, access_key, secret_key, files): - s3put(bucket, access_key, secret_key, SYMBOLS_DIR, 'atom-shell/symbols', files) + s3put(bucket, access_key, secret_key, SYMBOLS_DIR, 'atom-shell/symbols', + files) if __name__ == '__main__':