IDE Window: Breakpoints/ru: Difference between revisions
From Free Pascal wiki
Jump to navigationJump to search
Line 20: | Line 20: | ||
;Data/Watch Breakpoint: указывается посредством имени переменной. Выполнение будет прервано при изменении переменной. Он также может обнаружить доступ для чтения. Поддержка этого зависит от используемой платформы. | ;Data/Watch Breakpoint: указывается посредством имени переменной. Выполнение будет прервано при изменении переменной. Он также может обнаружить доступ для чтения. Поддержка этого зависит от используемой платформы. | ||
== | == Отображение данных == | ||
;State: | ;State (состояние): Точка останова может быть включена или отключена. Если она включена, то каждый раз, когда программа достигает точки останова, проверяется условие и, если результаты верны, будут выполняться действия, заданные для точки останова. | ||
;Filename/Address<br>Line/Length: | ;Filename/Address (имя файла/адрес)<br>Line/Length (строка/позиция): в зависимости от типа точки останова отображается следующее: | ||
:*<u>Source Breakpoint:</u><br>Filename/Address: | :*<u>Source Breakpoint:</u><br>Filename/Address: имя файла, в котором установлена точка останова.<br> Line/Length: Имя файла, в котором задана точка останова. | ||
:*<u>Address Breakpoint:</u><br>Filename/Address | :*<u>Address Breakpoint:</u><br>Filename/Address: адрес точки останова. Этот тип точки останова полезен, если нет доступного исходника. <br> Line/Length: пусто | ||
:*<u>Data Breakpoint:</u><br>Filename/Address: | :*<u>Data Breakpoint:</u><br>Filename/Address: имя переменной <br> Line/Length: покажет область ("Global" / "Declaration") и режим ("Read" / "Write" / "Read/Write") | ||
;Condition: | ;Condition (условие): обычно достигнутая точка останова выполняет прерывание(я) выполнения кода. Когда условие определено, это условие оценивается. Если это условие оценивается как True (истина), выполняются действие(я) прерывания выполнения кода. | ||
;Action: The following actions are available: Break, Enable/Disable group(s), Log message, Evaluate expression, Ignore/Handle Exceptions. A complete description of these actions can be found on the [[IDE Window:Breakpoint properties|Breakpoint properties]] page. | ;Action: The following actions are available: Break, Enable/Disable group(s), Log message, Evaluate expression, Ignore/Handle Exceptions. A complete description of these actions can be found on the [[IDE Window:Breakpoint properties|Breakpoint properties]] page. |
Revision as of 17:52, 5 December 2019
│
Deutsch (de) │
English (en) │
français (fr) │
русский (ru) │
Важно
Вы должны настроить отладчик и запустить проект для его отладки. Только тогда это окно будет полезным.
Примечание: О точках наблюдения:
- При настройке точки наблюдения переменная, которая будет отслеживаться, должна находиться в области видимости. (То есть программа должна быть запущена и остановлена в точке останова, где можно увидеть переменную).
- По этой причине точки наблюдения действительны только до выхода из приложения и затем будут отключены. При следующей отладке они должны быть снова включены при остановке в том месте, где оно находится в области видимости.
Список точек останова
Существует 3 вида точек останова:
- Source Breakpoint
- указывается посредством имени модуля и номера строки. Выполнение будет прервано до выполнения оператора pascal в указанной строке. Может быть установлен щелчком по выемке слева в редакторе исходного кода.
- Address Breakpoint
- указывается посредством адресу. Выполнение будет прервано до выполнения оператора ассемблера по адресу. Можно установить, щелкнув по выемке слева в окне дизассемблера.
- Data/Watch Breakpoint
- указывается посредством имени переменной. Выполнение будет прервано при изменении переменной. Он также может обнаружить доступ для чтения. Поддержка этого зависит от используемой платформы.
Отображение данных
- State (состояние)
- Точка останова может быть включена или отключена. Если она включена, то каждый раз, когда программа достигает точки останова, проверяется условие и, если результаты верны, будут выполняться действия, заданные для точки останова.
- Filename/Address (имя файла/адрес)
Line/Length (строка/позиция): в зависимости от типа точки останова отображается следующее: -
- Source Breakpoint:
Filename/Address: имя файла, в котором установлена точка останова.
Line/Length: Имя файла, в котором задана точка останова. - Address Breakpoint:
Filename/Address: адрес точки останова. Этот тип точки останова полезен, если нет доступного исходника.
Line/Length: пусто - Data Breakpoint:
Filename/Address: имя переменной
Line/Length: покажет область ("Global" / "Declaration") и режим ("Read" / "Write" / "Read/Write")
- Source Breakpoint:
- Condition (условие)
- обычно достигнутая точка останова выполняет прерывание(я) выполнения кода. Когда условие определено, это условие оценивается. Если это условие оценивается как True (истина), выполняются действие(я) прерывания выполнения кода.
- Action
- The following actions are available: Break, Enable/Disable group(s), Log message, Evaluate expression, Ignore/Handle Exceptions. A complete description of these actions can be found on the Breakpoint properties page.
- Pass Count
- How many times the enabled breakpoint has been reached. If a "Hitcount" is defined for this breakpoint, the debugger will perform the break action(s) when the hitcount is reached.
- Group
- The group where this breakpoint belongs to. This allows to quickly enabled/disable several breakpoints at once.
Interface
Toolbar
- Enable/ Disable
- Enables/Disables individual breakpoint(s).
- Remove
- Deletes the selected Breakpoint(s)
- Enable all/ Disable all
- Enables/Disables all breakpoints.
- Delete all
- Deletes all Breakpoints
- Properties
- Change the properties of the current/selected breakpoint.
Context menu
- View Source
- Jump to the source. (Only Source-Breakpoints)
- Add
- Opens a property dialog for the requested type of breakpoint. The location/address/variable can be set in the property dialog.
- Enabled
- Toggle the enabled state for individual breakpoint(s)
- Delete
- Deletes the selected Breakpoint(s)
- Group
- Clears or sets the group for the breakpoint. A list of existing groups will be in the menu. With "Set new group" a new group can be created.
- Enable all/Disable all
- Enables/Disables all breakpoints.
- Delete all
- Deletes all Breakpoints
- Disable all in same source/Enable all in same source
- Enables/Disables all breakpoints in the same unit as the current selected breakpoint. (Only Source-Breakpoints)
- Delete all in same source
- Deletes all Breakpoints in the same unit as the current selected breakpoint. (Only Source-Breakpoints)
Breakpoint properties
- Filename/Line
- Location of the breakpoint
- Condition
- The breakpoint will only be triggered and perform the specified actions, if the condition evaluates to true. This can for example be used to test if a variable has reached a critical value.
Currently only very basic expressions are allowed. (GDB must be able to understand the expression) - NOTE #1: The IDE does only apply a very limited pascal syntax fixing to the condition (#48 is escaped as char with ord val 48), so it needs to be C-like, so GDB understands the expression. eg: "i=2" or somechar='a'. Remember that the string (or rather char) value must be wrapper in single quotes, not double quotes.
- NOTE #2:
Strings can not be compared. They are seen as pchar, so they can only be compared to an address: "str=0x5a0b40".Chars in a string can be compared (index is zero based/pchar) "(s[0]='a')and(s[1]='b')". And strings can be compared as PChar (zero terminated): $_streq(^char(MyString), "ValueToCompare") (with double quotes) See: https://sourceware.org/gdb/current/onlinedocs/gdb/Convenience-Funs.html#Convenience-Funs - HitCount
- The breakpoint will be ignored until it has been hit the specified amount of times. One scenario where this is useful, if an event is triggered by the focus change (between IDE and debugged app) when the app is paused/resumed. The ignored passes of the breakpoint to not alter the focus.
- NOTE: #1 The hitcount starts at 0. So if you want to break on the 10th iteration, set the HitCount to 9.
- NOTE: #2 The hit count doesn't reset until you stop/start the debugging or actually delete the breakpoint and set it again (without the need to stop/start the debug session).
- Auto continue after
- This also avoids the focus change between IDE and app. It however indicates the execution line in the source editor, which leads to a visible indication. If the time is long enough watches might be evaluated.
- Group
- A breakpoint can be is one group (one only). Groups can be used with the Enable/Disable group feature.
- Actions
-
- Break: Pause the application. The application can be continued with the Run command or any of the stepping commands
- Enable/Disable Group: Enable or Disable all breakpoints in the given group(s). Usually 2 breakpoints would be set, one to enable, the other to disable. The breakpoints in the specified groups could then be enabled (or disabled) only, if they occur between the 2 points. The breakpoints that are changed could be in subroutines, that are called sometimes between the 2 points, but also from other locations.
- Eval Expression: Evaluates the expression and writes the value to the debug event log
- Log Message: Writes the message to the debug event log
- Log Callstack: Writes the callstack to the debug event log
- Take a snapshot: Evaluates all Watches, Locals, Callstack, Threads, and adds it to the snapshots in the History dialog.