Thu Jul 27 17:38:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
[binutils-gdb.git] / gdb / TODO
1 If you find inaccuracies in this list, please send mail to
2 gdb-patches@sourceware.cygnus.com. If you would like to work on any
3 of these, you should consider sending mail to the same address, to
4 find out whether anyone else is working on it.
5
6
7 Known problems in GDB 5.0
8 =========================
9
10 Below is a list of problems identified during the GDB 5.0 release
11 cycle. People hope to have these problems fixed in a follow-on
12 release.
13
14 --
15
16 The BFD directory requires bug-fixed AUTOMAKE et.al.
17
18 AUTOMAKE 1.4 incorrectly set the TEXINPUTS environment variable. It
19 contained the full path to texinfo.tex when it should have only
20 contained the directory. The bug has been fixed in the current
21 AUTOMAKE sources. Automake snapshots can be found in:
22 ftp://sourceware.cygnus.com/pub/gdb/snapshots
23 and ftp://sourceware.cygnus.com/pub/binutils
24
25 --
26
27 RFD: infrun.c: No bpstat_stop_status call after proceed over break?
28 http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00665.html
29
30 GDB misses watchpoint triggers after proceeding over a breakpoint on
31 x86 targets.
32
33 --
34
35 x86 linux GDB and SIGALRM (???)
36 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00803.html
37
38 This problem has been fixed, but a regression test still needs to be
39 added to the testsuite:
40 http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00309.html
41
42 Mark
43
44 --
45
46 Revised UDP support (was: Re: [Fwd: [patch] UDP transport support])
47 http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00000.html
48
49 (Broken) support for GDB's remote protocol across UDP is to be
50 included in the follow-on release.
51
52 It should be noted that UDP can only work when the [Gg] packet fits in
53 a single UDP packet.
54
55 --
56
57 Can't build IRIX -> arm GDB.
58 http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00356.html
59
60 David Whedon writes:
61 > Now I'm building for an embedded arm target. If there is a way of turning
62 > remote-rdi off, I couldn't find it. It looks like it gets built by default
63 > in gdb/configure.tgt(line 58) Anyway, the build dies in
64 > gdb/rdi-share/unixcomm.c. SERPORT1 et. al. never get defined because we
65 > aren't one of the architectures supported.
66
67 --
68
69 Problem with weak functions
70 http://sourceware.cygnus.com/ml/gdb/2000-05/msg00060.html
71
72 Dan Nicolaescu writes:
73 > It seems that gdb-4.95.1 does not display correctly the function when
74 > stoping in weak functions.
75 >
76 > It stops in a function that is defined as weak, not in the function
77 > that is actualy run...
78
79 --
80
81 GDB 5.0 doesn't work on Linux/SPARC
82
83 --
84
85 Code Cleanups: Next Release
86 ===========================
87
88 The following are small cleanups that will hopefully be completed by
89 the follow on to 5.0.
90
91 --
92
93 Delete macro TARGET_BYTE_ORDER_SELECTABLE.
94
95 Patches in the database.
96
97 --
98
99 Purge PARAMS.
100
101 Eliminate all uses of PARAMS in GDB's source code.
102
103 --
104
105 Fix copyright notices.
106
107 Turns out that ``1998-2000'' isn't considered valid :-(
108
109 http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00467.html
110
111 --
112
113 Find something better than DEFAULT_BFD_ARCH, DEFAULT_BFD_VEC to
114 determine the default isa/byte-order.
115
116 --
117
118 Rely on BFD_BIG_ENDIAN and BFD_LITTLE_ENDIAN instead of host dependant
119 BIG_ENDIAN and LITTLE_ENDIAN.
120
121 --
122
123 printcmd.c (print_address_numeric):
124
125 NOTE: This assumes that the significant address information is kept in
126 the least significant bits of ADDR - the upper bits were either zero
127 or sign extended. Should ADDRESS_TO_POINTER() or some
128 ADDRESS_TO_PRINTABLE() be used to do the conversion?
129
130 --
131
132 Code Cleanups: General
133 ======================
134
135 The following are more general cleanups and fixes. They are not tied
136 to any specific release.
137
138 --
139
140 Eliminate more compiler warnings.
141
142 Of course there also needs to be the usual debate over which warnings
143 are valid and how to best go about this.
144
145 One method: choose a single option; get agreement that it is
146 reasonable; try it out to see if there isn't anything silly about it
147 (-Wunused-parameters is an example of that) then incrementally hack
148 away.
149
150 The other method is to enable all warnings and eliminate them from one
151 file at a time.
152
153 --
154
155 Elimination of ``(catch_errors_ftype *) func''.
156
157 Like make_cleanup_func it isn't portable.
158 http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00791.html
159 http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00814.html
160
161
162 --
163
164 Nuke USG define.
165
166 --
167
168 [PATCH/5] src/intl/Makefile.in:distclean additions
169 http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00363.html
170
171 Do not forget to merge the patch back into the trunk.
172
173 --
174
175 Rationalize the host-endian code (grep for HOST_BYTE_ORDER).
176
177 At present defs.h includes <endian.h> (which is linux specific) yet
178 almost nothing depends on it. Suggest "gdb_endian.h" which can also
179 handle <machine/endian.h> and only include that where it is really
180 needed.
181
182 --
183
184 Replace asprintf() calls with xasprintf() calls.
185
186 As with things like strdup() most calls to asprintf() don't check the
187 return value.
188
189 --
190
191 Replace strsave() + mstrsave() with libiberty:xstrdup().
192
193 --
194
195 Replace savestring() with something from libiberty.
196
197 An xstrldup()? but that would have different semantics.
198
199 --
200
201 Rationalize use of floatformat_unknown in GDB sources.
202
203 Instead of defaulting to floatformat_unknown, should hosts/targets
204 specify the value explicitly?
205
206 http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00447.html
207
208 --
209
210 Add a ``name'' member to include/floatformat.h:struct floatformat.
211 Print that name in gdbarch.c.
212
213 --
214
215 Sort out the harris mess in include/floatformat.h (it hardwires two
216 different floating point formats).
217
218 --
219
220 See of the GDB local floatformat_do_doublest() and libiberty's
221 floatformat_to_double (which was once GDB's ...) can be merged some
222 how.
223
224 --
225
226 Eliminate mmalloc() from GDB.
227
228 Also eliminate it from defs.h.
229
230 --
231
232 Eliminate PTR. ISO-C allows ``void *''.
233
234 --
235
236 Eliminate abort ().
237
238 GDB should never abort. GDB should either throw ``error ()'' or
239 ``internal_error ()''. Better still GDB should naturally unwind with
240 an error status.
241
242 --
243
244 GDB probably doesn't build on FreeBSD pre 2.2.x
245 http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00378.html
246
247 Fixes to get FreeBSD working on 2.2.x, 3.x and 4.x caused the code to
248 suffer bit rot.
249
250 --
251
252 Deprecate "fg". Apparently ``fg'' is actually continue.
253
254 http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00417.html
255
256 --
257
258 Deprecate current use of ``floatformat_unknown''.
259
260 Require all targets to explicitly provide their float format instead
261 of defaulting to floatformat unknown. Doing the latter leads to nasty
262 bugs.
263
264 http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00447.html
265
266 --
267
268 Rationalize floatformat_to_double() vs floatformat_to_doublest().
269
270 Looks like GDB migrated floatformat_to_double() to libiberty but then
271 turned around and created a ..._to_doublest() the latter containing
272 several bug fixes.
273
274 http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00472.html
275
276 --
277
278 Move floatformat_ia64_ext to libiberty/include floatformat.[ch].
279
280 http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00466.html
281
282 --
283
284 Follow through `make check' with --enable-shared.
285
286 When the srcware tree is configured with --enable-shared, the `expect'
287 program won't run properly. Jim Wilson found out gdb has a local hack
288 to set LD_LIBRARY_PATH, but, AFAIK, no other project has been hacked
289 similarly.
290
291 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00845.html
292
293 --
294
295 The ``maintenance deprecate set endian big'' command doesn't notice
296 that it is deprecating ``set endian'' and not ``set endian big'' (big
297 is implemented using an enum). Is anyone going to notice this?
298
299 --
300
301 When tab expanding something like ``set arch<tab>'' ignore the
302 deprecated ``set archdebug'' and expand to ``set architecture''.
303
304 --
305
306 Eliminate ``arm_register_names[j] = (char *) regnames[j]'' and the
307 like from arm-tdep.c.
308
309 --
310
311 Fix uses of ->function.cfunc = set_function().
312
313 The command.c code calls sfunc() when a set command. Rather than
314 change it suggest fixing the callback function so that it is more
315 useful. See:
316
317 http://sourceware.cygnus.com/ml/gdb-patches/2000-06/msg00062.html
318
319 See also ``Fix implementation of ``target xxx''.'' below.
320
321 --
322
323 IRIX 3.x support is probably broken.
324
325 --
326
327 Delete sim/SIM_HAVE_BREAKPOINTS and gdb/SIM_HAS_BREAKPOINTS.
328 http://sourceware.cygnus.com/ml/gdb-patches/2000-07/msg00042.html
329
330 Apart from the d30v, are there any sim/common simulators that make use
331 of this?
332
333 A brief summary of what happended is that sim/common/sim-break.c was
334 created as a good idea. It turned out a better idea was to use
335 SIM_SIGBREAK and have GDB pass back sim_resume (..., SIGBREAK).
336
337 --
338
339 parse.c:build_parse() has a buffer overrun.
340
341 --
342
343 New Features and Fixes
344 ======================
345
346 These are harder than cleanups but easier than work involving
347 fundamental architectural change.
348
349 --
350
351 Add built-by, build-date, tm, xm, nm and anything else into gdb binary
352 so that you can see how the GDB was created.
353
354 --
355
356 Add an "info bfd" command that displays supported object formats,
357 similarly to objdump -i.
358
359 Is there a command already?
360
361 --
362
363 Fix ``I'm sorry, Dave, I can't do that.'' from symfile.c.
364
365 This requires internationalization.
366
367 --
368
369 Add support for:
370
371 (gdb) p fwprintf(stdout,L"%S\n", f)
372 No symbol "L" in current context.
373
374 --
375
376 Convert GDB build process to AUTOMAKE.
377
378 See also sub-directory configure below.
379
380 The current convention is (kind of) to use $(<header>_h) in all
381 dependency lists. It isn't done in a consistent way.
382
383 --
384
385 Cleanup configury support for optional sub-directories.
386
387 Check how GCC handles multiple front ends for an example of how things
388 could work. A tentative first step is to rationalize things so that
389 all sub directories are handled in a fashion similar to gdb/mi.
390
391 See also automake above.
392
393 --
394
395 Restructure gdb directory tree so that it avoids any 8.3 and 14
396 filename problems.
397
398 --
399
400 Add a transcript mechanism to GDB.
401
402 Such a mechanism might log all gdb input and output to a file in a
403 form that would allow it to be replayed. It could involve ``gdb
404 --transcript=FILE'' or it could involve ``(gdb) transcript file''.
405
406 --
407
408 Can the xdep files be replaced by autoconf?
409
410 --
411
412 Document trace machinery
413
414 --
415
416 Document ui-out and ui-file.
417
418 http://sourceware.cygnus.com/ml/gdb/2000-04/msg00121.html
419
420 --
421
422 Update texinfo.tex to latest?
423
424
425
426 --
427
428 Incorporate agentexpr.texi into gdb.texinfo
429
430 agentexpr.texi mostly describes the details of the byte code used for
431 tracepoints, not the internals of the support for this in GDB. So it
432 looks like gdb.texinfo is a better place for this information.
433
434 http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00566.html
435
436 --
437
438 Document overlay machinery.
439
440 --
441
442 ``(gdb) catch signal SIGNAL''
443
444 Overlaps with ``handle SIGNAL'' but the implied behavour is different.
445 You can attach commands to a catch but not a handle. A handle has a
446 limited number of hardwired actions.
447
448 --
449
450 Get the TUI working on all platforms.
451
452 --
453
454 Add support for ``gdb --- PROGRAM ARGS ...''.
455 Add support for ``gdb -cmd=...''
456
457 Along with many variations. Check:
458
459 ????? for a full discussion.
460
461 for a discussion.
462
463 --
464
465 Implement ``(gdb) !ls''.
466
467 Which is very different from ``(gdb) ! ls''. Implementing the latter
468 is trivial.
469
470 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00034.html
471
472 --
473
474 Change the (char *list[]) to (const char (*)[]) so that dynamic lists can
475 be passed.
476
477 --
478
479 When tab expanding something like ``set arch<tab>'' ignore the
480 deprecated ``set archdebug'' and expand to ``set architecture''.
481
482 --
483
484 Replace the code that uses the host FPU with an emulator of the target
485 FPU.
486
487 --
488
489 Thread Support
490 ==============
491
492 --
493
494 Generic: lin-thread cannot handle thread exit (Mark Kettenis, Michael
495 Snyder) http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00525.html
496
497 The thread_db assisted debugging code doesn't handle exiting threads
498 properly, at least in combination with glibc 2.1.3 (the framework is
499 there, just not the actual code). There are at least two problems
500 that prevent this from working.
501
502 As an additional reference point, the pre thread_db code did not work
503 either.
504
505 --
506
507 GNU/Linux/x86 and random thread signals (and Solaris/SPARC but not
508 Solaris/x86).
509 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00336.html
510
511 Christopher Blizzard writes:
512
513 So, I've done some more digging into this and it looks like Jim
514 Kingdon has reported this problem in the past:
515
516 http://sourceware.cygnus.com/ml/bug-gdb/1999-10/msg00058.html
517
518 I can reproduce this problem both with and without Tom's patch. Has
519 anyone seen this before? Maybe have a solution for it hanging around?
520 :)
521
522 There's a test case for this documented at:
523
524 when debugging threaded applications you get extra SIGTRAPs
525 http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=9565
526
527 [There should be a GDB testcase - cagney]
528
529 --
530
531 GDB5 TOT on unixware 7
532 http://sourceware.cygnus.com/ml/gdb/2000-04/msg00119.html
533
534 Robert Lipe writes:
535 > I just spun the top of tree of the GDB5 branch on UnixWare 7. As a
536 > practical matter, the current thread support is somewhat more annoying
537 > than when GDB was thread-unaware.
538
539 --
540
541 Migrate qfThreadInfo packet -> qThreadInfo. (Andrew Cagney)
542
543 Add support for packet enable/disable commands with these thread
544 packets. General cleanup.
545
546 [PATCH] Document the ThreadInfo remote protocol queries
547 http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00832.html
548
549 [PATCH] "info threads" queries for remote.c
550 http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00831.html
551
552 --
553
554 Language Support
555 ================
556
557 New languages come onto the scene all the time.
558
559 --
560
561 Pascal (Pierre Muller, David Taylor)
562
563 Pierre Muller has contributed patches for adding Pascal Language
564 support to GDB.
565
566 2 pascal language patches inserted in database
567 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00521.html
568
569 Indent -gnu ?
570 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00496.html
571
572 --
573
574 Java (Anthony Green, David Taylor)
575
576 Anthony Green has a number of Java patches that did not make it into
577 the 5.0 release. The first two are in cvs now, but the third needs
578 some fixing up before it can go in.
579
580 Patch: java tests
581 http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00512.html
582
583 Patch: java booleans
584 http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00515.html
585
586 Patch: handle N_MAIN stab
587 http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00527.html
588
589 --
590
591 [Comming...]
592
593 Modify gdb to work correctly with Pascal.
594
595 --
596
597 Re: Various C++ things
598
599 value_headof/value_from_vtable_info are worthless, and should be
600 removed. The one place in printcmd.c that uses it should use the RTTI
601 functions.
602
603 RTTI for g++ should be using the typeinfo functions rather than the
604 vtables. The typeinfo functions are always at offset 4 from the
605 beginning of the vtable, and are always right. The vtables will have
606 weird names like E::VB sometimes. The typeinfo function will always
607 be "E type_info function", or somesuch.
608
609 value_virtual_fn_field needs to be fixed so there are no failures for
610 virtual functions for C++ using g++.
611
612 Testsuite cases are the major priority right now for C++ support,
613 since i have to make a lot of changes that could potentially break
614 each other.
615
616 --
617
618 Add support for Modula3
619
620 Get DEC/Compaq to contribute their Modula-3 support.
621
622 --
623
624 Remote Protocol Support
625 =======================
626
627 --
628
629 Remote protocol doco feedback.
630
631 Too much feedback to mention needs to be merged in (901660). Search
632 for the word ``remote''.
633
634
635 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00023.html
636 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00056.html
637 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00382.html
638
639 --
640
641 GDB doesn't recover gracefully from remote protocol errors.
642
643 GDB wasn't checking for NAKs from the remote target. Instead a NAK is
644 ignored and a timeout is required before GDB retries. A pre-cursor to
645 fixing this this is making GDB's remote protocol packet more robust.
646
647 While downloading to a remote protocol target, gdb ignores packet
648 errors in so far as it will continue to edownload with chunk N+1 even
649 if chunk N was not correctly sent. This causes gdb.base/remote.exp to
650 take a painfully long time to run. As a PS that test needs to be
651 fixed so that it builds on 16 bit machines.
652
653 --
654
655 Add the cycle step command.
656
657 http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00237.html
658
659 --
660
661 Resolve how to scale things to support very large packets.
662
663 --
664
665 Resolve how to handle a target that changes things like its endianess
666 on the fly - should it be returned in the ``T'' packet?
667
668 Underlying problem is that the register file is target endian. If the
669 target endianess changes gdb doesn't know.
670
671 --
672
673 Use the recently added add_set_auto_boolean_cmd() function to
674 implement the X-packet commands.
675
676 --
677
678 Rename read_register{,_pid}() to read_unsigned_register{,_pid}().
679
680 --
681
682 Symbol Support
683 ==============
684
685 If / when GDB starts to support the debugging of multi-processor
686 (rather than multi-thread) applications the symtab code will need to
687 be updated a little so that several independant symbol tables are
688 active at a given time.
689
690 The other interesting change is a clarification of the exact meaning
691 of CORE_ADDR and that has had consequences for a few targets (that
692 were abusing that data type).
693
694 --
695
696 Investiagate ways of reducing memory.
697
698 --
699
700 Investigate ways of improving load time.
701
702 --
703
704 Get the d10v to use POINTER_TO_ADDRESS and ADDRESS_TO_POINTER.
705
706 Consequence of recent symtab clarification. No marks for figuring out
707 who maintains the d10v.
708
709 --
710
711 Get the MIPS to correctly sign extend all address <-> pointer
712 conversions.
713
714 Consequence of recent symtab clarification. No marks for figuring out
715 who maintains the MIPS.
716
717 --
718
719 GDB truncates 64 bit enums.
720
721 http://sourceware.cygnus.com/ml/gdb-patches/2000-06/msg00290.html
722
723 --
724
725 Testsuite Support
726 =================
727
728 There are never to many testcases.
729
730 --
731
732 Better thread testsuite.
733
734 --
735
736 Better C++ testsuite.
737
738 --
739
740 Look at adding a GDB specific testsuite directory so that white box
741 tests of key internals can be added (eg ui_file).
742
743 --
744
745 Separate out tests that involve the floating point (FP).
746
747 (Something for people brining up new targets). FP and non-fp tests
748 are combined. I think there should be set of basic tests that
749 exercise pure integer support and then a more expanded set that
750 exercise FP and FP/integer interactions.
751
752 As an example, the MIPS, for n32 as problems with passing FP's and
753 structs. Since most inferior call tests include FP it is difficult to
754 determine of the integer tests are ok.
755
756 --
757
758 Architectural Changes: General
759 ==============================
760
761 These are harder than simple cleanups / fixes and, consequently
762 involve more work. Typically an Architectural Change will be broken
763 down into a more digestible set of cleanups and fixes.
764
765 --
766
767 Cleanup software single step.
768
769 At present many targets implement software single step by directly
770 blatting memory (see rs6000-tdep.c). Those targets should register
771 the applicable breakpoints using the breakpoint framework. Perhaphs a
772 new internal breakpoint class ``step'' is needed.
773
774 --
775
776 Replace READ_FP() with FRAME_HANDLE().
777
778 READ_FP() is a hangover from the days of the vax when the ABI really
779 did have a frame pointer register. Modern architectures typically
780 construct a virtual frame-handle from the stack pointer and various
781 other bits of string.
782
783 Unfortunatly GDB still treats this synthetic FP register as though it
784 is real. That in turn really confuses users (arm and ``print $fp'' VS
785 ``info registers fp''). The synthetic FP should be separated out of
786 the true register set presented to the user.
787
788 --
789
790 Register Cache Cleanup (below from Andrew Cagney)
791
792 I would depict the current register architecture as something like:
793
794 High GDB --> Low GDB
795 | |
796 \|/ \|/
797 --- REG NR -----
798 |
799 register + REGISTER_BYTE(reg_nr)
800 |
801 \|/
802 -------------------------
803 | extern register[] |
804 -------------------------
805
806 where neither the high (valops.c et.al.) or low gdb (*-tdep.c) are
807 really clear on what mechanisms they should be using to manipulate that
808 buffer. Further, much code assumes, dangerously, that registers are
809 contigious. Having got mips-tdep.c to support multiple ABIs, believe
810 me, that is a bad assumption. Finally, that register cache layout is
811 determined by the current remote/local target and _not_ the less
812 specific target ISA. In fact, in many cases it is determined by the
813 somewhat arbitrary layout of the [gG] packets!
814
815
816 How I would like the register file to work is more like:
817
818
819 High GDB
820 |
821 \|/
822 pseudo reg-nr
823 |
824 map pseudo <->
825 random cache
826 bytes
827 |
828 \|/
829 ------------
830 | register |
831 | cache |
832 ------------
833 /|\
834 |
835 map random cache
836 bytes to target
837 dependant i-face
838 /|\
839 |
840 target dependant
841 such as [gG] packet
842 or ptrace buffer
843
844 The main objectives being:
845
846 o a clear separation between the low
847 level target and the high level GDB
848
849 o a mechanism that solves the general
850 problem of register aliases, overlaps
851 etc instead of treating them as optional
852 extras that can be wedged in as an after
853 thought (that is a reasonable description
854 of the current code).
855
856 Identify then solve the hard case and the
857 rest just falls out. GDB solved the easy
858 case and then tried to ignore the real
859 world :-)
860
861 o a removal of the assumption that the
862 mapping between the register cache
863 and virtual registers is largely static.
864 If you flip the USR/SSR stack register
865 select bit in the status-register then
866 the corresponding stack registers should
867 reflect the change.
868
869 o a mechanism that clearly separates the
870 gdb internal register cache from any
871 target (not architecture) dependant
872 specifics such as [gG] packets.
873
874 Of course, like anything, it sounds good in theory. In reality, it
875 would have to contend with many<->many relationships at both the
876 virt<->cache and cache<->target level. For instance:
877
878 virt<->cache
879 Modifying an mmx register may involve
880 scattering values across both FP and
881 mmpx specific parts of a buffer
882
883 cache<->target
884 When writing back a SP it may need to
885 both be written to both SP and USP.
886
887
888 Hmm,
889
890 Rather than let this like the last time it was discussed, just slip, I'm
891 first going to add this e-mail (+ references) to TODO. I'd then like to
892 sketch out a broad strategy I think could get us there.
893
894
895 First thing I'd suggest is separating out the ``extern registers[]''
896 code so that we can at least identify what is using it. At present
897 things are scattered across many files. That way we can at least
898 pretend that there is a cache instead of a global array :-)
899
900 I'd then suggest someone putting up a proposal for the pseudo-reg /
901 high-level side interface so that code can be adopted to it. For old
902 code, initially a blanket rename of write_register_bytes() to
903 deprecated_write_register_bytes() would help.
904
905 Following that would, finaly be the corresponding changes to the target.
906
907 --
908
909 Check that GDB can handle all BFD architectures (Andrew Cagney)
910
911 There should be a test that checks that BFD/GDB are in sync with
912 regard to architecture changes. Something like a test that first
913 queries GDB for all supported architectures and then feeds each back
914 to GDB.. Anyone interested in learning how to write tests? :-)
915
916 --
917
918 Architectural Change: Multi-arch et al.
919 =======================================
920
921 The long term objective is to remove all assumptions that there is a
922 single target with a single address space with a single instruction
923 set architecture and single application binary interface.
924
925 This is an ongoing effort. The first milestone is to enable
926 ``multi-arch'' where by all architectural decisions are made at
927 runtime.
928
929 It should be noted that ``gdbarch'' is really ``gdbabi'' and
930 ``gdbisa''. Once things are multi-arched breaking that down correctly
931 will become much easier.
932
933 --
934
935 GDBARCH cleanup (Andrew Cagney)
936
937 The non-generated parts of gdbarch.{sh,h,c} should be separated out
938 into arch-utils.[hc].
939
940 Document that gdbarch_init_ftype could easily fail because it didn't
941 identify an architecture.
942
943 --
944
945 Fix BELIEVE_PPC_PROMOTION. Change it to BELIEVE_PPC_PROMOTION_P?
946
947 At present there is still #ifdef BELIEVE_PPC_PROMOTION code in the
948 symtab file.
949
950 --
951
952 Fix target_signal_from_host() etc.
953
954 The name is wrong for starters. ``target_signal'' should probably be
955 ``gdb_signal''. ``from_host'' should be ``from_target_signal''.
956 After that it needs to be multi-arched and made independant of any
957 host signal numbering.
958
959 --
960
961 Update ALPHA so that it uses ``struct frame_extra_info'' instead of
962 EXTRA_FRAME_INFO.
963
964 This is a barrier to replacing mips_extra_func_info with something
965 that works with multi-arch.
966
967 --
968
969 Multi-arch mips_extra_func_info.
970
971 This first needs the alpha to be updated so that it uses ``struct
972 frame_extra_info''.
973
974 --
975
976 Rationalize TARGET_SINGLE_FORMAT and TARGET_SINGLE_BIT et al.
977
978 Surely one of them is redundant.
979
980 --
981
982 Convert ALL architectures to MULTI-ARCH.
983
984 --
985
986 Select the initial multi-arch ISA / ABI based on --target or similar.
987
988 At present the default is based on what ever is first in the BFD
989 archures table. It should be determined based on the ``--target=...''
990 name.
991
992 --
993
994 Make MIPS pure multi-arch.
995
996 It is only at the multi-arch enabled stage.
997
998 --
999
1000 Truly multi-arch.
1001
1002 Enable the code to recognize --enable-targets=.... like BINUTILS does.
1003
1004 Can the tm.h and nm.h files be eliminated by multi-arch.
1005
1006 --
1007
1008 Architectural Change: MI, LIBGDB and scripting languages
1009 ========================================================
1010
1011 See also architectural changes related to the event loop. LIBGDB
1012 can't be finished until there is a generic event loop being used by
1013 all targets.
1014
1015 The long term objective is it to be possible to integrate GDB into
1016 scripting languages.
1017
1018 --
1019
1020 Implement generic ``(gdb) commmand > file''
1021
1022 Once everything is going through ui_file it should be come fairly
1023 easy.
1024
1025 http://sourceware.cygnus.com/ml/gdb/2000-04/msg00104.html
1026
1027 --
1028
1029 Replace gdb_stdtarg with gdb_targout (and possibly gdb_targerr).
1030
1031 gdb_stdtarg is easily confused with gdb_stdarg.
1032
1033 --
1034
1035 Extra ui_file methods - dump.
1036
1037 Very useful for whitebox testing.
1038
1039 --
1040
1041 Eliminate error_begin().
1042
1043 With ui_file, there is no need for the statefull error_begin ()
1044 function.
1045
1046 --
1047
1048 Send normal output to gdb_stdout.
1049 Send error messages to gdb_stderror.
1050 Send debug and log output log gdb_stdlog.
1051
1052 GDB still contains many cases where (f)printf or printf_filtered () is
1053 used when it should be sending the messages to gdb_stderror or
1054 gdb_stdlog. The thought of #defining printf to something has crossed
1055 peoples minds ;-)
1056
1057 --
1058
1059 Re-do GDB's output pager.
1060
1061 GDB's output pager still relies on people correctly using *_filtered
1062 for gdb_stdout and *_unfiltered for gdb_stdlog / gdb_stderr.
1063 Hopefully, with all normal output going to gdb_stdout, the pager can
1064 just look at the ui_file that the output is on and then use that to
1065 decide what to do about paging. Sounds good in theory.
1066
1067 --
1068
1069 Check/cleanup MI documentation.
1070
1071 The list of commands specified in the documentation needs to be
1072 checked against the mi-cmds.c table in a mechanical way (so that they
1073 two can be kept up-to-date).
1074
1075 --
1076
1077 Convert MI into libgdb
1078
1079 MI provides a text interface into what should be many of the libgdb
1080 functions. The implementation of those functions should be separated
1081 into the MI interface and the functions proper. Those functions being
1082 moved to gdb/lib say.
1083
1084 --
1085
1086 Create libgdb.h
1087
1088 The first part can already be found in defs.h.
1089
1090 --
1091
1092 MI's input does not use buffering.
1093
1094 At present the MI interface reads raw characters of from an unbuffered
1095 FD. This is to avoid several nasty buffer/race conditions. That code
1096 should be changed so that it registers its self with the event loop
1097 (on the input FD) and then push commands up to MI as they arrive.
1098
1099 The serial code already does this.
1100
1101 --
1102
1103 Make MI interface accessable from existing CLI.
1104
1105 --
1106
1107 Add a breakpoint-edit command to MI.
1108
1109 It would be similar to MI's breakpoint create but would apply to an
1110 existing breakpoint. It saves the need to delete/create breakpoints
1111 when ever they are changed.
1112
1113 --
1114
1115 Add directory path to MI breakpoint.
1116
1117 That way the GUI's task of finding the file within which the
1118 breakpoint was set is simplified.
1119
1120 --
1121
1122 Add a mechanism to reject certain expression classes to MI
1123
1124 There are situtations where you don't want GDB's expression
1125 parser/evaluator to perform inferior function calls or variable
1126 assignments. A way of restricting the expression parser so that such
1127 operations are not accepted would be very helpful.
1128
1129 --
1130
1131 Remove sideffects from libgdb breakpoint create function.
1132
1133 The user can use the CLI to create a breakpoint with partial
1134 information - no file (gdb would use the file from the last
1135 breakpoint).
1136
1137 The libgdb interface currently affects that environment which can lead
1138 to confusion when a user is setting breakpoints via both the MI and
1139 the CLI.
1140
1141 This is also a good example of how getting the CLI ``right'' will be
1142 hard.
1143
1144 --
1145
1146 Move gdb_lasterr to ui_out?
1147
1148 The way GDB throws errors and records them needs a re-think. ui_out
1149 handles the correct output well. It doesn't resolve what to do with
1150 output / error-messages when things go wrong.
1151
1152 --
1153
1154 do_setshow_command contains a 1024 byte buffer.
1155
1156 The function assumes that there will never be any more than 1024 bytes
1157 of enum. It should use mem_file.
1158
1159 --
1160
1161 Should struct cmd_list_element . completer take the command as an
1162 argument?
1163
1164 --
1165
1166 Should the bulk of top.c:line_completion_function() be moved to
1167 command.[hc]? complete_on_cmdlist() and complete_on_enums() could
1168 then be made private.
1169
1170 --
1171
1172 top.c (execute_command): Should a command being valid when the target
1173 is running be made an attribute (predicate) to the command rather than
1174 an explicit set of tests.
1175
1176 --
1177
1178 top.c (execute_command): Should the bulk of this function be moved
1179 into command.[hc] so that top.c doesn't grub around in the command
1180 internals?
1181
1182 --
1183
1184 Architectural Change: Async
1185 ===========================
1186
1187 While GDB uses an event loop when prompting the user for input. That
1188 event loop is not exploited by targets when they allow the target
1189 program to continue. Typically targets still block in (target_wait())
1190 until the program again halts.
1191
1192 The closest a target comes to supporting full asynchronous mode are
1193 the remote targets ``async'' and ``extended-async''.
1194
1195 --
1196
1197 Asynchronous expression evaluator
1198
1199 Inferior function calls hang GDB.
1200
1201 --
1202
1203 Fix implementation of ``target xxx''.
1204
1205 At present when the user specifies ``target xxxx'', the CLI maps that
1206 directly onto a target open method. It is then assumed that the
1207 target open method should do all sorts of complicated things as this
1208 is the only chance it has. Check how the various remote targets
1209 duplicate the target operations. Check also how the various targets
1210 behave differently for purely arbitrary reasons.
1211
1212 What should happen is that ``target xxxx'' should call a generic
1213 ``target'' function and that should then co-ordinate the opening of
1214 ``xxxx''. This becomes especially important when you're trying to
1215 open an asynchronous target that may need to perform background tasks
1216 as part of the ``attach'' phase.
1217
1218 Unfortunatly, due to limitations in the old/creaking command.h
1219 interface, that isn't possible. The function being called isn't told
1220 of the ``xxx'' or any other context information.
1221
1222 Consequently a precursor to fixing ``target xxxx'' is to clean up the
1223 CLI code so that it passes to the callback function (attatched to a
1224 command) useful information such as the actual command and a context
1225 for that command. Other changes such as making ``struct command''
1226 opaque may also help.
1227
1228 See also:
1229 http://sourceware.cygnus.com/ml/gdb-patches/2000-06/msg00062.html
1230
1231 --
1232
1233 Make "target xxx" command interruptible.
1234
1235 As things become async this becomes possible. A target would start
1236 the connect and then return control to the event loop. A cntrl-c
1237 would notify the target that the operation is to be abandoned and the
1238 target code could respond.
1239
1240 --
1241
1242 Add a "suspend" subcommand of the "continue" command to suspend gdb
1243 while continuing execution of the subprocess. Useful when you are
1244 debugging servers and you want to dodge out and initiate a connection
1245 to a server running under gdb.
1246
1247 [hey async!!]
1248
1249 --
1250
1251 TODO FAQ
1252 ========
1253
1254 Frequently requested but not approved requests.
1255
1256 --
1257
1258 Eliminate unused argument warnings using ATTRIBUTE_UNUSED.
1259
1260 The benefits on this one are thought to be marginal - GDBs design
1261 means that unused parameters are very common. GCC 3.0 will also
1262 include the option -Wno-unused-parameter which means that ``-Wall
1263 -Wno-unused-parameters -Werror'' can be specified.
1264
1265 --
1266
1267
1268
1269 Legacy Wish List
1270 ================
1271
1272 This list is not up to date, and opinions vary about the importance or
1273 even desirability of some of the items. If you do fix something, it
1274 always pays to check the below.
1275
1276 --
1277
1278 @c This does not work (yet if ever). FIXME.
1279 @c @item --parse=@var{lang} @dots{}
1280 @c Configure the @value{GDBN} expression parser to parse the listed languages.
1281 @c @samp{all} configures @value{GDBN} for all supported languages. To get a
1282 @c list of all supported languages, omit the argument. Without this
1283 @c option, @value{GDBN} is configured to parse all supported languages.
1284
1285 --
1286
1287 START_INFERIOR_TRAPS_EXPECTED need never be defined to 2, since that
1288 is its default value. Clean this up.
1289
1290 --
1291
1292 It should be possible to use symbols from shared libraries before we know
1293 exactly where the libraries will be loaded. E.g. "b perror" before running
1294 the program. This could maybe be done as an extension of the "breakpoint
1295 re-evaluation" after new symbols are loaded.
1296
1297 --
1298
1299 Make single_step() insert and remove breakpoints in one operation.
1300
1301 [If this is talking about having single_step() insert the breakpoints,
1302 run the target then pull the breakpoints then it is wrong. The
1303 function has to return as control has to eventually be passed back to
1304 the main event loop.]
1305
1306 --
1307
1308 Speed up single stepping by avoiding extraneous ptrace calls.
1309
1310 --
1311
1312 Speed up single stepping by not inserting and removing breakpoints
1313 each time the inferior starts and stops.
1314
1315 Breakpoints should not be inserted and deleted all the time. Only the
1316 one(s) there should be removed when we have to step over one. Support
1317 breakpoints that don't have to be removed to step over them.
1318
1319 [this has resulted in numerous debates. The issue isn't clear cut]
1320
1321 --
1322
1323 Provide "voodoo" debugging of core files. This creates a zombie
1324 process as a child of the debugger, and loads it up with the data,
1325 stack, and regs of the core file. This allows you to call functions
1326 in the executable, to manipulate the data in the core file.
1327
1328 [you wish]
1329
1330 --
1331
1332 GDB reopens the source file on every line, as you "next" through it.
1333
1334 [still true? I've a memory of this being fixed]
1335
1336 --
1337
1338 Perhaps "i source" should take an argument like that of "list".
1339
1340 --
1341
1342 Remove "at 0xnnnn" from the "b foo" response, if `print address off' and if
1343 it matches the source line indicated.
1344
1345 --
1346
1347 The prompt at end of screen should accept space as well as CR.
1348
1349 --
1350
1351 Backtrace should point out what the currently selected frame is, in
1352 its display, perhaps showing "@3 foo (bar, ...)" or ">3 foo (bar,
1353 ...)" rather than "#3 foo (bar, ...)".
1354
1355 --
1356
1357 "i program" should work for core files, and display more info, like what
1358 actually caused it to die.
1359
1360 --
1361
1362 "x/10i" should shorten the long name, if any, on subsequent lines.
1363
1364 --
1365
1366 "next" over a function that longjumps, never stops until next time you happen
1367 to get to that spot by accident. E.g. "n" over execute_command which has
1368 an error.
1369
1370 --
1371
1372 "set zeroprint off", don't bother printing members of structs which
1373 are entirely zero. Useful for those big structs with few useful
1374 members.
1375
1376 --
1377
1378 GDB does four ioctl's for every command, probably switching terminal modes
1379 to/from inferior or for readline or something.
1380
1381 --
1382
1383 terminal_ours versus terminal_inferior: cache state. Switch should be a noop
1384 if the state is the same, too.
1385
1386 --
1387
1388 "i frame" shows wrong "arglist at" location, doesn't show where the args
1389 should be found, only their actual values.
1390
1391 --
1392
1393 There should be a way for "set" commands to validate the new setting
1394 before it takes effect.
1395
1396 --
1397
1398 "ena d" is ambiguous, why? "ena delete" seems to think it is a command!
1399
1400 --
1401
1402 i line VAR produces "Line number not known for symbol ``var''.". I
1403 thought we were stashing that info now!
1404
1405 --
1406
1407 We should be able to write to random files at hex offsets like adb.
1408
1409 --
1410
1411 [elena - delete this]
1412
1413 Handle add_file with separate text, data, and bss addresses. Maybe
1414 handle separate addresses for each segment in the object file?
1415
1416 --
1417
1418 [Jimb/Elena delete this one]
1419
1420 Handle free_named_symtab to cope with multiply-loaded object files
1421 in a dynamic linking environment. Should remember the last copy loaded,
1422 but not get too snowed if it finds references to the older copy.
1423
1424 --
1425
1426 [elena delete this also]
1427
1428 Remove all references to:
1429 text_offset
1430 data_offset
1431 text_data_start
1432 text_end
1433 exec_data_offset
1434 ...
1435 now that we have BFD. All remaining are in machine dependent files.
1436
1437 --
1438
1439 Re-organize help categories into things that tend to fit on a screen
1440 and hang together.
1441
1442 --
1443
1444 Add in commands like ADB's for searching for patterns, etc. We should
1445 be able to examine and patch raw unsymboled binaries as well in gdb as
1446 we can in adb. (E.g. increase the timeout in /bin/login without source).
1447
1448 [actually, add ADB interface :-]
1449
1450 --
1451
1452 When doing "step" or "next", if a few lines of source are skipped between
1453 the previous line and the current one, print those lines, not just the
1454 last line of a multiline statement.
1455
1456 --
1457
1458 Handling of "&" address-of operator needs some serious overhaul
1459 for ANSI C and consistency on arrays and functions.
1460 For "float point[15];":
1461 ptype &point[4] ==> Attempt to take address of non-lvalue.
1462 For "char *malloc();":
1463 ptype malloc ==> "char *()"; should be same as
1464 ptype &malloc ==> "char *(*)()"
1465 call printf ("%x\n", malloc) ==> weird value, should be same as
1466 call printf ("%x\n", &malloc) ==> correct value
1467
1468 --
1469
1470 Fix dbxread.c symbol reading in the presence of interrupts. It
1471 currently leaves a cleanup to blow away the entire symbol table when a
1472 QUIT occurs. (What's wrong with that? -kingdon, 28 Oct 1993).
1473
1474 [I suspect that the grype was that, on a slow system, you might want
1475 to cntrl-c and get just half the symbols and then load the rest later
1476 - scary to be honest]
1477
1478 --
1479
1480 Mipsread.c reads include files depth-first, because the dependencies
1481 in the psymtabs are way too inclusive (it seems to me). Figure out what
1482 really depends on what, to avoid recursing 20 or 30 times while reading
1483 real symtabs.
1484
1485 --
1486
1487 value_add() should be subtracting the lower bound of arrays, if known,
1488 and possibly checking against the upper bound for error reporting.
1489
1490 --
1491
1492 When listing source lines, check for a preceding \n, to verify that
1493 the file hasn't changed out from under us.
1494
1495 [fixed by some other means I think. That hack wouldn't actually work
1496 reliably - the file might move such that another \n appears. ]
1497
1498 --
1499
1500 Get all the remote systems (where the protocol allows it) to be able to
1501 stop the remote system when the GDB user types ^C (like remote.c
1502 does). For ebmon, use ^Ak.
1503
1504 --
1505
1506 Possible feature: A version of the "disassemble" command which shows
1507 both source and assembly code ("set symbol-filename on" is a partial
1508 solution).
1509
1510 [has this been done? It was certainly done for MI and GDBtk]
1511
1512 --
1513
1514 investigate "x/s 0" (right now stops early) (I think maybe GDB is
1515 using a 0 address for bad purposes internally).
1516
1517 --
1518
1519 Make "info path" and path_command work again (but independent of the
1520 environment either of gdb or that we'll pass to the inferior).
1521
1522 --
1523
1524 Make GDB understand the GCC feature for putting octal constants in
1525 enums. Make it so overflow on an enum constant does not error_type
1526 the whole type. Allow arbitrarily large enums with type attributes.
1527 Put all this stuff in the testsuite.
1528
1529 --
1530
1531 Make TYPE_CODE_ERROR with a non-zero TYPE_LENGTH more useful (print
1532 the value in hex; process type attributes). Add this to the
1533 testsuite. This way future compilers can add new types and old
1534 versions of GDB can do something halfway reasonable.
1535
1536 --
1537
1538 Fix mdebugread.c:parse_type to do fundamental types right (see
1539 rs6000_builtin_type in stabsread.c for what "right" is--the point is
1540 that the debug format fixes the sizes of these things and it shouldn't
1541 depend on stuff like TARGET_PTR_BIT and so on. For mdebug, there seem
1542 to be separate bt* codes for 64 bit and 32 bit things, and GDB should
1543 be aware of that). Also use a switch statement for clarity and speed.
1544
1545 --
1546
1547 Investigate adding symbols in target_load--some targets do, some
1548 don't.
1549
1550 --
1551
1552 Put dirname in psymtabs and change lookup*symtab to use dirname (so
1553 /foo/bar.c works whether compiled by cc /foo/bar.c, or cd /foo; cc
1554 bar.c).
1555
1556 --
1557
1558 Merge xcoffread.c and coffread.c. Use breakpoint_re_set instead of
1559 fixup_breakpoints.
1560
1561 --
1562
1563 Make a watchpoint which contains a function call an error (it is
1564 broken now, making it work is probably not worth the effort).
1565
1566 --
1567
1568 New test case based on weird.exp but in which type numbers are not
1569 renumbered (thus multiply defining a type). This currently causes an
1570 infinite loop on "p v_comb".
1571
1572 --
1573
1574 [Hey! Hint Hint Delete Delete!!!]
1575
1576 Fix 386 floating point so that floating point registers are real
1577 registers (but code can deal at run-time if they are missing, like
1578 mips and 68k). This would clean up "info float" and related stuff.
1579
1580 --
1581
1582 gcc -g -c enummask.c then gdb enummask.o, then "p v". GDB complains
1583 about not being able to access memory location 0.
1584
1585 -------------------- enummask.c
1586 enum mask
1587 {
1588 ANIMAL = 0,
1589 VEGETABLE = 1,
1590 MINERAL = 2,
1591 BASIC_CATEGORY = 3,
1592
1593 WHITE = 0,
1594 BLUE = 4,
1595 GREEN = 8,
1596 BLACK = 0xc,
1597 COLOR = 0xc,
1598
1599 ALIVE = 0x10,
1600
1601 LARGE = 0x20
1602 } v;
1603
1604 --
1605
1606 If try to modify value in file with "set write off" should give
1607 appropriate error not "cannot access memory at address 0x65e0".
1608
1609 --
1610
1611 Allow core file without exec file on RS/6000.
1612
1613 --
1614
1615 Make sure "shell" with no arguments works right on DOS.
1616
1617 --
1618
1619 Make gdb.ini (as well as .gdbinit) be checked on all platforms, so
1620 the same directory can be NFS-mounted on unix or DOS, and work the
1621 same way.
1622
1623 --
1624
1625 [Is this another delete???]
1626
1627 Get SECT_OFF_TEXT stuff out of objfile_relocate (might be needed to
1628 get RS/6000 to work right, might not be immediately relevant).
1629
1630 --
1631
1632 Work out some kind of way to allow running the inferior to be done as
1633 a sub-execution of, eg. breakpoint command lists. Currently running
1634 the inferior interupts any command list execution. This would require
1635 some rewriting of wait_for_inferior & friends, and hence should
1636 probably be done in concert with the above.
1637
1638 --
1639
1640 Add function arguments to gdb user defined functions.
1641
1642 --
1643
1644 Add convenience variables that refer to exec file, symbol file,
1645 selected frame source file, selected frame function, selected frame
1646 line number, etc.
1647
1648 --
1649
1650 Modify the handling of symbols grouped through BINCL/EINCL stabs to
1651 allocate a partial symtab for each BINCL/EINCL grouping. This will
1652 seriously decrease the size of inter-psymtab dependencies and hence
1653 lessen the amount that needs to be read in when a new source file is
1654 accessed.
1655
1656 --
1657
1658 Add a command for searching memory, a la adb. It specifies size,
1659 mask, value, start address. ADB searches until it finds it or hits
1660 an error (or is interrupted).
1661
1662 --
1663
1664 Remove the range and type checking code and documentation, if not
1665 going to implement.
1666
1667 # Local Variables:
1668 # mode: text
1669 # End: