DebugSessionLinux is common base class for all linux dbgUMD
implementations. This patch also moves DrmHelper to common debug folder
Related-to: NEO-8404
Signed-off-by: Brandon Yates <brandon.yates@intel.com>
Rename to DebugSessionLinuxi915 in preparation
for implementation of Xe debugger
Related-to: NEO-8404
Signed-off-by: Brandon Yates <brandon.yates@intel.com>
When a thread is stopped due to potential page fault
we must check AIP against start IP to ensure it is not
a newly started thread accidentally caught by PF algorithm
Related-to: NEO-8617
Signed-off-by: Brandon Yates <brandon.yates@intel.com>
- do not allocate state save area every time attention event
is handled
- keep allocated memory for subsequent events
- remove not needed DBEUG_BREAK
Related-To: NEO-8183
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- check threads with attention state before reading SR_IDENT
- memory read is costly, for threads already in stopped state
there is no need to read sr_ident and check thread state again
- single stepping one thread performance is substantially improved,
by the factor of 6x
Related-To: NEO-8183
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- all bos from Module must have requireImmediateBinding
flag set
- this change fixes hang in debugger - where MODULE LOAD event
was not sent
Resolves: NEO-8121
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- reading state save area for every threads takes too long when all
application threads have completed and there are stale ATT events to
process
- on detach gdb seemed to be frozen waiting for ATT event to be handled
- fix is to read state save area once - and check SIP counter for every
thread in ATT bitmask
Related-To: NEO-7897
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- when no threads are executing, interrupt all may fail and debug break
fires - although error is handled and correct event is returned. To
prevent abort, debug break has to be removed
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- before marking interrupt request check exception reason. If there is
exception other than forced exception or forced external halt treat
thread as stopped and generate distinct event for it.
Related-To: NEO-7869
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- check threads with ATT only when more than one thread is resumed
- if single thread is resumed - check only that thread
- delay thread state check - allowing thread to reenter SIP
Related-To: NEO-7750
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- make sure to capture all threads after interrupt, also those that
could be lagging to enter SIP
Related-To: NEO-7776
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
Single-stepping threads is based on resume() and THREAD_STOPPED events
To speed up single-stepping, stopped threads must be discovered
immediately after resume() is called.
This change is adding ATT scan and event generation in resume()
Related-To: NEO-7750
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
Change IoctlHelper::ioctl function to return int.
Change IoctlHelper::createGemExt function to return int.
Change IoctlHelper::queryDistances function to return int.
Change UuidRegisterResult::retVal type to int32_t.
Rename res to ret in debug_session.cpp for consistency.
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
- getInternalEvent() should wait on cv that is notified when new event is
read
- this change speeds up application execution under debugger
- refactor unit tests - do not start async thread in ults when not
needed , use synchronous read mode instead
Related-To: NEO-7641
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- do not trigger incorrect / spurious events from internal modules
for debugger
- do not register Elf for internal modules
Related-To: NEO-7605
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
Some L0 debug CTSs intentionnally written to exit w/o proper
resource clenup, f.e do not call zetDebugDetach() etc.
On windows it could be the situation when cleanup of DebugSession is
called in context of DllMain(DLL_PROCESS_DETACH).
At this point all threads other then main already terminated by Windows,
see remarks for DLL_PROCESS_DETACH in
https://learn.microsoft.com/en-us/windows/win32/dlls/dllmain
In this case worker thread object still exists, handle and Id are not
null but corresponding Windows thread does not exist any more and
application waits forever for threadFinished variable. We can safely
omit this waiting since join() will either return immediately in case of
thread was killed by Windows or wait until thread is terminated in normal way.
Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
- pass deviceIndex based on deviceBitfield
- do not call ioctl again on EBUSY error
Resolves: NEO-7414
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
Move Linux DebugSession thread conversion functions up to
DebugSessionImp to allow reuse in windows implementation
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
Related-To: NEO-7366
- if VM BIND comes with VM that cannot be mapped to tile,
push the event to pending events and process next events
until context params event with comes
- when pending event is handled - remove it from queue
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- all tileInstanced ISAs must be received before sending
MODULE LOAD/UNLOAD events for zebin modules
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
- enable tile attach mode by default
- both root device and subdevice may be attached to
Related-To: NEO-7347
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>