Przeglądaj źródła

Improve breakpad by adding cwd, fix str(last_tb) and dump what is sent to the user.

The user will get an idea of what data is sent.

Getting the current working directory is useful to know what checkout was used.

the repr(last_tb) call was stripping off a lot of useful information for
debugging.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/3384020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@60339 0039d316-1c4b-4281-b951-d872f2087c98
maruel@chromium.org 15 lat temu
rodzic
commit
2379632b67
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      breakpad.py

+ 3 - 1
breakpad.py

@@ -39,12 +39,14 @@ def SendStack(last_tb, stack, url=None):
         'user': getpass.getuser(),
         'user': getpass.getuser(),
         'exception': last_tb,
         'exception': last_tb,
         'host': socket.getfqdn(),
         'host': socket.getfqdn(),
+        'cwd': os.getcwd(),
     }
     }
     try:
     try:
       # That may not always work.
       # That may not always work.
       params['exception'] = str(last_tb)
       params['exception'] = str(last_tb)
     except:
     except:
       pass
       pass
+    print '\n'.join('  %s: %s' % (k, v[0:50]) for k,v in params.iteritems())
     request = urllib.urlopen(url, urllib.urlencode(params))
     request = urllib.urlopen(url, urllib.urlencode(params))
     print request.read()
     print request.read()
     request.close()
     request.close()
@@ -58,7 +60,7 @@ def CheckForException():
   if last_value and not isinstance(last_value, KeyboardInterrupt):
   if last_value and not isinstance(last_value, KeyboardInterrupt):
     last_tb = getattr(sys, 'last_traceback', None)
     last_tb = getattr(sys, 'last_traceback', None)
     if last_tb:
     if last_tb:
-      SendStack(repr(last_value), ''.join(traceback.format_tb(last_tb)))
+      SendStack(last_value, ''.join(traceback.format_tb(last_tb)))
 
 
 
 
 def Register():
 def Register():