Branch: refs/heads/master Author: Dimitar Zhekov dimitar.zhekov@gmail.com Committer: Dimitar Zhekov dimitar.zhekov@gmail.com Date: Sat, 08 Dec 2012 18:46:34 UTC Commit: 3c99c1a53666c6fd919ef9b1bfca9a6a1b1baace https://github.com/geany/geany-plugins/commit/3c99c1a53666c6fd919ef9b1bfca9a...
Log Message: ----------- scope - initial commit
Modified Paths: -------------- MAINTAINERS Makefile.am README build/scope.m4 configure.ac scope/AUTHORS scope/COPYING scope/ChangeLog scope/Makefile.am scope/NEWS scope/NOTES scope/README scope/TODO scope/data/BreakPoint.png scope/data/BreakPoint22.png scope/data/Continue.png scope/data/Continue22.png scope/data/Continue24.png scope/data/Kill.png scope/data/Kill22.png scope/data/Kill24.png scope/data/Makefile.am scope/data/Pause.png scope/data/Pause22.png scope/data/Pause24.png scope/data/RunToCursor.png scope/data/RunToCursor22.png scope/data/RunToCursor24.png scope/data/RunToMethod.png scope/data/RunToMethod22.png scope/data/RunToMethod24.png scope/data/StepInto.png scope/data/StepInto22.png scope/data/StepInto24.png scope/data/StepOut.png scope/data/StepOut22.png scope/data/StepOut24.png scope/data/StepOver.png scope/data/StepOver22.png scope/data/StepOver24.png scope/data/scope.glade scope/docs/Makefile.am scope/docs/codes.html scope/docs/scope.html scope/src/Makefile.am scope/src/break.c scope/src/break.h scope/src/common.h scope/src/conterm.c scope/src/conterm.h scope/src/debug.c scope/src/debug.h scope/src/gtk216.c scope/src/gtk216.h scope/src/inspect.c scope/src/inspect.h scope/src/local.c scope/src/local.h scope/src/menu.c scope/src/menu.h scope/src/parse.c scope/src/parse.h scope/src/plugme.c scope/src/plugme.h scope/src/prefs.c scope/src/prefs.h scope/src/program.c scope/src/program.h scope/src/scope.c scope/src/scope.h scope/src/stack.c scope/src/stack.h scope/src/thread.c scope/src/thread.h scope/src/tooltip.c scope/src/tooltip.h scope/src/utils.c scope/src/utils.h scope/src/views.c scope/src/views.h scope/src/watch.c scope/src/watch.h scope/wscript_build scope/wscript_configure
Modified: MAINTAINERS 6 files changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -156,6 +156,12 @@ M: W: S:
+scope +P: Dimitar Zhekov dimitar.zhekov@gmail.com +M: Dimitar Zhekov dimitar.zhekov@gmail.com +W: http://sheckley.users.sourceforge.net +S: Maintained + shiftcolumn P: M:
Modified: Makefile.am 4 files changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -98,6 +98,10 @@ if ENABLE_PRETTY_PRINTER SUBDIRS += pretty-printer endif
+if ENABLE_SCOPE +SUBDIRS += scope +endif + if ENABLE_SHIFTCOLUMN SUBDIRS += shiftcolumn endif
Modified: README 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -61,6 +61,7 @@ Avaialble plugins are: * gproject -- the GProject plugin * gtkspell -- GeanyVC's spell-check support * pretty_printer -- the pretty-printer plugin +* scope -- the Scope plugin * shiftcolumn -- the ShiftColumn plugin * spellcheck -- the spellcheck plugin * treebrowser -- the Treebrowser plugin
Modified: build/scope.m4 16 files changed, 16 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,16 @@ +AC_DEFUN([GP_CHECK_SCOPE], +[ + GP_ARG_DISABLE([Scope], [yes]) + + GP_CHECK_PLUGIN_DEPS([scope], [VTE], + [vte >= 0.17]) + + GP_STATUS_PLUGIN_ADD([Scope], [$enable_scope]) + + AC_CONFIG_FILES([ + scope/Makefile + scope/data/Makefile + scope/docs/Makefile + scope/src/Makefile + ]) +])
Modified: configure.ac 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -49,6 +49,7 @@ GP_CHECK_GPROJECT GP_CHECK_MARKDOWN GP_CHECK_MULTITERM GP_CHECK_PRETTYPRINTER +GP_CHECK_SCOPE GP_CHECK_SHIFTCOLUMN GP_CHECK_SPELLCHECK GP_CHECK_TREEBROWSER
Modified: scope/AUTHORS 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1 @@ +Dimitar Zhekov dimitar.zhekov@gmail.com
Modified: scope/COPYING 340 files changed, 340 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License.
Modified: scope/ChangeLog 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1 @@ +
Modified: scope/Makefile.am 4 files changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,4 @@ +include $(top_srcdir)/build/vars.auxfiles.mk + +SUBDIRS = src data docs +plugin = scope
Modified: scope/NEWS 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1 @@ +See "ChangeLog"
Modified: scope/NOTES 145 files changed, 145 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,145 @@ +the only way to fix unnecessary inspect drop target expansion is to block +INTO, so deriving GtkTreeStore and altering GtkTreeDragDest make no sense + +"new_children: If new children were added to a dynamic varobj [...]" +"A varobj's contents may be provided by a Python-based pretty-printer +In this case the varobj is known as a dynamic varobj" - not supported + +shift-clicking send/busy to send a command without closing the dialog can be +implemented, but is very ugly; shortcut for GDB command plus typing in the +debug console should suffice + +gtk tooltips send lots of queries, and can't be explicitly shown/hidden; +sci dwell tips often do not disappear as they should; tooltip_update_state +can not be used, because sending the tooltip evaluate command changes state + +under win~1, the async break messages escape all slashes twice; file names +can be handled, but other fields (condition, script) choke parser + +under win~1, if Geany is compiled with -mconsole, gdb stdin/stdout will be +mixed with the program stdin/stdout, leading to gigo + +in foreground execution, GDB waits for the program to report that _some_ +thread has stopped before prompting for another command + +clicking a button with response 0, and then gtk_dialog_response(ACCEPT) via +program code or clicking an accept button, may still generate 0 + +breakpoints don't need unapply: they can be disabled, and all relevant +columns are editable + +-var-create for globals symbols allows any frame +-set-update-range seems to have no effect on my system + +global object may be evaluated (including as variable objects) in hang +state, but modification requires running inferior + +parse with string in VR_COMPACT / VR_NEUTRAL is slower for texts with less +than 100 characters, but with such shorts texts, the difference is +insignificant; with large texts, using string is faster, but not much + +CPU load on F8 with vte console: ~88% +with context: ~80%, null output: ~75% + +win~1 hang with poll_pipe(): 1 second for 3h25m +win~1 send on 50ms: 2 seconds for 1h, 1445 KB sent + +GtkTextView with wrapping CHAR: the last character of a wrapped line can not +be selected with the mouse, keyboard selection is ok + +Geany under Win~1 with FF also running eats 7-8% CPU time other +applications/conditions may cause this CPU load too + +http://sourceware.org/bugzilla/show_bug.cgi?id=9659 + +set print array on: " {1,\n 2,\n 3}" +set print array-indexes on: "{[0] = 1, [1] = 2, [2] = 3}" +set print elements 10: "\a01\002\003\004\005\006\a\b\t\n"... + {290, 291, 292, 293, 294, 295, 296, 297, 298, 299...} +'\000' <repeats 100 times>, '\001' <repeats 100 times> + +GDB does specify that individual breakpoint location may be enabled or +disabled, but not deleted; no mention of condition, ignore, script though + +pending breakpoints are handled either at thread stopped, or by async +modified message; parsing =library-loaded seems pointless + +geany->app->datadir = /usr/local/share/geany +geany->app->docdir = /usr/local/share/doc/geany/html + + break trace watch + +disabled -d -d -break-disable +condition -c -c -break-cond +count -i -break-passcount -break-after + +script = -break-commands +fast trace = -break-insert -a -h + +source files check list: + :break :debug :inspect :local :menu :parse :plugme :prefs + :program :scope :stack :thread :unused :utils :views :watch + +" " is valid executable name, but not valid source name - gdb requires +certain suffixes (.c .c++ etc.); thus we can validate_column(file, TRUE) + +project open: scope message, then geany open message +project close: geany close message, then scope message + +gdb manual states that "which commands will work in the context of a running +thread is highly target dependent", but "commands that try to operate on +thread's stack will not work, on any target"; some commands are ds_sendable +or ds_not_busy, even if unlikely to execute (for example global watchpoint) + +scid is required because the list positions are async-gdb-output volatile + +there is no reason to keep the stack frame selection, the upper-frame values +are unlikely to change + +there is no reason to clear thread list on regular thread info, the async +messages keep it current + +break filename may be specified as known source name (test.c) or absolute +name (/home/build/test.c); names relative to inferior working directory +do not work any more than these relative to gdb directory + +would be nice to have 02-thread-info to fully refresh the thread list, if we +missed a thread message, but needs effort, and we compute gdb status (and +send commands) based on threads, so that's a circular dependency + +gdb recommends full refresh after error but errors in refresh (04) commands +must be ignored to avoid an endless loop + +applying break/watchpoints to a thread is promlematic: -break-list does not +contain such info, and the thread identifiers are different on restart + +tested with "unsuccessful" program pty creation - no idea where the terminal +I/O comes from or goes to + +we don't reload terminal prefs on save settings since they are either empty, +for new file, or old (the signal is before save) + +scite mark "arrow" is actually triangle + +> Run in a debugger with the G_DEBUG env var set to "fatal-warnings", +> so the program will abort and let you see where/when/how it happened. + +-var-list-children expands an expression (or +variable?) with a single command + +-var-delete -c VAR deletes the children only + +-var-info|evaluate-expression for unexpanded? + +--all | --thread-group N commands: + -exec-continue + -exec-interrupt + -exec-run + +"If the `--thread-group' options is specified, then +all threads in that thread group are resumed." + +*stopped "all" means all threads from this group? + +running "all" does not specify a thread; the first running is "all", others +are thread - but that's from experience only, gdb.info says nothing
Modified: scope/README 51 files changed, 51 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,51 @@ +Insert Numbers Plugin +===================== + +About +----- +Scope is a graphical GDB front-end with the normal functions you would +expect (stepping, breakpoints...), and a few notable features: + +- The comminication between Scope and gdb is asynchronous. +- You can enter any gdb command, at any time (of course, for the command to + be executed, gdb must be[come] available). +- All gdb I/O (along with some other messages) is displayed in a + terminal-like "Debug Console". + Whenever you find the GUI lacking, simply switch to that console and work + directly with gdb. +- 7-bit/Locale/UTF-8 support for values. + + +Requirements +------------ +Geany 1.22 or later and the respective libraries, including VTE under *nix. + +GDB 7.3 or later. + +win~1: XP or later. + +GDB manual (recommended). + + +Installation +------------ +This plugin is part of the geany-plugins project. +See the README file of that package. + + +Usage +----- +See the scope.html. + + +License +------- +Scope is distributed under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2 of the License, +or (at your option) any later version. A copy of this license can be found +in the file COPYING included with the source code of this program. + + +Ideas, questions, patches and bug reports +----------------------------------------- +Dimitar Zhekov dimitar.zhekov@gmail.com
Modified: scope/TODO 24 files changed, 24 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,24 @@ +wscript_* + +per-function [ ] Show @entry arguments + +evaluate expressions with quotes + +various tests, source code checks etc. + +ask user for terminate debugging on build actions + +sync gdb thread/frame with the selected ones? + +forbid deselect for threads and stack? + +add clear icon to entries? not very useful + +test inspect new_numchild and in_scope changes + (but with C, these do not seem to change) + +don't remove [index] along if member names? + +Format (natural, decimal...) for Watches? + +libtool support / exec wrapper support
Modified: scope/data/BreakPoint.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/BreakPoint22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Continue.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Continue22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Continue24.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Kill.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Kill22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Kill24.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Makefile.am 32 files changed, 32 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,32 @@ +include $(top_srcdir)/build/vars.docs.mk + +plugin = scope + +dist_plugindata_DATA = \ + BreakPoint.png \ + BreakPoint22.png \ + Continue.png \ + Continue22.png \ + Continue24.png \ + Kill.png \ + Kill22.png \ + Kill24.png \ + Pause.png \ + Pause22.png \ + Pause24.png \ + RunToCursor.png \ + RunToCursor22.png \ + RunToCursor24.png \ + RunToMethod.png \ + RunToMethod22.png \ + RunToMethod24.png \ + StepInto.png \ + StepInto22.png \ + StepInto24.png \ + StepOut.png \ + StepOut22.png \ + StepOut24.png \ + StepOver.png \ + StepOver22.png \ + StepOver24.png \ + scope.glade
Modified: scope/data/Pause.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Pause22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/Pause24.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/RunToCursor.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/RunToCursor22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/RunToCursor24.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/RunToMethod.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/RunToMethod22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/RunToMethod24.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepInto.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepInto22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepInto24.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepOut.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepOut22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepOut24.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepOver.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepOver22.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/StepOver24.png 0 files changed, 0 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/data/scope.glade 3547 files changed, 3547 insertions(+), 0 deletions(-) =================================================================== No diff available, check online
Modified: scope/docs/Makefile.am 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +include $(top_srcdir)/build/vars.docs.mk + +plugin = scope +pluginhtmldocdir = $(plugindocdir)/html + +dist_pluginhtmldoc_DATA = \ + scope.html \ + codes.html
Modified: scope/docs/codes.html 203 files changed, 203 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,203 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>Codes</title> + <style type="text/css"> + .tab { padding-left:1em; } + .nowrap { white-space:nowrap; } + </style> +</head> + +<body> + +<table> + +<tr><td class="nowrap">command</td> + <td class="tab">sent by</td> + <td class="tab">receive action</td></tr> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">016source</td> + <td class="tab">program startup</td> + <td class="tab">apply breaks/inspects, send autorun commands</td></tr> + +<tr><td class="nowrap">015-file-exec-and-symbols</td> + <td class="tab">program startup</td> + <td class="tab">same as 016 if no run script, otherwise nop</td></tr> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">02[01]<scid>-break-disable</td> + <td class="tab">un/check break enabled column</td> + <td class="tab">set breakpoint enabled column, remark breakpoint</td></tr> + +<tr><td class="nowrap">022<id>-break-after</td> + <td class="tab">breakpoint <em>Ignore</em> column edited</td> + <td class="tab"><id>-break-info</td></tr> + +<tr><td class="nowrap">022<id>-break-condition</td> + <td class="tab">breakpoint <em>Condition</em> column edited</td> + <td class="tab">-''-</td></tr> + +<tr><td class="nowrap">022<id>-break-commands</td> + <td class="tab">breakpoint <em>Script</em> column edited</td> + <td class="tab">-''-</td></tr> + +<tr><td class="nowrap">023<id>-break-delete</td> + <td class="tab"><em>Delete</em> or un-<em>Toggle breakpoint</em></td> + <td class="tab">remove breakpoint from the list or clear id</td></tr> + +<tr><td class="nowrap">02-break-list</td> + <td class="tab"><em>Refresh</em> breakpoints</td> + <td class="tab">full breakpoint list refresh (without token is partial)</td></tr> + +<tr><td class="nowrap">02-break-insert -t</td> + <td class="tab">Insert <em>Temporary breakpoint at</em></td> + <td class="tab">mark for discard</td></tr> + +<tr><td class="nowrap">020-break-insert -t</td> + <td class="tab"><em>Run to Cursor</em> in scope mode</td> + <td class="tab">mark for discard and -exec-continue</td></tr> + +<tr><td class="nowrap">02<scid>-break-insert/watch</td> + <td class="tab"><em>Apply</em> watch, initial break apply</td> + <td class="tab">send watch ignore, condition and break/watch script</td></tr> + +<tr><td class="nowrap">025<id>-break-delete</td> + <td class="tab">re-<em>Apply</em> breakpoint (obsolete)</td> + <td class="tab">apply breakpoint (after being deleted in gdb)</td></tr> + +<tr><td class="nowrap">02<tid>-stack-list-frames</td> + <td class="tab"><em>Refresh</em> stack</td> + <td class="tab">clear stack list and load stack frames into it</td></tr> + +<tr><td class="nowrap">02<tid>-stack-list-arguments</td> + <td class="tab"><em>Refresh</em> stack</td> + <td class="tab">fill stack <em>Arguments</em> column</td></tr> + +<tr><td class="nowrap">02<tid><fid>-stack-list-variables</td> + <td class="tab"><em>Refresh</em> locals</td> + <td class="tab">clear locals list and load local variables into it</td></tr> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">03<scid>-data-evaluate-expression</td> + <td class="tab">tooltip hover</td> + <td class="tab">display tooltip or process error</td></tr> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">04-break-list</td> + <td class="tab">views idle update</td> + <td class="tab">same as 02-break-list</td></tr> + +<tr><td class="nowrap">04-thread-info <id></td> + <td class="tab">thread created -> fetch target id</td> + <td class="tab">load thread info into list</td></tr> + +<tr><td class="nowrap">04-thread-info</td> + <td class="tab">views idle update</td> + <td class="tab">(partial) thread list refresh</td></tr> + +<tr><td class="nowrap">04-data-disassemble</td> + <td class="tab">views idle update</td> + <td class="tab">(print instruction in debug console)</td></tr> + +<tr><td class="nowrap">04-var-update</td> + <td class="tab">views idle update</td> + <td class="tab">(partial) inspects update</td></tr> + +<tr><td class="nowrap">04<tid>-stack-list-frames</td> + <td class="tab">views idle update</td> + <td class="tab">same as 02<tid>-stack-list-frames</td></tr> + +<tr><td class="nowrap">04<tid>-stack-list-arguments</td> + <td class="tab">views idle update</td> + <td class="tab">same as 02<tid>-stack-list-arguments</td></tr> + +<tr><td class="nowrap">04<tid><fid>-stack-list-variables</td> + <td class="tab">views idle update</td> + <td class="tab">same as 02<tid>-stack-list-variables</td></tr> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">05</td> + <td class="tab">gdb startup if autorun</td> + <td class="tab">-exec-run if active breaks & no errors</td></tr> + +<tr><td class="nowrap">-''-</td> + <td class="tab">after temp break insert <em>location</em></td> + <td class="tab">-''-</td></tr> + +<tr><td class="nowrap">-''-</td> + <td class="tab">after temp break insert <em>first loc</em></td> + <td class="tab">-''-</td></tr> + +<tr><td class="nowrap">05-list-features</td> + <td class="tab">first time gdb startup</td> + <td class="tab">check for breakpoint-notifications</td> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">06<scid>-data-evaluate-expression</td> + <td class="tab">watch <em>Add</em>, <em>Refresh</em></td> + <td class="tab">set watch <em>Value</em> column to value or error</td></tr> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">07-list-target-features</td> + <td class="tab">each gdb startup</td> + <td class="tab">check for async</td></tr> + +<tr><td class="nowrap">07<scid>-var-create</td> + <td class="tab">auto/manual inspect <em>Apply</em></td> + <td class="tab">set format if non-native, expand if automatic</td></tr> + +<tr><td class="nowrap">07<scid>-var-set-format</td> + <td class="tab">change inspect <em>Format</em></td> + <td class="tab">update inspect value and format</td></tr> + +<tr><td class="nowrap">07<start><scid>-var-list-children</td> + <td class="tab">auto/manual <em>Expand</em> inspect</td> + <td class="tab">insert children, set range if needed</td></tr> + +<tr><td class="nowrap">07<scid>-var-assign</td> + <td class="tab">inspect value column edited</td> + <td class="tab">update inspect value</td></tr> + +<tr><td class="nowrap">070<scid>-var-delete</td> + <td class="tab">un-<em>Apply</em> inspect</td> + <td class="tab">delete all children, clear columns</td></tr> + +<tr><td class="nowrap">071<scid>-var-delete</td> + <td class="tab"><em>Delete</em> inspect</td> + <td class="tab">remove inspect from the tree</td></tr> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">08-gdb-set</td> + <td class="tab">local <em>Modify</em> / <em>Value</em> column edited</td> + <td class="tab">mark locals as dirty</td></tr> + +<tr><td class="nowrap">08<tid>-gdb-set</td> + <td class="tab">08 for arg1 local variable</td> + <td class="tab">08 plus -stack-list-arguments --thread <tid></td></tr> + +<tr><td class="nowrap"> </td><td class="tab"> </td><td class="tab"> </td></tr> + +<tr><td class="nowrap">09<scid>-gdb-set</td> + <td class="tab">watch <em>Modify</em> / <em>Value</em> column edited</td> + <td class="tab">06<scid>-data-evaluate-expression</td></tr> + +<tr><td class="nowrap">09<scid>-data-evaluate-expression</td> + <td class="tab">popup <em>Evaluate/Modify</em></td> + <td class="tab">command dialog with -gdb-set var expr=value</td></tr> + +</table> + +</body> +</html>
Modified: scope/docs/scope.html 679 files changed, 679 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,679 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>Scope</title> + <style type="text/css"> + .tab { padding-left:1em; } + .tab1 { padding-left:1.5em; } + .tab2 { padding-left:2em; } + </style> +</head> + +<body> + +<center><h2>Scope</h2></center> + +<center><h3>A simple GDB front-end</h3></center> + +<p align="right">"We are like dwarfs sitting on the shoulders of giants."<br> +-- Bernard of Chartres</p> + +<hr> + +<h3>Contents</h3> +<ul> +<li><a href="#about">About</a></li> +<li><a href="#requirements">Requirements</a></li> +<li><a href="#quick_start">Quick start</a></li> +<li><a href="#interface">Interface</a><ul> + <li><a href="#debug_menu">Debug menu</a><ul> + <li><a href="#set_program">Setup Program</a></li> + <li><a href="#run_continue">Run/Continue</a></li> + <li><a href="#goto_cursor">Run to cursor</a></li> + <li><a href="#goto_source">Run to source</a></li> + <li><a href="#step_into_over">Step Into / Step Over</a></li> + <li><a href="#terminate">Terminate</a></li> + <li><a href="#gdb_command">GDB Command</a> + <li><a href="#reset_markers">Reset Markers</a></li> + <li><a href="#cleanup_files">Cleanup Files</a></li> + </ul></li> + <li><a href="#debug_panel">Debug panel</a><ul> + <li><a href="#terminal">Program Terminal</a></li> + <li><a href="#threads">Threads</a></li> + <li><a href="#break">Breakpoints</a></li> + <li><a href="#stack">Stack</a></li> + <li><a href="#local">Locals</a></li> + <li><a href="#watch">Watches</a></li> + <li><a href="#local_watch">Locals/Watches</a></li> + <li><a href="#console">Debug Console</a></li> + </ul></li> + <li><a href="#inspect">Inspect page</a></li> +</ul></li> +<li><a href="#preferences">Preferences</a></li> +<li><a href="#notes">Notes</a><ul> + <li><a href="#editing_values">Editing values</a></li> + <li><a href="#keeping_modes">Keeping modes</a></li> + <li><a href="#xos4_colors">Sample dark colors</a></li> +</ul></li> +<li><a href="#pre_faq">Pre-FAQ</a> +<li><a href="#bugs">Bugs</a></li> +<li><a href="#todo">TODO</a></li> +<li><a href="#not_todo">Not TODO</a></li> +<li><a href="#legal_info">Legal information</a><ul> + <li><a href="#license">License</a></li> + <li><a href="#copyright">Copyright</a></li> +</ul></li> +</ul> + +<hr> + +<h3><a name="about">About</a></h3> + +<p>Scope is a graphical <a href="http://www.gnu.org/software/gdb">GDB</a> front-end with the +normal functions you would expect (stepping, breakpoints...), and a few notable features:</p> +<ul> +<li>The comminication between Scope and gdb is asynchronous.</li> +<li>You can enter any gdb command, at any time (of course, for the command to be executed, +gdb must be[come] available).</li> +<li>All gdb I/O (along with some other messages) is displayed in a terminal-like "Debug +Console".<br> +Whenever you find the GUI lacking, simply switch to that console and work directly with +gdb.</li> +<li>7-bit/Locale/UTF-8 support for values.</li> +</ul> + +<p>Scope is currently implemented as a <a href="http://www.geany.org">Geany</a> plugin.</p> + +<p>"Source files" refers to the file types supported by gdb: C/C++, D, Objective C, +Fortran, Java, Pascal, Assembler and Ada (ATM).</p> + +<p>Trivial topics that require neither description nor comment are not included in this +document.</p> + +<hr> + +<h3><a name="requirements">Requirements</a></h3> + +<p>Geany 1.22 or later and the respective libraries, including VTE under *nix.</p> + +<p>GDB 7.3 or later.</p> + +<p>win~1: XP or later.</p> + +<p>GDB manual (recommended).</p> + +<hr> + +<h3><a name="quick_start">Quick start</a></h3> + +<p>From the main Geany menu, invoke <em>Debug --> Setup Program</em> (or <em>Tools --> +Debug --> Setup Program</em>, if there's no <em>Debug</em> in the main menu).<br> +Choose some small executable file compiled with gdb debug information.<br> +Check <em>Temporary breakpoint at</em> and press <em>OK</em>.<br> +Invoke <em>Debug --> Run/Continue</em>.</p> + +<div>If everything went all right, several things will happen:</div> +<div class="tab"> +- A colored <em>Load</em> label will appear shortly on the right of Geany status bar<br> +- The message window will be shown (if hidden) and the <em>Debug</em> page will be focused<br> +- The cursor be positioned at the first line of code, opening the corresponding source file if +neccessary<br> +- The first line of code will be marked with brown arrow in the markers margin, or with brown +background<br> +- All source files will be marked as read-only (their tabs will turn green)<br> +- The <em>Load</em> label will be replaced with a color-less <em>Debug</em>. +</div> + +<p>That's it, you are debugging. Try the other Debug menu commands, select the Debug subpages +from the lower Geany panel etc.</p> + +<hr> + +<h3><a name="interface">Interface</a></h3> + +<p>Consists of:</p> + +<ul> +<li>Debug menu in the main Geany menu, containing the most commonly used commands (running, +stepping, toggle breakpoint etc.) If Scope can't access the main menu, it'll place Debug under +Tools.</li> +<li>Debug page in the lower panel, with subpages that display the program output, threads, +breakpoints etc.</li> +<li>Inspect page in the side panel.</li> +<li>Toolbar items - identical to their Debug menu counterparts.</li> +<li>Command Dialog - to enter gdb commands. Will be closed automatically if gdb exits.</li> +<li>A small label on the right of your Geany status bar, which displays the current debugging +state. The possible states are: +<table border="0"> +<tr><td>(no label)</td><td class="tab">[N]</td><td class="tab">Not debugging.</td></tr> +<tr><td><em>Busy</em><td class="tab">[B]</td><td class="tab">Scope and/or gdb is busy. Any +debugging information may be outdated.<br> +<tr><td><em>Ready</em><td class="tab">[R]</td><td class="tab">GDB is ready to accept commands, +but there is no thread selected, or the currently selected thread is running. The execution +and stack-related commands will be disabled. Other commands may fail to execute, depending on +your target.</td></tr> +<tr><td><em>Debug</em></td><td class="tab">[D]</td><td class="tab">A stopped thread is +selected, and gdb is ready to accept commands. This is the normal debugging state.</td></tr> +<tr><td><em>Assem</em><td class="tab">[D]</td><td class="tab">Like <em>Debug</em>, but the +source location can not be determined. The stepping menu commands will do assembler steps, and +the current assembler instruction will be shown in the debug console each time the thread is +stopped.</td></tr> +<tr><td><em>Hang</em></td><td class="tab">[H]</td><td class="tab">GDB is loaded, but the +program is not started yet, or is already terminated. Scope will automatically switch to this +state in some situations.</td></tr> +<tr><td>(blinking)</td><td class="tab"></td><td class="tab">Loading a program, signal +received, error parsing gdb output, the requested action can not be performed in the current +debug state etc.</td></tr> +</table> +The bracketed letters are used to indicate the states supported by a command. For example, +[RH] means "available in Ready and Hang states only". Debug and Assem are states are almost +identical in this aspect and share [D].</li> +</ul> + +<h3><a name="debug_menu">Debug menu</a></h3> + +<p><b><a name="set_program">Setup Program</a></b></p> + +<p>You can use non-existent <em>Executable</em>, <em>Working dir</em> and <em>Run Script</em>, +and create them later.</p> + +<p><em>Arguments</em> are in gdb syntax.</p> + +<p><em>Environment</em> is one var=value per line.</p> + +<p><em>Load script</em> is a gdb script file to be executed when gdb is loaded, before +running the program (see <a href="#run_continue">Run/Continue</a>). If this script contains a +gdb run command, it should contain at least one breakpoint command as well, because all Scope +breakpoints are applied after the program is loaded - and it may be loaded by the script.</p> + +<p><em><a name="auto_run_exit">Auto run program/exit gdb</a></em> - with this box unchecked, +the first <a href="#run_continue">Run/Continue</a> will load and setup the program without +running it; and when the program terminates, gdb will not be unloaded. This is useful if you +want to run a program several times without reloading, for example to run it unmodified with +different sets of input data.</p> + +<p><em>Non-stop mode</em> - gdb non-stop mode. You'd better activate gdb asynchronous mode +from Scope preferences to take advantage of this.</p> + +<p><em>Temporary breakpoint at</em> - set a temporary breakpoint after the program is loaded. +If you leave the text field empty, Scope will try to detect the 1st line of code and place a +breakpoint on it. Any breakpoint options and location are allowed, for example <em>main</em> +for C/C++ programs. Since setting a breakpoint requires a program, temporary breakpoint will +be disabled if both <em>Executable</em> and <em>Load script</em> are empty.</p> + +<p><em>Delete all breakpoints, watches and inspects</em> - usually when setting up a new +program. Scope will ask you to confirm.</p> + +<p><em>Update all views</em> - update all relevant debug subpages when the current thread +stops, or a different thread is selected. By default, only the current subpage is updated.</p> + +<p>Using <em>Locale</em> text mode requires the same code page for Geany/Scope and the program +being debugged.</p> + +<p>Unchecking <em>Display member and argument names</em> or using <em>Name=value</em> are not +guaranteed to work; single-quoted strings ending with backslash will fail. GDB "set +print" commands also affect display.</p> + +<p><em>Import</em> - get <em>Executable</em> and <em>Working dir</em> from the second Geany +<em>Execute</em> command (from <em>Tools -> Set Build Commands</em>).</p> + +<p>When you start Geany, or open/close a project, Scope will try to load the debugging +settings for a program that matches the second <em>Execute</em> command, if any [N]. The +command will not be expanded. Letter case will be ignored under win~1.</p> + +<p><b><a name="run_continue">Run/Continue</a></b> [NHD]</p> + +<div>Not debugging state (first run):</div> +<div class="tab"> +- Checks the <em>Program</em> and <em>Working dir</em>, if any - they must exist and be +user-executable at this point<br> +- Checks the <em>Load script</em>, if any - it must exist and be readable<br> +- Loads gdb<br> +- Setups the asynchronous and/or non-stop modes<br> +- Loads the <em>Program</em>, if any<br> +- Executes the <em>Load script</em>, if any<br> +- If either a program was loaded, or a load script was executed without errors:<br> + <div class="tab1"> + • applies any breakpoints and inspects marked as <em>Apply on Run</em><br> + • applies the temporary breakpoint, if any<br> + • runs the program if, and only if: + <div class="tab2"> + - <em>Auto run/exit</em> is checked<br> + - at least 1 breakpoint was applied<br> + - there were no errors in any of the previous steps. + </div> + </div> +</div> + +<p>Hang state: -exec-run. The temporary breakpoint, if any, will not be applied.<br> +Debug/Assem: -exec-continue.</p> + +<p><b><a name="goto_cursor">Run to Cursor</a></b> [D]</p> + +<p>scope_goto_cursor=0: -exec-until with the current filename:line<br> +scope_goto_cursor=1: set temporary breakpoint at the current position and -exec-continue.</p> + +<p><b><a name="goto_source">Run to Source</a></b> [D]</p> + +<p>Assem state only: -exec-step. See gdb step description.</p> + +<p><a name="step_into"><b>Step Into</b> / <b>Step Over</b></a> [D]</p> + +<p>Debug state: -exec-step / -exec-next.<br> +Assem state: -exec-step-instruction / -exec-next-instruction.</p> + +<p><b><a name="terminate">Terminate</a></b> [^N]</p> + +<p>Busy state: kill gdb, even if <a href="#auto_run_exit">Auto Run/exit is unchecked</a>. If +you want to kill the program only, switch to <em>Threads</em> and use <em>Terminate</em> or +<em>Send Signal</em>.</p> + +<p>Debug or Ready state with <em>Auto Run/Exit</em> off: gdb kill command.</p> + +<p>Otherwise: -gdb-exit.</p> + +<p><b><a name="gdb_command">GDB Command</a></b> [^N]</p> + +<p>Commands starting with 0<digit> are used internally by Scope and will be blocked.</p> + +<p>Writing a full combo box for multi-line text is outside the scope of this project.</p> + +<p><b><a name="reset markers">Reset Markers</a></b></p> + +<p>Synchronizes the breakpoint and execution point markers for the current file with the Scope +data. They can become out of sync if you <em>Save as</em> a file with markers, set a source +file type to non-source and edit it, and possibly in other situations.</p> + +<p><b><a name="cleanup files">Cleanup Files</a></b></p> + +<p>While debugging a program, Scope will automatically open the source files required to show +the current execution point(s). This command closes such files.</p> + +<h3><a name="debug_panel">Debug panel</a></h3> + +<p>The sort orders and column widths are not saved. However, the breakpoints and watches are +saved in their current order.</p> + +<p>Sorting by file name (including breakpoint location) uses the full locale name, so the +order may be different from the displayed UTF-8 base names.</p> + +<p><b><a name="terminal">Program Terminal</a></b></p> + +<p>Will be disabled if a pseudo-tty can not be created.</p> + +<p>May be displayed either in a Debug panel tab or as a separate window.</p> + +<div><em>Window</em>:</div> +<table border="0"> +<tr><td class="tab"><em>Auto show</em></td><td class="tab">Switch to separate window display +on program startup (when the first thread is created).</td></tr> +<tr><td class="tab"><em>Auto hide</em></td><td class="tab">Switch to Debug panel tab display +on program shutdown (when the last thread is exited).</td></tr> +<tr><td class="tab"><em>Show on Error</em></td><td class="tab">Switch to separate +window display when a thread group is exited with a non-zero status.<br>Not reliable if +combined with <em>Auto Hide</em> on multi-thread-group programs.</td></tr> +</table> + +<p><b><a name="threads">Threads</a></b></p> + +<p><em>Refresh</em> - will not append or remove threads, only update the currently listed +ones.</p> + +<p><em>Interrupt</em> - *nix: SIGINT, win~1: DebugBreakProcess.</p> + +<p><em>Terminate</em> - *nix: SIGTERM, win~1: TerminateProcess.</p> + +<p>Both <em>Interrupt</em> and <em>Terminate</em> require an extra <em>Step</em> deliver a +signal/*process to a stopped thread, and an extra <em>Step</em> to terminate a process.</p> + +<div><em>Re-select on</em>:</div> +<table border="0"> +<tr><td class="tab"><em>Running</em></td><td class="tab">Select a stopped thread (if any) when +the current thread becomes running. Useful when starting/stopping lots of threads, but may be +annoying in other situations - for example, if you are single-stepping a thread, and another +stopped thread exists, it'll be selected on each step.</td></tr> +<tr><td class="tab"><em>Stopped</em></td><td class="tab">Select a thread when it stops (if +there is no stopped thread already selected).</td></tr> +<tr><td class="tab"><em>Exited</em></td><td class="tab">Select a stopped thread (if any) when +the current thread is exited.</td></tr> +</table> + +<p><b><a name="break">Breakpoints</a></b></p> + +<p>There is no dialog for adding/editing breakpoints. You can use <em>Debug -> Toggle +Breakpoint</em>, edit the <em>Ignore</em>, <em>Condition</em> and <em>Script</em> columns, or +invoke <em>Add Break / Add Watch</em> [HRD], which brings up the command dialog.</p> + +<div>Only points created with MI commands are kept in the list permanently.<br> +Due to MI limitations:</div> +<div class="tab"> +- The catchpoints are displayed incompletely<br> +- Disposition "dis" is ignored, and "del" is saved for breakpoints and tracepoints only<br> +- The difference between software and hardware watchpoints is ignored, but gdb will create +hardware watchpoints as needed.</div> + +<p>For tracepoints, only the generic breakpoint commands and attributes are supported (with +ignore for passcount), not the tracepoint-specific commands.</p> + +<p><em>Apply on run</em> is off by default for watchpoints, because they are often related to +a local expression.</p> + +<p>Shift-Clicking <em>Apply</em> applies the breakpoint for the currently selected thread +only.</p> + +<p>GDB may report an error for invalid <em>Condition</em> and/or <em>Script</em>, but still +accept them, and continue to emit errors each time they are evaluated.</p> + +<p>The breakpoint line markers, <em>View Source</em> and double-click use the last known file +name and line, as displayed in <em>Location or expr</em>. They may change when a breakpoint is +applied or resolved.</p> + +<p>With gdb 7.4 and later, the breakpoint list is updated by asynchronous gdb messages (except +for <em>async_break_bugs</em>). Use <em>Refresh</em> to fully refresh it.</p> + +<p><em>Condition</em>, <em>Script</em> and watchpoint <em>expr</em> use the default 8-bit text +mode.</p> + +<p>For multi-address breakpoints, the individual locations are not loaded or saved, and are +deleted as soon as the program is unloaded, so you may prefer to turn <em>Auto run/exit</em> +off when using them. When a breakpoint is disabled, GDB treats all it's locations as disabled, +despite their individual state. However, with at least enabled location for a file:line, the +marker for enabled breakpoint will be used for that line.</p> + +<p><b><a name="stack">Stack</a></b></p> + +<p>The stack will be updated slightly faster if you keep it unsorted or ordered by frame # +ascending.</p> + +<p>The function arguments are subject to 8-bit text conversion. Their individual modes may be +set via <em>Locals</em>.</p> + +<p><b><a name="local">Locals</a></b></p> + +<p>The first column is "1" for arguments, empty for local variables.</p> + +<p><b><a name="watch">Watches</a></b></p> + +<p>This is a flat list of expressions, evaluated each time the current thread stops or changes +(subject to <em>update_all_views</em>), in the context of the current thread and frame. Unlike +<em>Inspect</em>, any gdb-evaluatable expressions may be used, there is no need to apply +them.</p> + +<p><b><a name="local_watch">Locals/Watches</a></b></p> + +<p><em>Modify</em> is useful for setting individual array / structure elements.</p> + +<p>Shift-clicking <em>Modify</em> displays strings as "TEXT" instead of 0xADDR, and +characters as 'C' instead of VALUE (see <a href="#editing_values">Editing values</a>).<br> +Any char[] arrays will still be displayed as arrays.</p> + +<p><em>Show .names</em> - display member names. Shift+Click resets it to the value specified +in <em>Setup Program</em>.</p> + +<p><b><a name="console">Debug Console</a></b></p> + +<div><table> +<tr><td>Red</td><td class="tab">gdb stderr (or sometimes exec) error messages</td></tr> +<tr><td>Gray</td><td class="tab">normal gdb messages</td></tr> +<tr><td>Cyan</td><td class="tab">commands send to gdb</td></tr> +<tr><td>Magenta</td><td class="tab">Scope messages, mostly parsing errors</td></tr> +</table></div> + +<p>Typing a graphical ascii character or pressing Insert brings up the command dialog.</p> + +<p>Note that whether the last displayed line is a gdb prompt is <b>not</b> a proper indicator +if GDB is ready to receive commands. For example, in synchronous mode, GDB displays a prompt +immediately resuming the program execution; or the prompt may be followed by asynchronous +messages. The Scope state (Busy, Debug etc.) is more accurate.</p> + +<p><b><a name="inspect">Inspect Page</a></b></p> + +<p>All -var-* commands except -var-update will be ignored when entered from the command line, +because their output does not provide enough information to identify the variable object.</p> + +<p><em>Jump To</em> lists the top-level variables, which is useful if you have a lot of +children displayed. It's disabled while gdb is inactive, because all variables are collapsed +anyway.</p> + +<p>Double-click or Return applies/unapplies a variable.</p> + +<p><em>Add</em> will try to apply the variable object immediately, <em>Edit</em> will +not. <em>Apply on run</em> is off by default, because the variables are often local.</p> + +<p><em>Expand</em> is primary to change the expansion options. After a variable is applied, +you can expand it simply by using the keyboard or mouse, like with any other gtk+ tree.</p> + +<p>The command "echo ^(Scope)#07<em>name</em>" will try to expand the variable +<em>name</em>. You can include such commands in your breakpoint scripts. The name must start +will a letter ("-" will not do).</p> + +<p>When modifying variables, gdb interprets "TEXT" as the identifier TEXT.</p> + +<p>The format and 7-bit mode are saved only for the top-level variables, not for children (but +see <a href="#keeping_modes">Keeping modes</a>).</p> + +<h3><a name="preferences">Preferences</a></h3> + +<p>Once again, trivial items are not included.</p> + +<p>[scope]</p> + +<p><em>gdb_buffer_length</em> - the maximum length of a single gdb output message. Longer +messages will be cut, and an "overflow" will be displayed in the debug console, possibly +followed by a few other parsing errors. Default = 16383. Actual value is (the nearest larger +power of 2) - 1, for example 16384 becomes 65535. + +<p><em>gdb_wait_death</em> - hundreds of seconds to wait(3) gdb death on scope unload. +Default = 20. When closing Geany, gdb will be destroyed by the operating system.</p> + +<p><em>gdb_send_interval</em> (win~1 only) - interval on which to retry sending commands to +gdb if it's input buffer is full, in hundreds of seconds. Default = 5. The actual value may be +larger, for example Scope may be activated only 10 times per second if Geany is idle.</p> + +<p><em>async_break_bugs</em> (win~1 only) - whether gdb escapes slashes twice in the +asynchronous break messages. If true, only <tt>=breakpoint-deleted</tt> will be handled.</p> + +<p><em>auto_view_source</em> - seek in source on single click in threads, breakpoints +and stack. Default = Off</p> + +<p><em>visual_beep_length</em> - hundreds of seconds to flash the state label on Scope +errors. Default = 25.</p> + +<p><em>debug_console_vte</em> (*nix only) - use vte terminal for the debug console. The +alternative is a GtkTextView based console, which has a few quirks, but consumes less CPU +power. That can be useful if you use the console a lot, and have a slow CPU or a limited power +supply. The win~1 version of Scope always uses GtkTextView.</p> + +<p><em>sci_marker_first</em> - Scope uses markers 17..19 by default; they may be changed to +avoid conflicts with other plugins.</p> + +<p><em>sci_caret_policy</em>, <em>sci_caret_slop</em> - Scintilla Y caret policy when +moving/scrolling to show the current execution point (does not affect the normal navigation +and editing). Default policy = CARET_SLOP | CARET_JUMPS | CARET_EVEN, slop = 3.<br> +See ScintillaDoc.html#SCI_SETYCARETPOLICY and Scintilla.h for more information.</p> + +<p><em>unmark_current_line</em> - disable the current line highlighting while debugging. +Useful if the current line background covers the breakpoint or execution point backgrounds. +Affects the source files only.</p> + +<p><em>seek_with_navqueue</em> - use Geany navqueue when seeking in source.</p> + +<p><em>panel_tab_pos</em> - see GtkPositionType. Some tab names will be shortened in Left +and Right.</p> + +<p><em>show_recent_items</em> - number of items to display in <em>Debug --> Recent +Programs</em>. Default = 10, maximum = 28. Note that Scope will always keep the settings +for the last 28 programs; on project open/close and Geany startup, settings which are not +visible in the menu may be loaded.</p> + +<p><em>show_toolbar_items</em> - bitmask: 1 = Run/Continue, 2 = Goto Cursor, 4 = Goto +Source, 8 = Step Into, 16 = Step Over, 32 = Step Out, 64 = Terminate and 128 = Toggle +Breakpoint.</p> + +<p><em>tooltips_fail_action</em> - 1 = blink on tooltip evaluate errors, 2 = display them as +tooltips.</p> + +<p><em>tooltips_send_delay</em> - increase this setting to reduce the CPU time and GDB traffic +used by the tooltips, or decrease it if they appear slower than your gtk+ setting.</p> + +<p><em>pref_tooltips_length</em> - maximum length of a tooltip message, 0 = unlimited.</p> + +<p>[terminal] (*nix only)</p> + +<p><em>width</em>, <em>height</em> - VTE widget (not terminal window) size</p> + +<p><em>save_pos</em> - auto save window position and widget size</p> + +<p><em>padding</em> - whether <em>width</em> and <em>height</em> include the extra VTE widget +padding. If <em>save_pos</em> is active, it will save them with the padding.</p> + +<p>[disabled_break], [enabled_break], [execution_line]</p> + +<p><em>mark</em> - Scintilla mark. See Scintilla.h: SC_MARK_.</p> + +<h3><a name="notes">Notes</a></h3> + +<p>Changes in Geany VTE preferences will be applied when Scope is restarted.</p> + +<p>Locale/UTF-8 conversion is fully supported for values only. Filenames not matching your +locale and non-ascii identifiers are not guaranteed to work.</p> + +<p>When editing a column while the program is running, it's value will be updated after/if the +respective gdb command is executed.</p> + +<p>If you use multiply Geany instances with session management, make sure that only one of +them has Scope enabled. Otherwise, the list of programs and their settings may break.</p> + +<p>A disabled check button or check menu item means that the respective functionality is +unavailable; it doesn't matter if the interface element is checked or not.</p> + +<p><b><a name="editing_values">Editing values</a></b></p> + +<div>GDB often displays values in format unsuitable for assigning. So when editing a value, +Scope will try to:</div> +<div class="tab"> +- Cut any member names, because <em>set foo = { i = 4, c = 'x' }</em> actually means +<em>i = 4; c = 'x'; foo = {4, 'x'}</em><br> +- Cut any array indexes<br> +- Cut 0xADDR "TEXT" to 0xADDR. Leaving both is invalid, and "TEXT" always +creates a new string pointer<br> +- Cut VAL 'C' to VAL. Again, leaving both is invalid<br> +- Detect <repeats, <optimized etc. and clear the entire value if editing via the +<em>Value</em> column<br> +- Convert char[] arrays displayed as string to character array, because a string always +includes a trailing '\0', so a char[4] may be displayed as "TEXT", but can not be +assigned like that.<br> + Note that UTF-8 texts will be converted to 8-bit character arrays. +</div> + +<p>Of course, you can still enter a "TEXT" or a 'C'haracter.</p> + +<p>The above steps are not guaranteed to work; in particular, single-quoted strings ending +with backslash will fail. If parsing errors are detected when editing the <em>Value</em> +column, the entire value will be cleared - but that is not guaranteed to work either.</p> + +<p><b><a name="keeping_modes">Editing values</a></b></p> + +<p>The 7-bit and .names modes for temporary objects, such as local variables, are not saved. +However, there is a global list with names and modes, and whenever you change a mode, it's +saved in that list. When a temporary object is created, Scope searches the list, and sets the +modes (if any) for that object. For inspect children, the displayed names are used (including +numbers for array elements), not the not the fully qualified names.</p> + +<p><b><a name="xos4_colors">Sample dark colors</a></b></p> + +<pre> +[disabled_break] +mark=0 +alpha=256 +fore=#008000 +back=#005000 + +[enabled_break] +mark=0 +alpha=256 +fore=#0000E0 +back=#000068 + +[execution_line] +mark=4 +alpha=256 +fore=#F0F000 +back=#707000 +</pre> + +<h3><a name="pre_faq">Pre-FAQ</a></h3> + +<p>Questions which are likely to be asked frequently:</p> + +<p>Q. How about tree lists in <em>Locals</em> and <em>Watches</em>?</p> + +<p>A. They operate with the entire struct/array values, so creating tree lists would be +completely artificial. Some front ends automatically create/delete gdb variables for the +locals as they come into/go out of scope, or even or each step, but I'm not willing to do +that. The watches can not be represented with variables (see <em>Watches</em>). So, use +<em>Inspect</em> for tree lists.</p> + +<p>Why isn't <em>Interrupt</em> implemented as -exec-interrupt?</p> + +<p>Because it requires a gdb prompt, and see <em>Bugs</em>. Of course, using target-specific +functions has it's own drawbacks, but you can always try to send an -exec-interrupt from the +GDB command line if you need it.</p> + +<p>Q. Why not leave the member names (array indexes) while editing a value?</p> + +<p>A. They must be removed before sending the value to GDB. Leaving them while editing gives +the false impression that you can assign selectively, while in fact omitting a "foo = +value, " <em>moves</em> all values left by 1, and changing a name or index has +<em>no</em> effect.</p> + +<h3><a name="bugs">Bugs</a></h3> + +<p>For some reason, -exec-interrupt under Linux (*nix?) signals gdb and Geany, but not the +program/thread. The other Geany debugger plugin has the same problem.</p> + +<p>Report bugs to <dimitar.zhekov@gmail.com></p> + +<h3><a name="todo">TODO</a></h3> + +<p>See TODO.</p> + +<h3><a name="not_todo">Not TODO</a></h3> + +<table cellpadding="0" cellspacing="0"> +<tr><td>"The master programmer knows when to leave things in their simple form."</td></tr> +<tr><td align="right">-- Eloquent Javascript</td></tr> +</table> + +<div>Things that will not be implemented in Scope:</div> +<ul> +<li>Support for debuggers other than GDB</li> +<li>"Proper GObject-ification"</li> +<li>Combined subpages, such as <a href="http://projects.gnome.org/nemiver">Nemiver</a> Context +</li> +<li>GUI for functions that don't really need it.</li> +<li>Anything that requires parsing non-MI output.</li> +</ul> + +<h3><a name="legal_info">Legal information</a></h3> + +<b><a name="license">License</a></b> + +<p>Scope is distributed under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your option) any +later version.</p> + +<b><a name="copyright">Copyright</a></b> + +<p>Scope 0.75, Copyright (C) 2012 Dimitar Toshkov Zhekov</p> + +<p>The menu and toolbar icons are from <a href="http://netbeans.org">Netbeans</a>, except for +BreakPoint.</p> + +<p><b>The End</b></p> + +</body> +</html>
Modified: scope/src/Makefile.am 54 files changed, 54 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,54 @@ +include $(top_srcdir)/build/vars.build.mk +include $(top_srcdir)/build/vars.docs.mk + +geanyplugins_LTLIBRARIES = scope.la + +plugin = scope + +scope_la_SOURCES = \ + break.c \ + break.h \ + common.h \ + conterm.c \ + conterm.h \ + debug.c \ + debug.h \ + gtk216.c \ + gtk216.h \ + inspect.c \ + inspect.h \ + local.c \ + local.h \ + menu.c \ + menu.h \ + parse.c \ + parse.h \ + plugme.c \ + plugme.h \ + prefs.c \ + prefs.h \ + program.c \ + program.h \ + scope.c \ + scope.h \ + stack.c \ + stack.h \ + thread.c \ + thread.h \ + tooltip.c \ + tooltip.h \ + utils.c \ + utils.h \ + views.c \ + views.h \ + watch.c \ + watch.h + +scope_la_LIBADD = $(COMMONLIBS) $(VTE_LIBS) -lutil + +scope_la_CFLAGS = $(AM_CFLAGS) $(VTE_CFLAGS) \ + -DPLUGINDATADIR="$(plugindatadir)" \ + -DPLUGINHTMLDOCDIR="$(plugindocdir)/html" \ + -Wno-shadow + +include $(top_srcdir)/build/cppcheck.mk
Modified: scope/src/break.c 1332 files changed, 1332 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,1332 @@ +/* + * break.c + * + * Copyright 2012 Dimitar Toshkov Zhekov dimitar.zhekov@gmail.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include <gdk/gdkkeysyms.h> + +#include "common.h" + +enum +{ + BREAK_ID, + BREAK_FILE, + BREAK_LINE, + BREAK_SCID, + BREAK_TYPE, + BREAK_ENABLED, + BREAK_DISPLAY, + BREAK_FUNC, + BREAK_ADDR, + BREAK_TIMES, + BREAK_IGNORE, + BREAK_COND, + BREAK_SCRIPT, + BREAK_PENDING, + BREAK_LOCATION, + BREAK_RUN_APPLY, + BREAK_TEMPORARY, + BREAK_DISCARD, + BREAK_MISSING +}; + +static gint break_id_compare(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, + G_GNUC_UNUSED gpointer gdata) +{ + const char *s1, *s2; + gint result; + + gtk_tree_model_get(model, a, BREAK_ID, &s1, -1); + gtk_tree_model_get(model, b, BREAK_ID, &s2, -1); + result = utils_atoi0(s1) - utils_atoi0(s2); + + if (!result && s1 && s2) + { + const char *p1, *p2; + + for (p1 = s1; isdigit(*p1); p1++); + for (p2 = s2; isdigit(*p2); p2++); + + result = atoi(p1 + (*p1 == '.')) - atoi(p2 + (*p2 == '.')); + } + + return result; +} + +static gint break_location_compare(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, + G_GNUC_UNUSED gpointer gdata) +{ + gint result = model_seek_compare(model, a, b, NULL); + return result ? result : model_string_compare(model, a, b, BREAK_LOCATION); +} + +static const char + *const BP_CHARS = "bhtfwwwaarrc?", + *const BP_BREAKS = "bh", + *const BP_TRACES = "tf", + *const BP_HARDWS = "hf", + *const BP_BORTS = "bhtf", + *const BP_KNOWNS = "btfwar", + *const BP_WATCHES = "war", + *const BP_WATOPTS = "ar"; + +typedef struct _BreakType +{ + const char *text; + const char *type; +} BreakType; + +static const BreakType break_types[] = +{ + { "breakpoint", "break" }, + { "hw breakpoint", "hbreak" }, + { "tracepoint", "trace" }, + { "fast tracepoint", "ftrace" }, + { "wpt", "watch" }, + { "watchpoint", "watch" }, + { "hw watchpoint", "watch" }, + { "hw-awpt", "access" }, + { "acc watchpoint", "access" }, + { "hw-rwpt", "read" }, + { "read watchpoint", "read" }, + { "catchpoint", "catch" }, + { NULL, "??" } +}; + +static void break_type_set_data_func(G_GNUC_UNUSED GtkTreeViewColumn *column, + GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, + G_GNUC_UNUSED gpointer gdata) +{ + char type; + gboolean temporary; + GString *string = g_string_sized_new(0x0F); + + gtk_tree_model_get(model, iter, BREAK_TYPE, &type, BREAK_TEMPORARY, &temporary, -1); + g_string_append(string, break_types[strchr(BP_CHARS, type) - BP_CHARS].type); + + if (temporary) + g_string_append(string, ",t"); + + g_object_set(cell, "text", string->str, NULL); + g_string_free(string, TRUE); +} + +static GtkListStore *store; +static GtkTreeModel *model; +static GtkTreeSortable *sortable; +static GtkTreeSelection *selection; +static gint scid_gen = 0; + +static void break_mark(GtkTreeIter *iter, gboolean mark) +{ + const char *file; + gint line; + gboolean enabled; + + gtk_tree_model_get(model, iter, BREAK_FILE, &file, BREAK_LINE, &line, BREAK_ENABLED, + &enabled, -1); + utils_mark(file, line, mark, MARKER_BREAKPT + enabled); +} + +static void break_enable(GtkTreeIter *iter, gboolean enable) +{ + break_mark(iter, FALSE); + gtk_list_store_set(store, iter, BREAK_ENABLED, enable, -1); + break_mark(iter, TRUE); +} + +static void on_break_enabled_toggled(G_GNUC_UNUSED GtkCellRendererToggle *renderer, + gchar *path_str, G_GNUC_UNUSED gpointer gdata) +{ + GtkTreeIter iter; + DebugState state = debug_state(); + const char *id; + gint scid; + gboolean enabled; + + gtk_tree_model_get_iter_from_string(model, &iter, path_str); + gtk_tree_model_get(model, &iter, BREAK_ID, &id, BREAK_SCID, &scid, BREAK_ENABLED, + &enabled, -1); + enabled ^= TRUE; + + if (state == DS_INACTIVE || !id) + { + break_enable(&iter, enabled); + } + else if (state & DS_SENDABLE) + { + debug_send_format(N, "02%d%d-break-%sable %s", enabled, scid, enabled ? "en" : + "dis", id); + } + else + plugin_beep(); +} + +#define EDITCOLS 3 + +static const char *break_command(gint index, char type) +{ + static const char *const break_commands[EDITCOLS] = { "after", "condition", "commands" }; + return !index && strchr(BP_TRACES, type) ? "passcount" : break_commands[index]; +} + +static void on_break_column_edited(G_GNUC_UNUSED GtkCellRendererText *renderer, + gchar *path_str, gchar *new_text, gpointer gdata) +{ + gint index = GPOINTER_TO_INT(gdata) - 1; + const gchar *set_text = validate_column(new_text, index > 0); + GtkTreeIter iter; + const char *id; + char type; + + gtk_tree_model_get_iter_from_string(model, &iter, path_str); + gtk_tree_model_get(model, &iter, BREAK_ID, &id, BREAK_TYPE, &type, -1); + + if (id && (debug_state() & DS_SENDABLE)) + { + char *locale = utils_get_locale_from_display(new_text, HB_DEFAULT); + + debug_send_format(F, "022%s-break-%s %s %s", id, break_command(index, type), id, + locale ? locale : index ? "" : "0"); + g_free(locale); + } + else if (!id) + gtk_list_store_set(store, &iter, index + BREAK_IGNORE, set_text, -1); + else + plugin_beep(); +} + +static void on_break_ignore_editing_started(G_GNUC_UNUSED GtkCellRenderer *cell, + GtkCellEditable *editable, G_GNUC_UNUSED const gchar *path, gpointer G_GNUC_UNUSED gdata) +{ + if (GTK_IS_EDITABLE(editable)) + validator_attach(GTK_EDITABLE(editable), VALIDATOR_NUMERIC); + + if (GTK_IS_ENTRY(editable)) + gtk_entry_set_max_length(GTK_ENTRY(editable), 10); +} + +static const TreeCell break_cells[] = +{ + { "break_enabled", G_CALLBACK(on_break_enabled_toggled) }, + { "break_ignore", G_CALLBACK(on_break_column_edited) }, + { "break_cond", G_CALLBACK(on_break_column_edited) }, + { "break_script", G_CALLBACK(on_break_column_edited) }, + { NULL, NULL } +}; + +static void append_script_command(const ParseNode *node, GString *string) +{ + iff (node->type == PT_VALUE, "script: contains array") + { + gchar *display = utils_get_display_from_7bit((char *) node->value, HB_DEFAULT); + gchar *s; + + if (string->len) + g_string_append_c(string, ' '); + g_string_append_c(string, '"'); + + for (s = display; *s; s++) + { + if (*s == '"' || *s == '\') + g_string_append_c(string, '\'); + g_string_append_c(string, *s); + } + + g_string_append_c(string, '"'); + g_free(display); + } +} + +typedef enum _BreakStage +{ + BG_PERSIST, + BG_DISCARD, + BG_APPLY, + BG_GOTO, + BG_NEXT +} BreakStage; + +typedef struct _BreakData +{ + GtkTreeIter iter; + char type; + BreakStage stage; +} BreakData; + +static void break_iter_applied(GtkTreeIter *iter, const char *id) +{ + const gchar *columns[EDITCOLS]; + gboolean enabled; + char type; + gint index; + + gtk_tree_model_get(model, iter, BREAK_ENABLED, &enabled, BREAK_IGNORE, &columns[0], + BREAK_COND, &columns[1], BREAK_SCRIPT, &columns[2], BREAK_TYPE, &type, -1); + + if (strchr(BP_BORTS, type)) + { + if (strchr(BP_BREAKS, type)) + columns[0] = NULL; + columns[1] = NULL; + } + else if (!enabled) + debug_send_format(N, "-break-disable %s", id); + + for (index = 0; index < EDITCOLS; index++) + { + char *locale = utils_get_locale_from_display(columns[index], HB_DEFAULT); + + if (locale) + { + debug_send_format(F, "-break-%s %s %s", break_command(index, type), id, + locale); + g_free(locale); + } + } +} + +static void break_node_parse(const ParseNode *node, BreakData *bd) +{ + GArray *nodes = (GArray *) node->value; + const char *id; + + if (node->type == PT_VALUE) + { + dc_error("breaks: contains value"); + bd->stage = BG_DISCARD; + } + else if ((id = parse_find_value(nodes, "number")) == NULL) + { + dc_error("no number"); + bd->stage = BG_DISCARD; + } + else /* enough data to parse */ + { + const char *text_type = parse_find_value(nodes, "type"); + const BreakType *bt; + char type; + gboolean leading = !strchr(id, '.'); + gboolean borts; + ParseLocation loc; + gboolean enabled = g_strcmp0(parse_find_value(nodes, "enabled"), "n"); + GtkTreeIter *const iter = &bd->iter; + const char *times = parse_find_value(nodes, "times"); + gboolean temporary = !g_strcmp0(parse_find_value(nodes, "disp"), "del"); + + if (!text_type) + text_type = node->name; + + for (bt = break_types; bt->text; bt++) + if (!strcmp(text_type, bt->text)) + break; + + type = BP_CHARS[bt - break_types]; + + if (leading || bd->stage != BG_NEXT || type != '?') + bd->type = type; + else + type = bd->type; + + borts = strchr(BP_BORTS, type) != NULL; + parse_location(nodes, &loc); + + if (bd->stage != BG_APPLY) + { + const ParseNode *script = parse_find_node(nodes, "script"); + GtkTreeIter iter1; + + if (model_find(model, &iter1, BREAK_ID, id)) + { + bd->iter = iter1; + break_mark(iter, FALSE); + } + else /* new breakpoint */ + { + const char *location = parse_find_locale(nodes, "original-location"); + char *original = g_strdup(location); + gchar *display; + gboolean persist = leading && bd->stage == BG_PERSIST; + gboolean pending = parse_find_locale(nodes, "pending") != NULL; + + if (original) + { + char *split = strchr(original, ':'); + + if (g_path_is_absolute(original) && split > original && + split[1] != ':') + { + *split++ = '\0'; + + if (!loc.file) + loc.file = original; + + if (isdigit(*split) && !loc.line) + loc.line = atoi(split); + } + } + else if (strchr(BP_WATCHES, type)) + { + if ((location = parse_find_locale(nodes, "exp")) == NULL) + location = parse_find_locale(nodes, "what"); + } + + if (!location || !strchr(BP_KNOWNS, type)) + { + persist = FALSE; /* can't create apply command */ + if (!location) + location = loc.func; + } + + display = borts ? utils_get_utf8_basename(location) : + utils_get_display_from_locale(location, HB_DEFAULT); + + if (leading) + gtk_list_store_append(store, iter); + else + { + gtk_list_store_insert_after(store, &iter1, iter); + bd->iter = iter1; + } + + gtk_list_store_set(store, iter, BREAK_SCID, ++scid_gen, BREAK_TYPE, + type, BREAK_DISPLAY, display, BREAK_PENDING, pending, + BREAK_LOCATION, location, BREAK_RUN_APPLY, leading && borts, + BREAK_DISCARD, !persist, -1); + + if (persist) + gtk_tree_selection_select_iter(selection, iter); + + g_free(original); + g_free(display); + } + + utils_mark(loc.file, loc.line, TRUE, MARKER_BREAKPT + enabled); + + if (script) + { + GString *string = g_string_sized_new(0x3F); + + if (script->type == PT_VALUE) + append_script_command(script, string); + else + { + array_foreach((GArray *) script->value, + (GFunc) append_script_command, string); + } + + gtk_list_store_set(store, iter, BREAK_SCRIPT, string->str, -1); + g_string_free(string, TRUE); + } + else + gtk_list_store_set(store, iter, BREAK_SCRIPT, NULL, -1); + } + + if (borts || bd->stage != BG_APPLY) + { + gchar *cond = utils_get_display_from_7bit(parse_find_value(nodes, "cond"), + HB_DEFAULT); + const char *ignore = parse_find_value(nodes, "ignore"); + + gtk_list_store_set(store, iter, BREAK_ENABLED, enabled, BREAK_COND, cond, + strchr(BP_BREAKS, type) || bd->stage != BG_APPLY ? BREAK_IGNORE : -1, + ignore ? ignore : parse_find_value(nodes, "pass"), -1); + g_free(cond); + } + + gtk_list_store_set(store, iter, BREAK_ID, id, BREAK_FILE, loc.file, BREAK_LINE, + loc.line, BREAK_FUNC, loc.func, BREAK_ADDR, loc.addr, BREAK_TIMES, + utils_atoi0(times), BREAK_MISSING, FALSE, BREAK_TEMPORARY, temporary, -1); + + parse_location_free(&loc); + + if (bd->stage == BG_APPLY) + break_iter_applied(iter, id); + else if (bd->stage == BG_GOTO) + debug_send_thread("-exec-continue"); + + bd->stage = BG_NEXT; + } +} + +void on_break_inserted(GArray *nodes) +{ + const char *token = parse_grab_token(nodes); + BreakData bd; + + bd.stage = BG_PERSIST; + + if (token) + { + if (*token == '0') + bd.stage = BG_GOTO; + else if (*token) + { + iff (model_find(model, &bd.iter, BREAK_SCID, token), "%s: b_scid not found", + token) + { + bd.stage = BG_APPLY; + } + } + else + bd.stage = BG_DISCARD; + } + + array_foreach(nodes, (GFunc) break_node_parse, &bd); +} + +static void break_apply(GtkTreeIter *iter, gboolean thread) +{ + GString *command = g_string_sized_new(0x1FF); + gint scid; + char type; + const char *ignore, *location; + gboolean enabled, pending, temporary; + const gchar *cond; + gboolean borts; + + gtk_tree_model_get(model, iter, BREAK_SCID, &scid, BREAK_TYPE, &type, BREAK_ENABLED, + &enabled, BREAK_IGNORE, &ignore, BREAK_COND, &cond, BREAK_LOCATION, &location, + BREAK_PENDING, &pending, BREAK_TEMPORARY, &temporary, -1); + + borts = strchr(BP_BORTS, type) != NULL; + g_string_append_printf(command, "02%d-break-%s", scid, borts ? "insert" : "watch"); + + if (borts) + { + if (temporary) + g_string_append(command, " -t"); + + if (strchr(BP_HARDWS, type)) + g_string_append(command, " -h"); + + if (strchr(BP_BREAKS, type)) + { + if (ignore) + g_string_append_printf(command, " -i %s", ignore); + } + else + g_string_append(command, " -a"); + + if (!enabled) + g_string_append(command, " -d"); + + if (cond) + { + char *locale = utils_get_locale_from_display(cond, HB_DEFAULT); + g_string_append_printf(command, " -c "%s"", locale); + g_free(locale); + } + + if (pending) + g_string_append(command, " -f"); + + if (thread && thread_id) + g_string_append_printf(command, " -p %s", thread_id); + } + else if (strchr(BP_WATOPTS, type)) + g_string_append_printf(command, " -%c", type); + + g_string_append_printf(command, " %s", location); + debug_send_command(F, command->str); + g_string_free(command, TRUE); +} + +static void break_clear(GtkTreeIter *iter) +{ + char type; + + gtk_tree_model_get(model, iter, BREAK_TYPE, &type, -1); + gtk_list_store_set(store, iter, BREAK_ID, NULL, BREAK_ADDR, NULL, + strchr(BP_BORTS, type) ? -1 : BREAK_TEMPORARY, FALSE, -1); +} + +static gboolean break_remove(GtkTreeIter *iter) +{ + break_mark(iter, FALSE); + return gtk_list_store_remove(store, iter); +} + +static gboolean break_remove_all(const char *pref, gboolean force) +{ + GtkTreeIter iter; + int len = strlen(pref); + gboolean valid = gtk_tree_model_get_iter_first(model, &iter); + gboolean found = FALSE; + + while (valid) + { + const char *id; + gboolean discard; + + gtk_tree_model_get(model, &iter, BREAK_ID, &id, BREAK_DISCARD, &discard, -1); + + if (id && !strncmp(id, pref, len) && strchr(".", id[len])) + { + found = TRUE; + + if (discard || force) + { + valid = break_remove(&iter); + continue; + } + + break_clear(&iter); + } + + valid = gtk_tree_model_iter_next(model, &iter); + } + + return found; +} + +void on_break_done(GArray *nodes) +{ + const char *token = parse_grab_token(nodes); + GtkTreeIter iter; + + switch (*token) + { + case '0' : + case '1' : + { + iff (model_find(model, &iter, BREAK_SCID, token + 1), "%s: b_scid not found", + token) + { + break_enable(&iter, *token == '1'); + } + break; + } + case '2' : + { + debug_send_format(N, "-break-info %s", token + 1); + break; + } + case '3' : + { + if (!break_remove_all(token + 1, TRUE)) + dc_error("%s: bid not found", token); + break; + } + default : dc_error("%s: invalid b_oper", token); + } +} + +static void break_iter_missing(GtkTreeIter *iter, G_GNUC_UNUSED gpointer gdata) +{ + gtk_list_store_set(store, iter, BREAK_MISSING, TRUE, -1); +} + +static void breaks_missing(void) +{ + GtkTreeIter iter; + gboolean valid = gtk_tree_model_get_iter_first(model, &iter); + + while (valid) + { + const char *id; + gboolean discard, missing; + + gtk_tree_model_get(model, &iter, BREAK_ID, &id, BREAK_DISCARD, &discard, + BREAK_MISSING, &missing, -1); + + if (id && missing) + { + if (discard) + { + valid = break_remove(&iter); + continue; + } + else + break_clear(&iter); + } + + valid = gtk_tree_model_iter_next(model, &iter); + } +} + +void on_break_list(GArray *nodes) +{ + iff ((nodes = parse_find_array(parse_lead_array(nodes), "body")) != NULL, "no body") + { + gboolean refresh = parse_grab_token(nodes) != NULL; + BreakData bd; + + if (refresh) + model_foreach(model, (GFunc) break_iter_missing, NULL); + + bd.stage = BG_DISCARD; + array_foreach(nodes, (GFunc) break_node_parse, &bd); + + if (refresh) + breaks_missing(); + } +} + +gint break_async = -1; + +void on_break_stopped(GArray *nodes) +{ + if (break_async < TRUE) + { + const char *id = parse_find_value(nodes, "bkptno"); + const char *disp = parse_find_value(nodes, "disp"); + + if (id && disp) + { + if (!strcmp(disp, "dis")) + { + GtkTreeIter iter; + + if (model_find(model, &iter, BREAK_ID, id)) + break_enable(&iter, FALSE); + } + else if (!strcmp(disp, "del")) + break_remove_all(id, FALSE); + } + } + + on_thread_stopped(nodes); +} + +void on_break_created(GArray *nodes) +{ +#ifndef G_OS_UNIX + if (!pref_async_break_bugs) +#endif + { + BreakData bd; + bd.stage = BG_DISCARD; + array_foreach(nodes, (GFunc) break_node_parse, &bd); + } + + break_async = TRUE; +} + +void on_break_deleted(GArray *nodes) +{ + break_remove_all(parse_lead_value(nodes), FALSE); + break_async = TRUE; +} + +static void break_feature_node_check(const ParseNode *node, G_GNUC_UNUSED gpointer gdata) +{ + if (!strcmp((const char *) node->value, "breakpoint-notifications")) + break_async = TRUE; +} + +void on_break_features(GArray *nodes) +{ + array_foreach(parse_lead_array(nodes), (GFunc) break_feature_node_check, NULL); +} + +static void break_delete(GtkTreeIter *iter) +{ + const char *id; + + gtk_tree_model_get(model, iter, BREAK_ID, &id, -1); + + if (debug_state() == DS_INACTIVE || !id) + break_remove(iter); + else + debug_send_format(N, "023%s-break-delete %s", id, id); +} + +static void break_iter_mark(GtkTreeIter *iter, GeanyDocument *doc) +{ + const char *file; + gint line; + gboolean enabled; + + gtk_tree_model_get(model, iter, BREAK_FILE, &file, BREAK_LINE, &line, + BREAK_ENABLED, &enabled, -1); + + if (line && !utils_filenamecmp(file, doc->real_path)) + sci_set_marker_at_line(doc->editor->sci, line - 1, MARKER_BREAKPT + enabled); +} + +void breaks_mark(GeanyDocument *doc) +{ + if (doc->real_path) + model_foreach(model, (GFunc) break_iter_mark, doc); +} + +void breaks_clear(void) +{ + GtkTreeIter iter; + gboolean valid = gtk_tree_model_get_iter_first(model, &iter); + + while (valid) + { + gboolean discard; + + gtk_tree_model_get(model, &iter, BREAK_DISCARD, &discard, -1); + + if (discard) + valid = break_remove(&iter); + else + { + break_clear(&iter); + valid = gtk_tree_model_iter_next(model, &iter); + } + } +} + +static void break_iter_reset(GtkTreeIter *iter, G_GNUC_UNUSED gpointer gdata) +{ + gtk_list_store_set(store, iter, BREAK_TIMES, 0, -1); +} + +void breaks_reset(void) +{ + model_foreach(model, (GFunc) break_iter_reset, NULL); +} + +static void break_iter_apply(GtkTreeIter *iter, G_GNUC_UNUSED gpointer gdata) +{ + gboolean run_apply; + + gtk_tree_model_get(model, iter, BREAK_RUN_APPLY, &run_apply, -1); + + if (run_apply) + break_apply(iter, FALSE); +} + +void breaks_apply(void) +{ + model_foreach(model, (GFunc) break_iter_apply, NULL); +} + +void breaks_query_async(GString *commands) +{ + if (break_async == -1) + { + break_async = FALSE; + g_string_append(commands, "05-list-features\n"); + } +} + +static void break_relocate(GtkTreeIter *iter, const char *real_path, gint line) +{ + char *location = g_strdup_printf("%s:%d", real_path, line); + gchar *display = utils_get_utf8_basename(location); + + gtk_list_store_set(store, iter, BREAK_FILE, real_path, BREAK_LINE, line, BREAK_DISPLAY, + display, BREAK_LOCATION, location, -1); + + g_free(display); + g_free(location); +} + +void breaks_delta(ScintillaObject *sci, const char *real_path, gint start, gint delta, + gboolean active) +{ + GtkTreeIter iter; + gboolean valid = gtk_tree_model_get_iter_first(model, &iter); + + while (valid) + { + const char *file; + gint line; + gboolean enabled; + const char *location; + + gtk_tree_model_get(model, &iter, BREAK_FILE, &file, BREAK_LINE, &line, + BREAK_ENABLED, &enabled, BREAK_LOCATION, &location, -1); + + if (--line >= 0 && start <= line && !utils_filenamecmp(file, real_path)) + { + if (active) + { + utils_move_mark(sci, line, start, delta, MARKER_BREAKPT + enabled); + } + else if (delta > 0 || start - delta <= line) + { + char *split = strchr(location, ':'); + + line += delta + 1; + + if (split && isdigit(split[1])) + break_relocate(&iter, real_path, line); + else + gtk_list_store_set(store, &iter, BREAK_LINE, line, -1); + } + else + { + sci_delete_marker_at_line(sci, start, MARKER_BREAKPT + enabled); + valid = gtk_list_store_remove(store, &iter); + continue; + } + } + + valid = gtk_tree_model_iter_next(model, &iter); + } +} + +static void break_iter_check(GtkTreeIter *iter, guint *active) +{ + const char *id; + gboolean enabled; + + gtk_tree_model_get(model, iter, BREAK_ID, &id, BREAK_ENABLED, &enabled, -1); + *active += enabled && id; +} + +guint breaks_active(void) +{ + guint active = 0; + model_foreach(model, (GFunc) break_iter_check, &active); + return active; +} + +void on_break_toggle(G_GNUC_UNUSED const MenuItem *menu_item) +{ + GeanyDocument *doc = document_get_current(); + gint doc_line = utils_current_line(doc); + GtkTreeIter iter, iter1; + gboolean valid = gtk_tree_model_get_iter_first(model, &iter); + const char *found = NULL; + + while (valid) + { + const char *id, *file; + gint line; + + gtk_tree_model_get(model, &iter, BREAK_ID, &id, BREAK_FILE, &file, BREAK_LINE, + &line, -1); + + if (line == doc_line && !utils_filenamecmp(file, doc->real_path)) + { + if (found && atoi(found) != utils_atoi0(id)) + { + dialogs_show_msgbox(GTK_MESSAGE_INFO, + _("There are two or more breakpoints at %s:%d.\n" + "Use the breakpoint list to remove the exact one."), + doc->file_name, doc_line); + return; + } + + found = id ? id : "-1"; + iter1 = iter; + } + + valid = gtk_tree_model_iter_next(model, &iter); + } + + if (found) + break_delete(&iter1); + else if (debug_state() != DS_INACTIVE) + debug_send_format(N, "-break-insert %s:%d", doc->real_path, doc_line); + else + { + gtk_list_store_append(store, &iter); + break_relocate(&iter, doc->real_path, doc_line); + gtk_list_store_set(store, &iter, BREAK_SCID, ++scid_gen, BREAK_TYPE, 'b', + BREAK_ENABLED, TRUE, BREAK_RUN_APPLY, TRUE, -1); + gtk_tree_selection_select_iter(selection, &iter); + sci_set_marker_at_line(doc->editor->sci, doc_line - 1, MARKER_BREAKPT + TRUE); + } +} + +gboolean breaks_update(void) +{ + debug_send_command(N, "04-break-list"); + return TRUE; +} + +static void break_iter_unmark(GtkTreeIter *iter, G_GNUC_UNUSED gpointer gdata) +{ + break_mark(iter, FALSE); +} + +void breaks_delete_all(void) +{ + model_foreach(model, (GFunc) b@@ Diff output truncated at 100000 characters. @@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).