X11 Work Bench Toolkit  1.0
gdb_helper.c
1 
2 // //
3 // _ _ _ _ //
4 // __ _ __| || |__ | |__ ___ | | _ __ ___ _ __ ___ //
5 // / _` | / _` || '_ \ | '_ \ / _ \| || '_ \ / _ \| '__|/ __| //
6 // | (_| || (_| || |_) | | | | || __/| || |_) || __/| | _| (__ //
7 // \__, | \__,_||_.__/_____|_| |_| \___||_|| .__/ \___||_|(_)\___| //
8 // |___/ |_____| |_| //
9 // //
11 
12 /*****************************************************************************
13 
14  X11workbench - X11 programmer's 'work bench' application and toolkit
15  Copyright (c) 2010-2016 by Bob Frazier (aka 'Big Bad Bombastic Bob')
16  all rights reserved
17 
18  DISCLAIMER: The X11workbench application and toolkit software are supplied
19  'as-is', with no warranties, either implied or explicit.
20  Any claims to alleged functionality or features should be
21  considered 'preliminary', and might not function as advertised.
22 
23  BSD-like license:
24 
25  There is no restriction as to what you can do with this software, so long
26  as you include the above copyright notice and DISCLAIMER for any distributed
27  work that is equal to or derived from this one, along with this paragraph
28  that explains the terms of the license if the source is also being made
29  available. A "derived work" describes a work that uses a significant portion
30  of the source files or algorithms that are included with this one.
31  Specifically excluded from this are files that were generated by the software,
32  or anything that is included with the software that is part of another package
33  (such as files that were created or added during the 'configure' process).
34  Specifically included is the use of part or all of any of the X11 workbench
35  toolkit source or header files in your distributed application. If you do not
36  ship the source, the above copyright statement is still required to be placed
37  in a reasonably prominent place, such as documentation, splash screens, and/or
38  'about the application' dialog boxes.
39 
40  Use and distribution are in accordance with GPL, LGPL, and/or the above
41  BSD-like license. See COPYING and README files for more information.
42 
43 
44  Additional information at http://sourceforge.net/projects/X11workbench
45 
46 ******************************************************************************/
47 
48 
49 
50 #include "X11workbench.h"
51 #include "gdb_helper.h"
52 
53 #include "platform_helper.h"
54 
55 
56 // NOTES:
57 //
58 // command line gdb {executable} where '{executable}' is the binary executable file
59 //
60 // (NOTE: output of 'gdb' typically ends with the text "(gdb)" which then waits for input)
61 //
62 // commands from within gdb that should be useful:
63 //
64 // set height 0
65 // this will eliminate the "Type <return> to continue, or q <return> to quit" prompting
66 //
67 //
68 // list ,main
69 // this will set the 'main()' source file as "current source" and allow 'info source' to work
70 //
71 // info source
72 // information on the 'current' source file being displayed. output similar to this:
73 // Current source file is X11workbench.c
74 // Compilation directory is /d-drive/SecureStorage/root/source/X11workbench
75 // Located in /d-drive/SecureStorage/root/source/X11workbench/X11workbench.c
76 // Contains 2306 lines.
77 // Source language is c.
78 // Compiled with DWARF 2 debugging format.
79 // Does not include preprocessor macro info.
80 //
81 //
82 // info sources
83 // information on ALL source files. output similar to this:
84 // Source files for which symbols have been read in:
85 //
86 // X11workbench.c, file_help.h, window_helper.h
87 //
88 // Source files for which symbols will be read in on demand:
89 //
90 // dialog_controls.c, dialog_window.c, clipboard_helper.c, text_object.c, platform_helper.c, window_dressing.c, draw_text.c,
91 // file_help.c, conf_help.c, menu_popup.c, menu_bar.c, menu.c, dialog_support.c, dialog_impl.c, frame_window.c, child_frame.c,
92 // edit_window.c, font_helper.c, window_helper.c, pixmap_helper.c, gizzard.c
93 //
94 //
95 // info function:
96 //
97 // command: info function WBInit\b <-- the '\b' causes an exact match
98 //
99 // output:
100 //
101 // All functions matching regular expression "WBInit\b":
102 //
103 // File window_helper.c:
104 // Display *WBInit(const char *);
105 //
106 //
107 // info functions
108 // this gives you a list of ALL functions and the source files that define them. example:
109 //
110 // All defined functions:
111 //
112 // File pixmap_helper.c:
113 // Pixmap PXM_GetIconPixmap(int, XPM_ATTRIBUTES *, Pixmap *);
114 // Pixmap PXM_GetIconPixmapFromAtom(Atom, XPM_ATTRIBUTES *, Pixmap *);
115 // ...
116 // static int clip255(int);
117 //
118 // File font_helper.c:
119 // XFontStruct *WBCopyFont(XFontStruct *);
120 // XFontSet WBCopyModifyFontSet(Display *, XFontSet, int, int);
121 // void WBDumpFontInfo(const char *);
122 // int WBFontAvgCharWidth(Display *, const XFontStruct *);
123 // ...
124 //
125 // etc.
126 //
127 // the list will include static functions appropriate to each source file, and ends with
128 // a bunch of addresses labeled 'non-debugging symbols':
129 //
130 // Non-debugging symbols:
131 // 0x0000000000404248 _init
132 // 0x000000000040426c XSetInputFocus
133 // 0x000000000040427c XFreePixmap
134 // ...
135 // 0x0000000000405070 _start
136 // 0x0000000000405110 __do_global_dtors_aux
137 // 0x0000000000405150 frame_dummy
138 // 0x0000000000453f80 __do_global_ctors_aux
139 // 0x0000000000453fb4 _fini
140 //
141 // Apparently, none of these have source available (typically contained in a linked-to library)
142 //
143 //
144 //
145 // other commands like list, backtrace, breakpoint, etc. can be applied as needed.
146 //
147 //
148 
149 
150 
151 
152