Commit Graph

156 Commits

Author SHA1 Message Date
martin
57f2930395 FpDebug: Pause at hardcoded int3
git-svn-id: trunk@63513 -
2020-07-05 19:16:59 +00:00
martin
e55e3eec50 FpDebug: Refactor OnHitBreakpointEvent
git-svn-id: trunk@63512 -
2020-07-05 19:16:56 +00:00
martin
1b2bf99ec1 FpDebug: refactor showing exception details
git-svn-id: trunk@63380 -
2020-06-17 16:52:12 +00:00
martin
a43e155cdb FpDebug, Debuggers, IDE: Make MemManager easier to access. (via Controller and Instance)
git-svn-id: trunk@63358 -
2020-06-16 13:42:42 +00:00
martin
3aff869045 FpDebug: Implemented StepOverTo
git-svn-id: trunk@63304 -
2020-06-06 00:53:46 +00:00
martin
c6680d5c01 FpDebug: Improve Step-over/in when stepping of the last "end" line of a procedure. Always step to next line in caller.
git-svn-id: trunk@63075 -
2020-04-25 13:23:28 +00:00
martin
3370955c2b FpDebug: Fix pause on linux
git-svn-id: trunk@63067 -
2020-04-24 20:08:20 +00:00
martin
11ad3881e8 FpDebug: stepping, avoid double step out.
git-svn-id: trunk@63062 -
2020-04-24 20:08:13 +00:00
martin
074fc3b2f0 FpDebug: Fix "stepped out" detection for step-over/in. Do not stop an "leave" command.
git-svn-id: trunk@63061 -
2020-04-24 20:08:11 +00:00
martin
f2d5fd797b FpDebug: Refactor storing/comparing stack-pointer/frame for step-out detection. Allow different architectures to provide sub-classes
git-svn-id: trunk@63060 -
2020-04-24 20:08:09 +00:00
martin
35706ffaa6 FpDebug: Improve step-commands for threads. Events in other threads, do not need single-stepping
git-svn-id: trunk@63059 -
2020-04-24 20:08:07 +00:00
martin
ec587a8ac1 FpDebug: Refactor internal jump detection
git-svn-id: trunk@63058 -
2020-04-24 20:08:06 +00:00
martin
ea30b6f6b9 FpDebug: Detect internal forwarding jumps, and avoid stopping at them
git-svn-id: trunk@63033 -
2020-04-20 15:31:45 +00:00
martin
840b55b4a8 FpDebug: Fix step out, if current is in prologue / IsSteppedOut did not catch as BasePointer was still on outer proc.
git-svn-id: trunk@63031 -
2020-04-20 12:55:12 +00:00
martin
62facbb44d Renamed TDbgDisassembler class and all related classes to avoid name clashes with FpDebugDebugger classes.
Patch/Contributed by ccrause

git-svn-id: trunk@62757 -
2020-03-12 14:21:17 +00:00
martin
2ee9c0fe84 FpDebug: New TTargetDescriptor type used to store target specific information. All target specific classes are automatically registered in the respective initialization sections. TDbgController.Run modified to call CheckExecutableAndLoadClasses which loads target info from specified file, loads global disassembler instance and DbgProcess class. Patch/Contributed by ccrause
git-svn-id: trunk@62748 -
2020-03-12 14:20:33 +00:00
martin
2e1bd02f2d FpDebug: Refactor OsDbgClasses => move as field to DbgController and DbgProcess / Prepare for target specific classes
git-svn-id: trunk@62747 -
2020-03-12 14:09:16 +00:00
martin
676c17f1cf FpDebug: Refactor disassembler into class
git-svn-id: trunk@62746 -
2020-03-12 14:09:14 +00:00
martin
2282f707cf FpDebug: Fix Command.DoContinue. Do not read DbgThread.GetInstrPtr if the event is caused by another thread. On Linux the none-event thread (belonging to the command) may not be paused/readable.
git-svn-id: trunk@62492 -
2020-01-04 19:02:04 +00:00
martin
a2a811c87c FpDebug: debugln
git-svn-id: trunk@62345 -
2019-12-08 00:18:18 +00:00
martin
489625b121 FpDebug, LazDebuggerFp: Implement step to except/finally / step over ignored exception
git-svn-id: trunk@62344 -
2019-12-08 00:18:17 +00:00
martin
66a5571620 FpDebug: Clean/Remove the duplicate Finished/Handled on TDbgControllerCmd
git-svn-id: trunk@62342 -
2019-12-08 00:18:13 +00:00
martin
b34bc4a730 FpDebug, LazDebuggerFp: Implemented OnLibrary(Un)LoadedEvent / Show in event log
git-svn-id: trunk@62340 -
2019-12-08 00:18:10 +00:00
martin
f64a5f7d3b FpDebug: Rewrite of Step-In/Over/Out. Now handle (end-)stepping after leaving current procedure (i.e step to the outer line end, according to "In" or "Over")
git-svn-id: trunk@62336 -
2019-12-08 00:18:03 +00:00
martin
d506a29b8c FpDebug: Fix a potential double-free
git-svn-id: trunk@62320 -
2019-12-03 19:40:41 +00:00
martin
17dda63638 FpDebug: Refactor freeing thread objects for exited threads
git-svn-id: trunk@62175 -
2019-11-03 17:05:40 +00:00
martin
e5692c88e3 FpDebug: ensure any StackFrame data is cleared on run. (fix displaying old stacktraces)
git-svn-id: trunk@62139 -
2019-10-28 17:07:06 +00:00
martin
ec3e5b6a07 FpDebug: fix crash on nil-deref.
- On Windows FCurrentThread is nil during the ExitProcess event.
- On all platforms CreateThread can (in theory) return nil.

git-svn-id: trunk@62034 -
2019-10-11 12:07:19 +00:00
martin
5ff6c5c0c1 FpDebug: Partial implement WatchPoints.
- No local watches yet. Always global scope.
- Break on Write is the same Read/Write
- Info pop up has no old/new value
- No feedback (in some cases) if watch failed to set

git-svn-id: trunk@61990 -
2019-10-05 11:09:49 +00:00
martin
4020102b98 FpDebug: Refactor Step-Into. No longer use watchpoints.
git-svn-id: trunk@61989 -
2019-10-05 11:09:47 +00:00
martin
a631e91e53 FpDebug: rename TFpInternalBreakpointBase into TFpDbgBreakpoint / Make other packages use TFpDbgBreakpoint instead of internal class.
git-svn-id: trunk@61987 -
2019-10-05 11:09:44 +00:00
martin
3e1d403bae LazDebuggerFp, FpDebug: Attach and Detach (Windows/Linux)
Attach on Linux does not work for apps started with "run without debugging". (Maybe/Probably because the IDE does a separate waitpid on those, and interferes with the waitpid of the debugger?)

git-svn-id: trunk@61967 -
2019-10-03 18:38:10 +00:00
martin
69d200ec8d FpDebug: check if running before scheduling a pause signal (needed so pause can be called when ProcessLoop is not running / but also checks if the loop does a lot of deInternalContinue
git-svn-id: trunk@61966 -
2019-10-03 18:38:08 +00:00
martin
9b5a4935a0 FpDebug: fix wrong type for bound-symbol fields / Enable TypedAddress
git-svn-id: trunk@61918 -
2019-09-24 23:36:37 +00:00
martin
52a25d352c FpDebug: move ...Command.Init into the thread. In case it needs to access process data.
git-svn-id: trunk@61883 -
2019-09-15 13:22:01 +00:00
martin
618ad4ba32 FpDebug: Fix stepping over an breakpoint that continues (condition/auto-continue/...) / Fix stepping over recursive calls
git-svn-id: trunk@61882 -
2019-09-15 13:22:00 +00:00
martin
533670667b FpDebug: Stepping commands, refactor (partly) detection of "call" instruction.
git-svn-id: trunk@61881 -
2019-09-14 14:33:10 +00:00
martin
48f15f849d FpDebug: Stepping commands, refactor HiddenBreakpoint:
- Move to base-class
- No need to check for other breakpoints (fpdebug can now handle several brk at same address)
- Stop step-out, if break failed to set

git-svn-id: trunk@61880 -
2019-09-14 14:33:09 +00:00
martin
c5fe550fbe FpDebug: Stepping commands, set Handled = Finished => so the loop will end if a step is done
git-svn-id: trunk@61878 -
2019-09-14 14:27:48 +00:00
martin
c7fae55176 FpDebug: fix flag for breakpoint
git-svn-id: trunk@61874 -
2019-09-14 14:27:42 +00:00
martin
151412f007 FpDebug: improve stepping.
Refactor: Capture initial data before DoContinue
Fix/Improve: Only check and continue the thread that is stepped / Make HiddenBreakpoint hidden from the rest of the controller.

git-svn-id: trunk@61873 -
2019-09-14 14:27:41 +00:00
martin
f17b2727f4 FpDebug: re-arrange order of some classes
git-svn-id: trunk@61872 -
2019-09-14 14:27:39 +00:00
martin
85a2eb7321 FpDebug: fixed uninitialized var, could prevent debugger from stopping when app exits
git-svn-id: trunk@61869 -
2019-09-13 12:09:32 +00:00
martin
df6722dd5f FpDebug: Ensure that exit thread aborts any running command. (The command may change the event-enum-code in FPDEvent, and try to continue running)
git-svn-id: trunk@61864 -
2019-09-12 15:33:09 +00:00
martin
304f6e7be9 FpDebug: Fix requesting process to pause, broken in r61840 #ece9967721
git-svn-id: trunk@61845 -
2019-09-08 23:33:01 +00:00
martin
ece9967721 FpDebug: Keep the loop running, if internal stepping causes deBreakPoint without actually hitting a breakpoint. Required because now there can be several such singlesteps in one iteration of the loop.
git-svn-id: trunk@61840 -
2019-09-08 19:03:11 +00:00
martin
c86c8d65e6 FpDebug: reduce logged errors for messages that are expected (cannot write to terminated process)
git-svn-id: trunk@61816 -
2019-09-05 20:05:54 +00:00
martin
8874afbe6a FpDebug/LazDebuggerFp: Refactor logging, use LazLogger for all logging.
git-svn-id: trunk@61427 -
2019-06-19 15:26:22 +00:00
martin
88aca89865 FpDebug: More refactor internal breakpoints. More control to OS classes. Improve stopping other threads on Linux
git-svn-id: trunk@60160 -
2019-01-23 21:28:44 +00:00
martin
ba83c710cd FpDebug: Start refactor internal breakpoints. Prepare to allow several breakpoints set at the same address.
git-svn-id: trunk@60123 -
2019-01-20 19:09:46 +00:00
martin
4d203a087c LazDebuggerFp: Fix, Step-over did not stop, if an "auto-continue/none-break" breakpoint was encountered at the end of the step. Fix last commit
git-svn-id: trunk@59817 -
2018-12-13 16:12:04 +00:00
martin
88767bcd81 LazDebuggerFp: Fix, Step-over did not stop, if an "auto-continue/none-break" breakpoint was encountered at the end of the step. (the auto continue took priority over the end-of-step)
git-svn-id: trunk@59816 -
2018-12-13 15:16:32 +00:00
martin
2cace808be LazDebuggerFp, FpDebug: (windows only) implemented switching threads while paused. (On Linux only one thread is currently paused, so switching is not possible)
git-svn-id: trunk@59571 -
2018-11-17 14:16:09 +00:00
martin
84e5ae329a FpDebug: Workaround for dangling thread object
git-svn-id: trunk@59551 -
2018-11-15 22:41:07 +00:00
martin
80defc9157 FpDebug: workaround, prevent loosing the main process, if child processes are created. The Controller needs overall rework to handle multiple attached processes.
git-svn-id: trunk@59546 -
2018-11-15 16:41:46 +00:00
martin
1b9614bd52 FpDebug: fixed a memory leak, when the debugged process forked child processes.
git-svn-id: trunk@59525 -
2018-11-11 23:09:44 +00:00
martin
c54639d227 FpDebug: Allow to specify poNewConsole on windows
git-svn-id: trunk@59488 -
2018-11-07 23:13:11 +00:00
joost
3f08871ce8 fpdebug: Fixed compilation with verbose debugging
git-svn-id: trunk@58416 -
2018-06-26 21:40:16 +00:00
joost
abe6b86bb0 fpdebug: implemented step-out
git-svn-id: trunk@58218 -
2018-06-10 21:03:29 +00:00
joost
1f5eb8d171 fpdebug: Improved handling of threads, removed several assumptions that the main-thread was being debugged
git-svn-id: trunk@58128 -
2018-06-04 21:52:32 +00:00
martin
5562c074da IDE, fpDebug, Debuggers: Deal with source lines that have more than one address (e.g. generics). fpDebug: set breakpoints at all addresses of a line.
git-svn-id: trunk@57782 -
2018-05-03 18:52:41 +00:00
martin
c946f67b86 FPDebugger: Prevent "internal events" (in debug loop) from changing the debugger state. In case of "QuickPause" the flag gets cleared, and the real quick-pause event causes the target to be fully paused. (pause/asm-win, when setting breakpoint while running -> win32 interrupt causes new thread) // TODO: LoadLibrary may have the same issue
git-svn-id: trunk@57779 -
2018-05-03 18:36:02 +00:00
mattias
e7ce75b682 fpdebug: using Windows W functions
git-svn-id: trunk@50617 -
2015-12-04 19:02:39 +00:00
joost
0738480a91 FpDebug: Fixed mem-leak when application closes while debugee is still running
git-svn-id: trunk@48928 -
2015-05-05 07:59:15 +00:00
joost
28faa771f6 FpDebug: The reason why a run failed is not debug information, but real information.
git-svn-id: trunk@48927 -
2015-05-05 07:57:01 +00:00
joost
0923ac9836 FpDebug: - Ability to disable usage of a pseudo-tty
- Ability to supply tty to bind standard input/output to

git-svn-id: trunk@48450 -
2015-03-22 01:08:00 +00:00
joost
bee90dd030 FpDebugger (pure): Same change as in r46136 #4b8e6daa2f, but for step into, to avoid problems in fpc-generated debuginfo
git-svn-id: trunk@46162 -
2014-09-08 19:44:13 +00:00
joost
2725568fae FpDebug: Give a warning when the UUID of the dSym-bundle and the debuggee do not match
git-svn-id: trunk@46149 -
2014-09-07 11:25:34 +00:00
joost
2d61f083f6 FpDebugger (pure): When stepping out of a function on a next, only stop at the first instruction of a line. Just like it is done on step into.
git-svn-id: trunk@46147 -
2014-09-06 20:50:12 +00:00
joost
9070ac0b2c FpDebugger (pure): Added logging, enable with define DBG_FPDEBUG_VERBOSE
git-svn-id: trunk@46143 -
2014-09-06 18:40:30 +00:00
joost
4b8e6daa2f FpDebugger (pure): On a next, only stop if the current instruction is the first instruction of a line. This is to solve a problem in fpcs debuginfo.
git-svn-id: trunk@46136 -
2014-09-05 20:37:43 +00:00
joost
9c5f82c924 FpDebugger (pure): Fixed mem-leak by freeing FProcessMap
git-svn-id: trunk@46101 -
2014-09-01 15:45:36 +00:00
joost
daaa427f54 FpDebugger (pure): Re-direct console output to the terminal-output debug window on Linux
git-svn-id: trunk@46058 -
2014-08-22 15:47:46 +00:00
joost
93aea56c3b FpDebugger (pure): New heuristics for step-into
git-svn-id: trunk@46008 -
2014-08-04 08:14:13 +00:00
joost
be7b70f172 FpDebugger (pure): Re-wrote RunTo using a TDbgControllerCmd
git-svn-id: trunk@45900 -
2014-07-17 18:53:58 +00:00
joost
e5f73f7d0f FpDebuger (pure): Fix for pausing the debuggee
git-svn-id: trunk@45866 -
2014-07-14 20:28:34 +00:00
joost
eaf0dffc07 FpDebugger (pure): Make step-into work even without having watchpoints available. (Even though it will be slow)
git-svn-id: trunk@45851 -
2014-07-13 10:24:03 +00:00
joost
600fc1036c FpDebugger (pure): Let the memory-manager read memory from within the debugging-thread on Linux.
More fixes for getting the instruction-register on x86_64
Fixxed setting the line-info on Darwin and Linux

git-svn-id: trunk@45817 -
2014-07-08 21:15:04 +00:00
joost
4171928dd9 LazDebuggerFp (pure): Improved handling of step-over/into-line, when a library is loaded, a breakpoint is hit or when stepping out of a procedure.
git-svn-id: trunk@45595 -
2014-06-21 19:10:03 +00:00
joost
843f23eafd LazDebuggerFp (pure): Rewrote/refactored ResolveDebugEvent. As much as possible code moved from the os-specific classes to the general classes. Now TDbgProcess and TDbgThread only handle single-stepping and the handling of breakpoints and exceptions. Other commands (like step-line, step-into-line etc) are implemented as childs of TDbgControllerCmd. All specific handling is done in those classes.
git-svn-id: trunk@45590 -
2014-06-20 15:22:45 +00:00
joost
22e7389619 FpDebugger (pure): Refactored creation of new TDbgThreads
git-svn-id: trunk@45407 -
2014-06-08 18:59:06 +00:00
joost
d3edca108f FpDebugger (pure): Fixed the handling of a debuggee that starts child-processes
git-svn-id: trunk@45391 -
2014-06-08 00:13:50 +00:00
joost
3fb55d6ed6 FpDebug (pure): Added thread-safe loggingsystem with three log-levels. The log-levels dllInfo and dllError are used to show messages/errors in the ide.
The new log-system is used to show a message when there is no dSym-bundle with Dwarf-debug info or if the ide has not enough rights to debug applications. (OS/X)

git-svn-id: trunk@45382 -
2014-06-07 14:27:48 +00:00
joost
b526979d64 FpDebugger (pure): Removed excessive debug-output.
git-svn-id: trunk@45292 -
2014-06-01 19:46:06 +00:00
joost
f25dee1d51 LazDebuggerFp (pure): Exception handling. (no software exceptions)
git-svn-id: trunk@44970 -
2014-05-07 18:32:50 +00:00
joost
31762452ae LazDebuggerFp (pure): Handle working-directory and environment of debuggee
git-svn-id: trunk@44936 -
2014-05-06 19:25:38 +00:00
joost
04283997b4 LazDebuggerFp (pure): Pass arguments to debuggee
git-svn-id: trunk@44928 -
2014-05-05 20:15:42 +00:00
joost
e7779bd476 LazDebuggerFp (pure): Implemented step-into
git-svn-id: trunk@44862 -
2014-04-30 20:44:22 +00:00
joost
36e6e3a257 LazDebuggerFp (pure): Implemented step-out
git-svn-id: trunk@44804 -
2014-04-24 16:06:50 +00:00
joost
056bfcfe4b LazDebuggerFp (pure): When stepping(over) out of a procedure, continue until a new sourceline has been reached.
git-svn-id: trunk@44799 -
2014-04-23 21:00:42 +00:00
joost
577f7954bb LazDebuggerFp (pure): * Raise exception when Stop is called on a non-existing process
* Solved some problems wih logging

git-svn-id: trunk@44791 -
2014-04-23 07:49:12 +00:00
joost
e1881c3f4c LazDebuggerFp (pure): Implemented RunTo
git-svn-id: trunk@44768 -
2014-04-20 11:00:33 +00:00
joost
a69e382e98 LazDebuggerFp (pure): Ability to pause debuggee (Windows)
git-svn-id: trunk@44749 -
2014-04-16 20:19:13 +00:00
joost
86f9de7b2a LazDebuggerFp (pure):
* When a breakpoint is hit, pass the correct breakpoint to the TFpDebugDebugger.
 * Solve an AV when the IDE exits

git-svn-id: trunk@44743 -
2014-04-16 09:15:10 +00:00
joost
acecc4a260 LazDebuggerFp (pure): Implemented step-over (next)
git-svn-id: trunk@44737 -
2014-04-15 19:22:01 +00:00
joost
22b80b3cf5 LazDebuggerFp (pure): StepIntoStr -> StepIntoInstr
git-svn-id: trunk@44728 -
2014-04-14 16:59:05 +00:00
joost
ae35141581 LazDebuggerFp (pure): Implemented StepOverInstr
git-svn-id: trunk@44725 -
2014-04-14 16:39:35 +00:00
joost
0e62389d08 LazDebuggerFp (pure): Fixed single-stepping which was broken since r44690 #14698396ff
git-svn-id: trunk@44703 -
2014-04-12 16:19:20 +00:00
joost
14698396ff LazDebuggerFp (pure): Fixed AV on Windows
git-svn-id: trunk@44690 -
2014-04-11 21:13:20 +00:00
joost
98f4a08663 LazDebuggerFp (pure): Fixed single-stepping on OS/X
git-svn-id: trunk@44685 -
2014-04-11 20:06:36 +00:00