Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • src
  • Reactor
  • ReactorDebugInfo.cpp
Find file
BlameHistoryPermalink
  • Antonio Maiorano's avatar
    Fix ReactorDebugInfo off by one line issues · 6a8a7498
    Antonio Maiorano authored Jul 21, 2020
    Before this commit, when debugging with the ReactorDebugInfo feature,
    variables were being incorrectly displayed in the debugger. For
    instance, given:
    
    Int a = 1;
    Int b = 2;
    
    The debugger would not display 'a', and would display 'b' as containing
    the value '1'. The reason for this was that while the Int constructor
    for 'a' was executing, we invoke boost::stacktrace() to determine the
    variable's source location (file and line number); however, the stack
    trace would return the return address of the constructor call, which
    would be on the next line -- that of 'Int b'.
    
    To fix this, knowing that all ReactorDebugInfo emits come from function
    calls in Reactor code, we assume that all backtrace addresses point to
    the next instruction following the call, thus we subtract 1 from these
    addresses. When resolving the file and line number, this gets back the
    previous instruction's location. There are likely corner cases where
    this doesn't work, but it's better than what we have now.
    
    Bug: b/161821289
    Change-Id: Ie92ead393f321fc1a26fc019d6450bfddb7a5e24
    Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/46868Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
    Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
    Kokoro-Result: kokoro <noreply+kokoro@google.com>
    Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
    6a8a7498
ReactorDebugInfo.cpp 3.71 KB
EditWeb IDE
×

Replace ReactorDebugInfo.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.