Changeset 118038 in webkit


Ignore:
Timestamp:
May 22, 2012 1:23:44 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] getPlatformThreadRegisters() should fetch target thread's registers
https://bugs.webkit.org/show_bug.cgi?id=87148

Patch by Yong Li <yoli@rim.com> on 2012-05-22
Reviewed by George Staikos.

Our previous implementation of getPlatformThreadRegisters() read registers in current
thread's context but it is supposed to read the target thread's registers.

  • heap/MachineStackMarker.cpp:

(JSC::getPlatformThreadRegisters):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r118030 r118038  
     12012-05-22  Yong Li  <yoli@rim.com>
     2
     3        [BlackBerry] getPlatformThreadRegisters() should fetch target thread's registers
     4        https://bugs.webkit.org/show_bug.cgi?id=87148
     5
     6        Reviewed by George Staikos.
     7
     8        Our previous implementation of getPlatformThreadRegisters() read registers in current
     9        thread's context but it is supposed to read the target thread's registers.
     10
     11        * heap/MachineStackMarker.cpp:
     12        (JSC::getPlatformThreadRegisters):
     13
    1142012-05-05  Filip Pizlo  <fpizlo@apple.com>
    215
  • trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp

    r117340 r118038  
    357357#elif OS(QNX)
    358358    memset(&regs, 0, sizeof(regs));
    359     regs.tid = pthread_self();
    360     int fd = open("/proc/self", O_RDONLY);
     359    regs.tid = platformThread;
     360    // FIXME: If we find this hurts performance, we can consider caching the fd and keeping it open.
     361    int fd = open("/proc/self/as", O_RDONLY);
    361362    if (fd == -1) {
    362         LOG_ERROR("Unable to open /proc/self (errno: %d)", errno);
     363        LOG_ERROR("Unable to open /proc/self/as (errno: %d)", errno);
    363364        CRASH();
    364365    }
    365     devctl(fd, DCMD_PROC_TIDSTATUS, &regs, sizeof(regs), 0);
     366    int rc = devctl(fd, DCMD_PROC_TIDSTATUS, &regs, sizeof(regs), 0);
     367    if (rc != EOK) {
     368        LOG_ERROR("devctl(DCMD_PROC_TIDSTATUS) failed (error: %d)", rc);
     369        CRASH();
     370    }
    366371    close(fd);
     372    return sizeof(struct _debug_thread_info);
    367373#elif USE(PTHREADS)
    368374    pthread_attr_init(&regs);
Note: See TracChangeset for help on using the changeset viewer.