Android Studio threaded debugging

前端 未结 2 1094
感情败类
感情败类 2020-12-13 17:24

I\'ve been having trouble debugging a multithreaded app with Android Studio 1.1. It seems as if when a breakpoint is hit all other threads also stop, not just the one with t

2条回答
  •  死守一世寂寞
    2020-12-13 18:07

    In Android Studio, it's possible to specify whether a given breakpoint will suspend execution of just the executing thread (that triggers the breakpoint) or all threads. This is on a per-breakpoint basis (i.e. some breakpoints can suspend all threads, while others only suspend the current thread).

    Right-click on a breakpoint to bring up the Breakpoint Properties window:

    Note the 'Make Default' option which allows this to be defaulted for all newly created breakpoints.

    If only the current thread is suspended (option "Thread" in the image above), then the stack-frame of other unsuspended threads will not be visible in the Frames window:

提交回复
热议问题