Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 History  





2 Types of breakpoints  



2.1  Machine breakpoints  





2.2  Non-interactive breakpoints  





2.3  Interactive breakpoints  





2.4  Conditional breakpoints  





2.5  Inspection tools  





2.6  Logpoints  







3 Implementations  



3.1  Hardware  





3.2  Software  







4 See also  





5 References  














Breakpoint






Azərbaycanca
Català
Čeština
Deutsch
فارسی
Français

Italiano
עברית
Nederlands

Occitan
Олык марий
Polski
Português
Русский
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


The debugging interface of Eclipse with a program suspended at a breakpoint. Panels with stack trace (upper left) and watched variables (upper right) can be seen.

Insoftware development, a breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. It is also sometimes simply referred to as a pause.

More generally, a breakpoint is a means of acquiring knowledge about a program during its execution. During the interruption, the programmer inspects the test environment (general-purpose registers, memory, logs, files, etc.) to find out whether the program is functioning as expected. In practice, a breakpoint consists of one or more conditions that determine when a program's execution should be interrupted.

History

[edit]

Breakpoints were invented for ENIAC, one of the earliest digital computers, by programmer Betty Holberton.[1] In the initial design of ENIAC, program flow was set by plugging cables from one unit to another. To make the program stop at a certain point, a cable was removed, called a breakpoint.[2]

Types of breakpoints

[edit]

Machine breakpoints

[edit]

Early mainframe computers, such as the IBM/360, had console switches/dials that allowed breakpoints at specific instruction storage addresses and provided "single cycle" operation, permitting the contents of registers and memory to be observed directly on console lights. The advent of multitasking limited the use of this option since the entire machine was halted.

Non-interactive breakpoints

[edit]

Programmers have used machine code patches to implement single destructive breakpoints to cause a core dump since the early days of computers. The core dump provided the state of the registers and memory at the exact moment of the deliberate "crash".

Interactive breakpoints

[edit]

The advent of teletypewriter consoles in the 1960s allowed more interactive command line debugging capabilities but it was not until the early 1970s and the arrival of ubiquitous video monitors connected to mainframes that fully interactive, full screen debugging in multitasking environments became a reality. This also permitted step-by-step program execution in a true program animation manner with optional register and memory alterations simultaneously displayed. Initially this type of animation was at the level of disassembledordecompiled machine code, but later advanced to HLL source level animation.

Conditional breakpoints

[edit]

Breakpoints are most commonly used to interrupt a running program immediately before the execution of a programmer-specified instruction. This is often referred to as an instruction breakpoint.

Other kinds of conditions can also be used, such as the reading, writing, or modification of a specific location in an area of memory. This is often referred to as a data breakpoint, or a watchpoint. Many systems also support breakpoints that are only active if a condition is met (such as a variable having a certain value), usually referred to as conditional breakpoint.[3]

Inspection tools

[edit]

When a breakpoint is hit, various tools are used to inspect the state of the program or alter it. Stack trace of each thread may be used to see the chain of function calls that led to the paused instruction. A list of watches allows one to view the values of selected variables and expressions. There may also be tools to show the contents of registers, loaded program modules and other information.

Logpoints

[edit]

Alogpoint is a type of breakpoint that only prints (or"logs") information instead of interrupting execution. Usually the developer can specify a message and/or values of variables to print when execution reaches a specific point.[4] Logpoints are an alternative to putting logging statements into the program being debugged (sometimes called printf debugging), and particularly helpful when changing the program is not practical (for example when debugging an external library called by the program).

Implementations

[edit]

Hardware

[edit]

Many processors include hardware support for breakpoints (typically instruction and data breakpoints). As an example, the x86 instruction set architecture provides hardware support for breakpoints with its x86 debug registers. Such hardware may include limitations, for example not allowing breakpoints on instructions located in branch delay slots. This kind of limitation is imposed by the microarchitecture of the processor and varies from processor to processor.

Software

[edit]

Without hardware support (and in multitasking environments), debuggers have to implement breakpoints in software. For instruction breakpoints, this is a comparatively simple task of replacing the instruction at the location of the breakpoint by either:

This technique may be more difficult to implement in multitasking systems using shared program storage (the interrupt may occur on a different thread, requiring resurrection of the original instruction for that thread). Also, if the program resides in protected memory, overwriting of instructions may be prevented.

Alternatively,

Some debuggers allow registers or program variables in memory to be modified before resuming, effectively allowing the introduction of "hand-coded" temporary assignments for test purposes. Similarly, program instructions can often be skipped to determine the effect of changes to the program logic – enabling questions about program execution to be answered in a direct way (i.e. without assumptions or guesswork). In many cases it may be the only practical method of testing obscure "event-driven" error subroutines that rarely, if ever, get executed – without the added risk of leaving temporary source changes. Manually changing the resume location within a paused program can be used to enter an otherwise rarely executed section of code (such as a specific hardware condition handler).

Implementing data breakpoints in software however, can greatly reduce the performance of the application being debugged – since it is using additional resources on the same processor.[5] However, this is normally acceptable during testing and the amount of information available from the debugger is not restricted by limitations of debug data known to the hardware. For instance, a software implementation can collect logical path data at program/subroutine/instruction level to considerably augment what might be stored by the particular hardware platform for inspection. The instruction set simulation method considerably reduces the overhead, compared to the (repeated) instruction replacement method, also reducing cache misses.

Some programming language implementations expose their debugging functions for use by other programs. For example, some FORTRAN dialects have an AT statement, which was originally intended to act as an instruction breakpoint. Python implements a debugger accessible from a Python program.[6] These facilities can be and are[7] abused to act like the COMEFROM statement.

See also

[edit]

References

[edit]
  1. ^ Abbate, Janet (2012), Recoding Gender: Women's Changing Participation in Computing, MIT Press, p. 32, ISBN 9780262018067
  • ^ Thomas Haigh; Mark Priestley; Crispen Rope (2016). ENIAC in Action:Making and Remaking the Modern Computer. MIT Press. p. 153. ISBN 978-0-262-03398-5.
  • ^ "FAQ How do I set a conditional breakpoint?". Eclipse Wiki. Retrieved 2023-04-19.
  • ^ Walsh, David (2021-03-22). "Use Logpoints!". David Walsh Blog. Retrieved 2023-04-19.
  • ^ GDB Internals Archived November 29, 2011, at the Wayback Machine
  • ^ Python Library Reference: The Python Debugger Archived September 13, 2008, at the Wayback Machine
  • ^ entrian.com – goto and comefrom for Python

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Breakpoint&oldid=1184075519"

    Category: 
    Debugging
    Hidden categories: 
    Webarchive template wayback links
    Articles with short description
    Short description is different from Wikidata
     



    This page was last edited on 8 November 2023, at 05:12 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki