Bug 138564

Summary: [GTK] fix up the GDB backtrace report tool
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: Tools / TestsAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cgarcia, clopez, commit-queue, glenn, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch cgarcia: review+

Description Philippe Normand 2014-11-10 05:12:57 PST
See also Bug 128928 but for now I'll only restore the basic functionality without making too many changes.
Comment 1 Philippe Normand 2014-11-10 05:22:41 PST
Created attachment 241286 [details]
Patch
Comment 2 Carlos Garcia Campos 2014-11-11 00:53:21 PST
Comment on attachment 241286 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=241286&action=review

LGTM

> Tools/Scripts/webkitpy/port/linux_get_crash_log.py:44
> -        cmd = ['gdb', '-ex', 'thread apply all bt 1024', '--batch', str(self._path_to_driver()), coredump_path]
> +        process_name = os.path.join(os.path.dirname(str(self._path_to_driver())), self.name)
> +        cmd = ['gdb', '-ex', 'thread apply all bt 1024', '--batch', process_name, coredump_path]

why do you need str()? the path to driver should be a str already, otherwise it would be None, but in that case gdb will fail anyway. Wouldn't it be easier to pass bin_dir directly to GDBCrashLogGenerator instead of passing the driver only path to get its dirname?
Comment 3 Philippe Normand 2014-11-11 01:02:44 PST
Committed r175867: <http://trac.webkit.org/changeset/175867>
Comment 4 Philippe Normand 2014-11-11 01:05:58 PST
(In reply to comment #2)
> Comment on attachment 241286 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241286&action=review
> 
> LGTM
> 
> > Tools/Scripts/webkitpy/port/linux_get_crash_log.py:44
> > -        cmd = ['gdb', '-ex', 'thread apply all bt 1024', '--batch', str(self._path_to_driver()), coredump_path]
> > +        process_name = os.path.join(os.path.dirname(str(self._path_to_driver())), self.name)
> > +        cmd = ['gdb', '-ex', 'thread apply all bt 1024', '--batch', process_name, coredump_path]
> 
> why do you need str()? the path to driver should be a str already, otherwise
> it would be None, but in that case gdb will fail anyway. Wouldn't it be
> easier to pass bin_dir directly to GDBCrashLogGenerator instead of passing
> the driver only path to get its dirname?

Might be for unit-tests purposes. Anyway I didn't want to make too many changes in this patch, perhaps this could be fixed along in bug 128928.