OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.3/] [gdb/] [doc/] [gdbint.info-5] - Blame information for rev 1181

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
This is gdbint.info, produced by makeinfo version 4.1 from
2
./gdbint.texinfo.
3
 
4
INFO-DIR-SECTION Programming & development tools.
5
START-INFO-DIR-ENTRY
6
* Gdb-Internals: (gdbint).      The GNU debugger's internals.
7
END-INFO-DIR-ENTRY
8
 
9
   This file documents the internals of the GNU debugger GDB.
10
Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002
11
Free Software Foundation, Inc.  Contributed by Cygnus Solutions.
12
Written by John Gilmore.  Second Edition by Stan Shebs.
13
 
14
   Permission is granted to copy, distribute and/or modify this document
15
under the terms of the GNU Free Documentation License, Version 1.1 or
16
any later version published by the Free Software Foundation; with no
17
Invariant Sections, with the Front-Cover Texts being "A GNU Manual,"
18
and with the Back-Cover Texts as in (a) below.
19
 
20
   (a) The FSF's Back-Cover Text is: "You have freedom to copy and
21
modify this GNU Manual, like GNU software.  Copies published by the Free
22
Software Foundation raise funds for GNU development."
23
 
24

25
File: gdbint.info,  Node: Releasing GDB,  Next: Testsuite,  Prev: Porting GDB,  Up: Top
26
 
27
Releasing GDB
28
*************
29
 
30
Versions and Branches
31
=====================
32
 
33
Version Identifiers
34
-------------------
35
 
36
   GDB's version is determined by the file `gdb/version.in'.
37
 
38
   GDB's mainline uses ISO dates to differentiate between versions.
39
The CVS repository uses YYYY-MM-DD-cvs while the corresponding snapshot
40
uses YYYYMMDD.
41
 
42
   GDB's release branch uses a slightly more complicated scheme.  When
43
the branch is first cut, the mainline version identifier is prefixed
44
with the MAJOR.MINOR from of the previous release series but with .90
45
appended.  As draft releases are drawn from the branch, the minor minor
46
number (.90) is incremented.  Once the first release (M.N) has been
47
made, the version prefix is updated to M.N.0.90 (dot zero, dot ninety).
48
Follow on releases have an incremented minor minor version number (.0).
49
 
50
   Using 5.1 (previous) and 5.2 (current), the example below
51
illustrates a typical sequence of version identifiers:
52
 
53
5.1.1
54
     final release from previous branch
55
 
56
2002-03-03-cvs
57
     main-line the day the branch is cut
58
 
59
5.1.90-2002-03-03-cvs
60
     corresponding branch version
61
 
62
5.1.91
63
     first draft release candidate
64
 
65
5.1.91-2002-03-17-cvs
66
     updated branch version
67
 
68
5.1.92
69
     second draft release candidate
70
 
71
5.1.92-2002-03-31-cvs
72
     updated branch version
73
 
74
5.1.93
75
     final release candidate (see below)
76
 
77
5.2
78
     official release
79
 
80
5.2.0.90-2002-04-07-cvs
81
     updated CVS branch version
82
 
83
5.2.1
84
     second official release
85
 
86
   Notes:
87
 
88
   * Minor minor minor draft release candidates such as 5.2.0.91 have
89
     been omitted from the example.  Such release candidates are,
90
     typically, never made.
91
 
92
   * For 5.1.93 the bziped tar ball `gdb-5.1.93.tar.bz2' is just the
93
     official `gdb-5.2.tar' renamed and compressed.
94
 
95
   To avoid version conflicts, vendors are expected to modify the file
96
`gdb/version.in' to include a vendor unique alphabetic identifier (an
97
official GDB release never uses alphabetic characters in its version
98
identifer).
99
 
100
   Since GDB does not make minor minor minor releases (e.g., 5.1.0.1)
101
the conflict between that and a minor minor draft release identifier
102
(e.g., 5.1.0.90) is avoided.
103
 
104
Branches
105
--------
106
 
107
   GDB draws a release series (5.2, 5.2.1, ...) from a single release
108
branch (gdb_5_2-branch).  Since minor minor minor releases (5.1.0.1)
109
are not made, the need to branch the release branch is avoided (it also
110
turns out that the effort required for such a a branch and release is
111
significantly greater than the effort needed to create a new release
112
from the head of the release branch).
113
 
114
   Releases 5.0 and 5.1 used branch and release tags of the form:
115
 
116
     gdb_N_M-YYYY-MM-DD-branchpoint
117
     gdb_N_M-YYYY-MM-DD-branch
118
     gdb_M_N-YYYY-MM-DD-release
119
 
120
   Release 5.2 is trialing the branch and release tags:
121
 
122
     gdb_N_M-YYYY-MM-DD-branchpoint
123
     gdb_N_M-branch
124
     gdb_M_N-YYYY-MM-DD-release
125
 
126
   _Pragmatics: The branchpoint and release tags need to identify when
127
a branch and release are made.  The branch tag, denoting the head of the
128
branch, does not have this criteria._
129
 
130
Branch Commit Policy
131
====================
132
 
133
   The branch commit policy is pretty slack.  GDB releases 5.0, 5.1 and
134
5.2 all used the below:
135
 
136
   * The `gdb/MAINTAINERS' file still holds.
137
 
138
   * Don't fix something on the branch unless/until it is also fixed in
139
     the trunk.  If this isn't possible, mentioning it in the
140
     `gdb/PROBLEMS' file is better than committing a hack.
141
 
142
   * When considering a patch for the branch, suggested criteria
143
     include: Does it fix a build?  Does it fix the sequence `break
144
     main; run' when debugging a static binary?
145
 
146
   * The further a change is from the core of GDB, the less likely the
147
     change will worry anyone (e.g., target specific code).
148
 
149
   * Only post a proposal to change the core of GDB after you've sent
150
     individual bribes to all the people listed in the `MAINTAINERS'
151
     file ;-)
152
 
153
   _Pragmatics: Provided updates are restricted to non-core
154
functionality there is little chance that a broken change will be fatal.
155
This means that changes such as adding a new architectures or (within
156
reason) support for a new host are considered acceptable._
157
 
158
Obsoleting code
159
===============
160
 
161
   Before anything else, poke the other developers (and around the
162
source code) to see if there is anything that can be removed from GDB
163
(an old target, an unused file).
164
 
165
   Obsolete code is identified by adding an `OBSOLETE' prefix to every
166
line.  Doing this means that it is easy to identify something that has
167
been obsoleted when greping through the sources.
168
 
169
   The process is done in stages -- this is mainly to ensure that the
170
wider GDB community has a reasonable opportunity to respond.  Remember,
171
everything on the Internet takes a week.
172
 
173
  1. Post the proposal on the GDB mailing list 
174
     Creating a bug report to track the task's state, is also highly
175
     recommended.
176
 
177
  2. Wait a week or so.
178
 
179
  3. Post the proposal on the GDB Announcement mailing list
180
     .
181
 
182
  4. Wait a week or so.
183
 
184
  5. Go through and edit all relevant files and lines so that they are
185
     prefixed with the word `OBSOLETE'.
186
 
187
  6. Wait until the next GDB version, containing this obsolete code,
188
     has been released.
189
 
190
  7. Remove the obsolete code.
191
 
192
_Maintainer note: While removing old code is regrettable it is
193
hopefully better for GDB's long term development.  Firstly it helps the
194
developers by removing code that is either no longer relevant or simply
195
wrong.  Secondly since it removes any history associated with the file
196
(effectively clearing the slate) the developer has a much freer hand
197
when it comes to fixing broken files._
198
 
199
Before the Branch
200
=================
201
 
202
   The most important objective at this stage is to find and fix simple
203
changes that become a pain to track once the branch is created.  For
204
instance, configuration problems that stop GDB from even building.  If
205
you can't get the problem fixed, document it in the `gdb/PROBLEMS' file.
206
 
207
Prompt for `gdb/NEWS'
208
---------------------
209
 
210
   People always forget.  Send a post reminding them but also if you
211
know something interesting happened add it yourself.  The `schedule'
212
script will mention this in its e-mail.
213
 
214
Review `gdb/README'
215
-------------------
216
 
217
   Grab one of the nightly snapshots and then walk through the
218
`gdb/README' looking for anything that can be improved.  The `schedule'
219
script will mention this in its e-mail.
220
 
221
Refresh any imported files.
222
---------------------------
223
 
224
   A number of files are taken from external repositories.  They
225
include:
226
 
227
   * `texinfo/texinfo.tex'
228
 
229
   * `config.guess' et. al. (see the top-level `MAINTAINERS' file)
230
 
231
   * `etc/standards.texi', `etc/make-stds.texi'
232
 
233
Check the ARI
234
-------------
235
 
236
   A.R.I. is an `awk' script (Awk Regression Index ;-) that checks for
237
a number of errors and coding conventions.  The checks include things
238
like using `malloc' instead of `xmalloc' and file naming problems.
239
There shouldn't be any regressions.
240
 
241
Review the bug data base
242
------------------------
243
 
244
   Close anything obviously fixed.
245
 
246
Check all cross targets build
247
-----------------------------
248
 
249
   The targets are listed in `gdb/MAINTAINERS'.
250
 
251
Cut the Branch
252
==============
253
 
254
Create the branch
255
-----------------
256
 
257
     $  u=5.1
258
     $  v=5.2
259
     $  V=`echo $v | sed 's/\./_/g'`
260
     $  D=`date -u +%Y-%m-%d`
261
     $  echo $u $V $D
262
     5.1 5_2 2002-03-03
263
     $  echo cvs -f -d :ext:sources.redhat.com:/cvs/src rtag \
264
     -D $D-gmt gdb_$V-$D-branchpoint insight+dejagnu
265
     cvs -f -d :ext:sources.redhat.com:/cvs/src rtag
266
     -D 2002-03-03-gmt gdb_5_2-2002-03-03-branchpoint insight+dejagnu
267
     $  ^echo ^^
268
     ...
269
     $  echo cvs -f -d :ext:sources.redhat.com:/cvs/src rtag \
270
     -b -r gdb_$V-$D-branchpoint gdb_$V-branch insight+dejagnu
271
     cvs -f -d :ext:sources.redhat.com:/cvs/src rtag \
272
     -b -r gdb_5_2-2002-03-03-branchpoint gdb_5_2-branch insight+dejagnu
273
     $  ^echo ^^
274
     ...
275
     $
276
 
277
   * by using `-D YYYY-MM-DD-gmt' the branch is forced to an exact
278
     date/time.
279
 
280
   * the trunk is first taged so that the branch point can easily be
281
     found
282
 
283
   * Insight (which includes GDB) and dejagnu are all tagged at the
284
     same time
285
 
286
   * `version.in' gets bumped to avoid version number conflicts
287
 
288
   * the reading of `.cvsrc' is disabled using `-f'
289
 
290
Update `version.in'
291
-------------------
292
 
293
     $  u=5.1
294
     $  v=5.2
295
     $  V=`echo $v | sed 's/\./_/g'`
296
     $  echo $u $v$V
297
     5.1 5_2
298
     $  cd /tmp
299
     $  echo cvs -f -d :ext:sources.redhat.com:/cvs/src co \
300
     -r gdb_$V-branch src/gdb/version.in
301
     cvs -f -d :ext:sources.redhat.com:/cvs/src co
302
      -r gdb_5_2-branch src/gdb/version.in
303
     $  ^echo ^^
304
     U src/gdb/version.in
305
     $  cd src/gdb
306
     $  echo $u.90-0000-00-00-cvs > version.in
307
     $  cat version.in
308
     5.1.90-0000-00-00-cvs
309
     $  cvs -f commit version.in
310
 
311
   * `0000-00-00' is used as a date to pump prime the version.in update
312
     mechanism
313
 
314
   * `.90' and the previous branch version are used as fairly arbitrary
315
     initial branch version number
316
 
317
Update the web and news pages
318
-----------------------------
319
 
320
   Something?
321
 
322
Tweak cron to track the new branch
323
----------------------------------
324
 
325
   The file `gdbadmin/cron/crontab' contains gdbadmin's cron table.
326
This file needs to be updated so that:
327
 
328
   * a daily timestamp is added to the file `version.in'
329
 
330
   * the new branch is included in the snapshot process
331
 
332
See the file `gdbadmin/cron/README' for how to install the updated cron
333
table.
334
 
335
   The file `gdbadmin/ss/README' should also be reviewed to reflect any
336
changes.  That file is copied to both the branch/ and current/ snapshot
337
directories.
338
 
339
Update the NEWS and README files
340
--------------------------------
341
 
342
   The `NEWS' file needs to be updated so that on the branch it refers
343
to _changes in the current release_ while on the trunk it also refers
344
to _changes since the current release_.
345
 
346
   The `README' file needs to be updated so that it refers to the
347
current release.
348
 
349
Post the branch info
350
--------------------
351
 
352
   Send an announcement to the mailing lists:
353
 
354
   * GDB Announcement mailing list 
355
 
356
   * GDB Discsussion mailing list  and GDB
357
     Discsussion mailing list 
358
 
359
   _Pragmatics: The branch creation is sent to the announce list to
360
ensure that people people not subscribed to the higher volume discussion
361
list are alerted._
362
 
363
   The announcement should include:
364
 
365
   * the branch tag
366
 
367
   * how to check out the branch using CVS
368
 
369
   * the date/number of weeks until the release
370
 
371
   * the branch commit policy still holds.
372
 
373
Stabilize the branch
374
====================
375
 
376
   Something goes here.
377
 
378
Create a Release
379
================
380
 
381
   The process of creating and then making available a release is broken
382
down into a number of stages.  The first part addresses the technical
383
process of creating a releasable tar ball.  The later stages address the
384
process of releasing that tar ball.
385
 
386
   When making a release candidate just the first section is needed.
387
 
388
Create a release candidate
389
--------------------------
390
 
391
   The objective at this stage is to create a set of tar balls that can
392
be made available as a formal release (or as a less formal release
393
candidate).
394
 
395
Freeze the branch
396
.................
397
 
398
   Send out an e-mail notifying everyone that the branch is frozen to
399
.
400
 
401
Establish a few defaults.
402
.........................
403
 
404
     $  b=gdb_5_2-branch
405
     $  v=5.2
406
     $  t=/sourceware/snapshot-tmp/gdbadmin-tmp
407
     $  echo $t/$b/$v
408
     /sourceware/snapshot-tmp/gdbadmin-tmp/gdb_5_2-branch/5.2
409
     $  mkdir -p $t/$b/$v
410
     $  cd $t/$b/$v
411
     $  pwd
412
     /sourceware/snapshot-tmp/gdbadmin-tmp/gdb_5_2-branch/5.2
413
     $  which autoconf
414
     /home/gdbadmin/bin/autoconf
415
     $
416
 
417
Notes:
418
 
419
   * Check the `autoconf' version carefully.  You want to be using the
420
     version taken from the `binutils' snapshot directory, which can be
421
     found at `ftp://sources.redhat.com/pub/binutils/'. It is very
422
     unlikely that a system installed version of `autoconf' (e.g.,
423
     `/usr/bin/autoconf') is correct.
424
 
425
Check out the relevant modules:
426
...............................
427
 
428
     $  for m in gdb insight dejagnu
429
     do
430
     ( mkdir -p $m && cd $m && cvs -q -f -d /cvs/src co -P -r $b $m )
431
     done
432
     $
433
 
434
Note:
435
 
436
   * The reading of `.cvsrc' is disabled (`-f') so that there isn't any
437
     confusion between what is written here and what your local `cvs'
438
     really does.
439
 
440
Update relevant files.
441
......................
442
 
443
`gdb/NEWS'
444
     Major releases get their comments added as part of the mainline.
445
     Minor releases should probably mention any significant bugs that
446
     were fixed.
447
 
448
     Don't forget to include the `ChangeLog' entry.
449
 
450
          $  emacs gdb/src/gdb/NEWS
451
          ...
452
          c-x 4 a
453
          ...
454
          c-x c-s c-x c-c
455
          $  cp gdb/src/gdb/NEWS insight/src/gdb/NEWS
456
          $  cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
457
 
458
`gdb/README'
459
     You'll need to update:
460
 
461
        * the version
462
 
463
        * the update date
464
 
465
        * who did it
466
 
467
          $  emacs gdb/src/gdb/README
468
          ...
469
          c-x 4 a
470
          ...
471
          c-x c-s c-x c-c
472
          $  cp gdb/src/gdb/README insight/src/gdb/README
473
          $  cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
474
 
475
     _Maintainer note: Hopefully the `README' file was reviewed before
476
     the initial branch was cut so just a simple substitute is needed
477
     to get it updated._
478
 
479
     _Maintainer note: Other projects generate `README' and `INSTALL'
480
     from the core documentation.  This might be worth pursuing._
481
 
482
`gdb/version.in'
483
          $  echo $v > gdb/src/gdb/version.in
484
          $  cat gdb/src/gdb/version.in
485
          5.2
486
          $  emacs gdb/src/gdb/version.in
487
          ...
488
          c-x 4 a
489
          ... Bump to version ...
490
          c-x c-s c-x c-c
491
          $  cp gdb/src/gdb/version.in insight/src/gdb/version.in
492
          $  cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
493
 
494
`dejagnu/src/dejagnu/configure.in'
495
     Dejagnu is more complicated.  The version number is a parameter to
496
     `AM_INIT_AUTOMAKE'.  Tweak it to read something like gdb-5.1.91.
497
 
498
     Don't forget to re-generate `configure'.
499
 
500
     Don't forget to include a `ChangeLog' entry.
501
 
502
          $  emacs dejagnu/src/dejagnu/configure.in
503
          ...
504
          c-x 4 a
505
          ...
506
          c-x c-s c-x c-c
507
          $  ( cd  dejagnu/src/dejagnu && autoconf )
508
 
509
Do the dirty work
510
.................
511
 
512
   This is identical to the process used to create the daily snapshot.
513
 
514
     $  for m in gdb insight
515
     do
516
     ( cd $m/src && gmake -f Makefile.in $m.tar )
517
     done
518
     $  ( m=dejagnu; cd $m/src && gmake -f Makefile.in $m.tar.bz2 )
519
 
520
Check the source files
521
......................
522
 
523
   You're looking for files that have mysteriously disappeared.
524
`distclean' has the habit of deleting files it shouldn't.  Watch out
525
for the `version.in' update `cronjob'.
526
 
527
     $  ( cd gdb/src && cvs -f -q -n update )
528
     M djunpack.bat
529
     ? gdb-5.1.91.tar
530
     ? proto-toplev
531
     ... lots of generated files ...
532
     M gdb/ChangeLog
533
     M gdb/NEWS
534
     M gdb/README
535
     M gdb/version.in
536
     ... lots of generated files ...
537
     $
538
 
539
_Don't worry about the `gdb.info-??' or `gdb/p-exp.tab.c'.  They were
540
generated (and yes `gdb.info-1' was also generated only something
541
strange with CVS means that they didn't get supressed).  Fixing it
542
would be nice though._
543
 
544
Create compressed versions of the release
545
.........................................
546
 
547
     $  cp */src/*.tar .
548
     $  cp */src/*.bz2 .
549
     $  ls -F
550
     dejagnu/ dejagnu-gdb-5.2.tar.bz2 gdb/ gdb-5.2.tar insight/ insight-5.2.tar
551
     $  for m in gdb insight
552
     do
553
     bzip2 -v -9 -c $m-$v.tar > $m-$v.tar.bz2
554
     gzip -v -9 -c $m-$v.tar > $m-$v.tar.gz
555
     done
556
     $
557
 
558
Note:
559
 
560
   * A pipe such as `bunzip2 < xxx.bz2 | gzip -9 > xxx.gz' is not since,
561
     in that mode, `gzip' does not know the name of the file and, hence,
562
     can not include it in the compressed file.  This is also why the
563
     release process runs `tar' and `bzip2' as separate passes.
564
 
565
Sanity check the tar ball
566
-------------------------
567
 
568
   Pick a popular machine (Solaris/PPC?) and try the build on that.
569
 
570
     $  bunzip2 < gdb-5.2.tar.bz2 | tar xpf -
571
     $  cd gdb-5.2
572
     $  ./configure
573
     $  make
574
     ...
575
     $  ./gdb/gdb ./gdb/gdb
576
     GNU gdb 5.2
577
     ...
578
     (gdb)  b main
579
     Breakpoint 1 at 0x80732bc: file main.c, line 734.
580
     (gdb)  run
581
     Starting program: /tmp/gdb-5.2/gdb/gdb
582
 
583
     Breakpoint 1, main (argc=1, argv=0xbffff8b4) at main.c:734
584
     734       catch_errors (captured_main, &args, "", RETURN_MASK_ALL);
585
     (gdb)  print args
586
     $1 = {argc = 136426532, argv = 0x821b7f0}
587
     (gdb)
588
 
589
Make a release candidate available
590
----------------------------------
591
 
592
   If this is a release candidate then the only remaining steps are:
593
 
594
  1. Commit `version.in' and `ChangeLog'
595
 
596
  2. Tweak `version.in' (and `ChangeLog' to read L.M.N-0000-00-00-cvs
597
     so that the version update process can restart.
598
 
599
  3. Make the release candidate available in
600
     `ftp://sources.redhat.com/pub/gdb/snapshots/branch'
601
 
602
  4. Notify the relevant mailing lists (  and
603
      that the candidate is available.
604
 
605
Make a formal release available
606
-------------------------------
607
 
608
   (And you thought all that was required was to post an e-mail.)
609
 
610
Install on sware
611
................
612
 
613
   Copy the new files to both the release and the old release directory:
614
 
615
     $  cp *.bz2 *.gz ~ftp/pub/gdb/old-releases/
616
     $  cp *.bz2 *.gz ~ftp/pub/gdb/releases
617
 
618
Clean up the releases directory so that only the most recent releases
619
are available (e.g. keep 5.2 and 5.2.1 but remove 5.1):
620
 
621
     $  cd ~ftp/pub/gdb/releases
622
     $  rm ...
623
 
624
Update the file `README' and `.message' in the releases directory:
625
 
626
     $  vi README
627
     ...
628
     $  rm -f .message
629
     $  ln README .message
630
 
631
Update the web pages.
632
.....................
633
 
634
`htdocs/download/ANNOUNCEMENT'
635
     This file, which is posted as the official announcement, includes:
636
        * General announcement
637
 
638
        * News.  If making an M.N.1 release, retain the news from
639
          earlier M.N release.
640
 
641
        * Errata
642
 
643
`htdocs/index.html'
644
`htdocs/news/index.html'
645
`htdocs/download/index.html'
646
     These files include:
647
        * announcement of the most recent release
648
 
649
        * news entry (remember to update both the top level and the
650
          news directory).
651
     These pages also need to be regenerate using `index.sh'.
652
 
653
`download/onlinedocs/'
654
     You need to find the magic command that is used to generate the
655
     online docs from the `.tar.bz2'.  The best way is to look in the
656
     output from one of the nightly `cron' jobs and then just edit
657
     accordingly.  Something like:
658
 
659
          $  ~/ss/update-web-docs \
660
           ~ftp/pub/gdb/releases/gdb-5.2.tar.bz2 \
661
           $PWD/www \
662
           /www/sourceware/htdocs/gdb/download/onlinedocs \
663
           gdb
664
 
665
`download/ari/'
666
     Just like the online documentation.  Something like:
667
 
668
          $  /bin/sh ~/ss/update-web-ari \
669
           ~ftp/pub/gdb/releases/gdb-5.2.tar.bz2 \
670
           $PWD/www \
671
           /www/sourceware/htdocs/gdb/download/ari \
672
           gdb
673
 
674
Shadow the pages onto gnu
675
.........................
676
 
677
   Something goes here.
678
 
679
Install the GDB tar ball on GNU
680
...............................
681
 
682
   At the time of writing, the GNU machine was `gnudist.gnu.org' in
683
`~ftp/gnu/gdb'.
684
 
685
Make the `ANNOUNCEMENT'
686
.......................
687
 
688
   Post the `ANNOUNCEMENT' file you created above to:
689
 
690
   * GDB Announcement mailing list 
691
 
692
   * General GNU Announcement list  (but delay it a
693
     day or so to let things get out)
694
 
695
   * GDB Bug Report mailing list 
696
 
697
Cleanup
698
-------
699
 
700
   The release is out but you're still not finished.
701
 
702
Commit outstanding changes
703
..........................
704
 
705
   In particular you'll need to commit any changes to:
706
 
707
   * `gdb/ChangeLog'
708
 
709
   * `gdb/version.in'
710
 
711
   * `gdb/NEWS'
712
 
713
   * `gdb/README'
714
 
715
Tag the release
716
...............
717
 
718
   Something like:
719
 
720
     $  d=`date -u +%Y-%m-%d`
721
     $  echo $d
722
     2002-01-24
723
     $  ( cd insight/src/gdb && cvs -f -q update )
724
     $  ( cd insight/src && cvs -f -q tag gdb_5_2-$d-release )
725
 
726
   Insight is used since that contains more of the release than GDB
727
(`dejagnu' doesn't get tagged but I think we can live with that).
728
 
729
Mention the release on the trunk
730
................................
731
 
732
   Just put something in the `ChangeLog' so that the trunk also
733
indicates when the release was made.
734
 
735
Restart `gdb/version.in'
736
........................
737
 
738
   If `gdb/version.in' does not contain an ISO date such as
739
`2002-01-24' then the daily `cronjob' won't update it.  Having
740
committed all the release changes it can be set to
741
`5.2.0_0000-00-00-cvs' which will restart things (yes the `_' is
742
important - it affects the snapshot process).
743
 
744
   Don't forget the `ChangeLog'.
745
 
746
Merge into trunk
747
................
748
 
749
   The files committed to the branch may also need changes merged into
750
the trunk.
751
 
752
Revise the release schedule
753
...........................
754
 
755
   Post a revised release schedule to GDB Discussion List
756
 with an updated announcement.  The schedule
757
can be generated by running:
758
 
759
     $  ~/ss/schedule `date +%s` schedule
760
 
761
The first parameter is approximate date/time in seconds (from the epoch)
762
of the most recent release.
763
 
764
   Also update the schedule `cronjob'.
765
 
766
Post release
767
============
768
 
769
   Remove any `OBSOLETE' code.
770
 
771

772
File: gdbint.info,  Node: Testsuite,  Next: Hints,  Prev: Releasing GDB,  Up: Top
773
 
774
Testsuite
775
*********
776
 
777
   The testsuite is an important component of the GDB package.  While
778
it is always worthwhile to encourage user testing, in practice this is
779
rarely sufficient; users typically use only a small subset of the
780
available commands, and it has proven all too common for a change to
781
cause a significant regression that went unnoticed for some time.
782
 
783
   The GDB testsuite uses the DejaGNU testing framework.  DejaGNU is
784
built using `Tcl' and `expect'.  The tests themselves are calls to
785
various `Tcl' procs; the framework runs all the procs and summarizes
786
the passes and fails.
787
 
788
Using the Testsuite
789
===================
790
 
791
   To run the testsuite, simply go to the GDB object directory (or to
792
the testsuite's objdir) and type `make check'.  This just sets up some
793
environment variables and invokes DejaGNU's `runtest' script.  While
794
the testsuite is running, you'll get mentions of which test file is in
795
use, and a mention of any unexpected passes or fails.  When the
796
testsuite is finished, you'll get a summary that looks like this:
797
 
798
                     === gdb Summary ===
799
 
800
     # of expected passes            6016
801
     # of unexpected failures        58
802
     # of unexpected successes       5
803
     # of expected failures          183
804
     # of unresolved testcases       3
805
     # of untested testcases         5
806
 
807
   The ideal test run consists of expected passes only; however, reality
808
conspires to keep us from this ideal.  Unexpected failures indicate
809
real problems, whether in GDB or in the testsuite.  Expected failures
810
are still failures, but ones which have been decided are too hard to
811
deal with at the time; for instance, a test case might work everywhere
812
except on AIX, and there is no prospect of the AIX case being fixed in
813
the near future.  Expected failures should not be added lightly, since
814
you may be masking serious bugs in GDB.  Unexpected successes are
815
expected fails that are passing for some reason, while unresolved and
816
untested cases often indicate some minor catastrophe, such as the
817
compiler being unable to deal with a test program.
818
 
819
   When making any significant change to GDB, you should run the
820
testsuite before and after the change, to confirm that there are no
821
regressions.  Note that truly complete testing would require that you
822
run the testsuite with all supported configurations and a variety of
823
compilers; however this is more than really necessary.  In many cases
824
testing with a single configuration is sufficient.  Other useful
825
options are to test one big-endian (Sparc) and one little-endian (x86)
826
host, a cross config with a builtin simulator (powerpc-eabi, mips-elf),
827
or a 64-bit host (Alpha).
828
 
829
   If you add new functionality to GDB, please consider adding tests
830
for it as well; this way future GDB hackers can detect and fix their
831
changes that break the functionality you added.  Similarly, if you fix
832
a bug that was not previously reported as a test failure, please add a
833
test case for it.  Some cases are extremely difficult to test, such as
834
code that handles host OS failures or bugs in particular versions of
835
compilers, and it's OK not to try to write tests for all of those.
836
 
837
Testsuite Organization
838
======================
839
 
840
   The testsuite is entirely contained in `gdb/testsuite'.  While the
841
testsuite includes some makefiles and configury, these are very minimal,
842
and used for little besides cleaning up, since the tests themselves
843
handle the compilation of the programs that GDB will run.  The file
844
`testsuite/lib/gdb.exp' contains common utility procs useful for all
845
GDB tests, while the directory `testsuite/config' contains
846
configuration-specific files, typically used for special-purpose
847
definitions of procs like `gdb_load' and `gdb_start'.
848
 
849
   The tests themselves are to be found in `testsuite/gdb.*' and
850
subdirectories of those.  The names of the test files must always end
851
with `.exp'.  DejaGNU collects the test files by wildcarding in the
852
test directories, so both subdirectories and individual files get
853
chosen and run in alphabetical order.
854
 
855
   The following table lists the main types of subdirectories and what
856
they are for.  Since DejaGNU finds test files no matter where they are
857
located, and since each test file sets up its own compilation and
858
execution environment, this organization is simply for convenience and
859
intelligibility.
860
 
861
`gdb.base'
862
     This is the base testsuite.  The tests in it should apply to all
863
     configurations of GDB (but generic native-only tests may live
864
     here).  The test programs should be in the subset of C that is
865
     valid K&R, ANSI/ISO, and C++ (`#ifdef's are allowed if necessary,
866
     for instance for prototypes).
867
 
868
`gdb.LANG'
869
     Language-specific tests for any language LANG besides C.  Examples
870
     are `gdb.c++' and `gdb.java'.
871
 
872
`gdb.PLATFORM'
873
     Non-portable tests.  The tests are specific to a specific
874
     configuration (host or target), such as HP-UX or eCos.  Example is
875
     `gdb.hp', for HP-UX.
876
 
877
`gdb.COMPILER'
878
     Tests specific to a particular compiler.  As of this writing (June
879
     1999), there aren't currently any groups of tests in this category
880
     that couldn't just as sensibly be made platform-specific, but one
881
     could imagine a `gdb.gcc', for tests of GDB's handling of GCC
882
     extensions.
883
 
884
`gdb.SUBSYSTEM'
885
     Tests that exercise a specific GDB subsystem in more depth.  For
886
     instance, `gdb.disasm' exercises various disassemblers, while
887
     `gdb.stabs' tests pathways through the stabs symbol reader.
888
 
889
Writing Tests
890
=============
891
 
892
   In many areas, the GDB tests are already quite comprehensive; you
893
should be able to copy existing tests to handle new cases.
894
 
895
   You should try to use `gdb_test' whenever possible, since it
896
includes cases to handle all the unexpected errors that might happen.
897
However, it doesn't cost anything to add new test procedures; for
898
instance, `gdb.base/exprs.exp' defines a `test_expr' that calls
899
`gdb_test' multiple times.
900
 
901
   Only use `send_gdb' and `gdb_expect' when absolutely necessary, such
902
as when GDB has several valid responses to a command.
903
 
904
   The source language programs do _not_ need to be in a consistent
905
style.  Since GDB is used to debug programs written in many different
906
styles, it's worth having a mix of styles in the testsuite; for
907
instance, some GDB bugs involving the display of source lines would
908
never manifest themselves if the programs used GNU coding style
909
uniformly.
910
 
911

912
File: gdbint.info,  Node: Hints,  Next: GNU Free Documentation License,  Prev: Testsuite,  Up: Top
913
 
914
Hints
915
*****
916
 
917
   Check the `README' file, it often has useful information that does
918
not appear anywhere else in the directory.
919
 
920
* Menu:
921
 
922
* Getting Started::             Getting started working on GDB
923
* Debugging GDB::               Debugging GDB with itself
924
 
925

926
File: gdbint.info,  Node: Getting Started,  Up: Hints
927
 
928
Getting Started
929
===============
930
 
931
   GDB is a large and complicated program, and if you first starting to
932
work on it, it can be hard to know where to start.  Fortunately, if you
933
know how to go about it, there are ways to figure out what is going on.
934
 
935
   This manual, the GDB Internals manual, has information which applies
936
generally to many parts of GDB.
937
 
938
   Information about particular functions or data structures are
939
located in comments with those functions or data structures.  If you
940
run across a function or a global variable which does not have a
941
comment correctly explaining what is does, this can be thought of as a
942
bug in GDB; feel free to submit a bug report, with a suggested comment
943
if you can figure out what the comment should say.  If you find a
944
comment which is actually wrong, be especially sure to report that.
945
 
946
   Comments explaining the function of macros defined in host, target,
947
or native dependent files can be in several places.  Sometimes they are
948
repeated every place the macro is defined.  Sometimes they are where the
949
macro is used.  Sometimes there is a header file which supplies a
950
default definition of the macro, and the comment is there.  This manual
951
also documents all the available macros.
952
 
953
   Start with the header files.  Once you have some idea of how GDB's
954
internal symbol tables are stored (see `symtab.h', `gdbtypes.h'), you
955
will find it much easier to understand the code which uses and creates
956
those symbol tables.
957
 
958
   You may wish to process the information you are getting somehow, to
959
enhance your understanding of it.  Summarize it, translate it to another
960
language, add some (perhaps trivial or non-useful) feature to GDB, use
961
the code to predict what a test case would do and write the test case
962
and verify your prediction, etc.  If you are reading code and your eyes
963
are starting to glaze over, this is a sign you need to use a more active
964
approach.
965
 
966
   Once you have a part of GDB to start with, you can find more
967
specifically the part you are looking for by stepping through each
968
function with the `next' command.  Do not use `step' or you will
969
quickly get distracted; when the function you are stepping through
970
calls another function try only to get a big-picture understanding
971
(perhaps using the comment at the beginning of the function being
972
called) of what it does.  This way you can identify which of the
973
functions being called by the function you are stepping through is the
974
one which you are interested in.  You may need to examine the data
975
structures generated at each stage, with reference to the comments in
976
the header files explaining what the data structures are supposed to
977
look like.
978
 
979
   Of course, this same technique can be used if you are just reading
980
the code, rather than actually stepping through it.  The same general
981
principle applies--when the code you are looking at calls something
982
else, just try to understand generally what the code being called does,
983
rather than worrying about all its details.
984
 
985
   A good place to start when tracking down some particular area is with
986
a command which invokes that feature.  Suppose you want to know how
987
single-stepping works.  As a GDB user, you know that the `step' command
988
invokes single-stepping.  The command is invoked via command tables
989
(see `command.h'); by convention the function which actually performs
990
the command is formed by taking the name of the command and adding
991
`_command', or in the case of an `info' subcommand, `_info'.  For
992
example, the `step' command invokes the `step_command' function and the
993
`info display' command invokes `display_info'.  When this convention is
994
not followed, you might have to use `grep' or `M-x tags-search' in
995
emacs, or run GDB on itself and set a breakpoint in `execute_command'.
996
 
997
   If all of the above fail, it may be appropriate to ask for
998
information on `bug-gdb'.  But _never_ post a generic question like "I
999
was wondering if anyone could give me some tips about understanding
1000
GDB"--if we had some magic secret we would put it in this manual.
1001
Suggestions for improving the manual are always welcome, of course.
1002
 
1003

1004
File: gdbint.info,  Node: Debugging GDB,  Up: Hints
1005
 
1006
Debugging GDB with itself
1007
=========================
1008
 
1009
   If GDB is limping on your machine, this is the preferred way to get
1010
it fully functional.  Be warned that in some ancient Unix systems, like
1011
Ultrix 4.2, a program can't be running in one process while it is being
1012
debugged in another.  Rather than typing the command `./gdb ./gdb',
1013
which works on Suns and such, you can copy `gdb' to `gdb2' and then
1014
type `./gdb ./gdb2'.
1015
 
1016
   When you run GDB in the GDB source directory, it will read a
1017
`.gdbinit' file that sets up some simple things to make debugging gdb
1018
easier.  The `info' command, when executed without a subcommand in a
1019
GDB being debugged by gdb, will pop you back up to the top level gdb.
1020
See `.gdbinit' for details.
1021
 
1022
   If you use emacs, you will probably want to do a `make TAGS' after
1023
you configure your distribution; this will put the machine dependent
1024
routines for your local machine where they will be accessed first by
1025
`M-.'
1026
 
1027
   Also, make sure that you've either compiled GDB with your local cc,
1028
or have run `fixincludes' if you are compiling with gcc.
1029
 
1030
Submitting Patches
1031
==================
1032
 
1033
   Thanks for thinking of offering your changes back to the community of
1034
GDB users.  In general we like to get well designed enhancements.
1035
Thanks also for checking in advance about the best way to transfer the
1036
changes.
1037
 
1038
   The GDB maintainers will only install "cleanly designed" patches.
1039
This manual summarizes what we believe to be clean design for GDB.
1040
 
1041
   If the maintainers don't have time to put the patch in when it
1042
arrives, or if there is any question about a patch, it goes into a
1043
large queue with everyone else's patches and bug reports.
1044
 
1045
   The legal issue is that to incorporate substantial changes requires a
1046
copyright assignment from you and/or your employer, granting ownership
1047
of the changes to the Free Software Foundation.  You can get the
1048
standard documents for doing this by sending mail to `gnu@gnu.org' and
1049
asking for it.  We recommend that people write in "All programs owned
1050
by the Free Software Foundation" as "NAME OF PROGRAM", so that changes
1051
in many programs (not just GDB, but GAS, Emacs, GCC, etc) can be
1052
contributed with only one piece of legalese pushed through the
1053
bureaucracy and filed with the FSF.  We can't start merging changes
1054
until this paperwork is received by the FSF (their rules, which we
1055
follow since we maintain it for them).
1056
 
1057
   Technically, the easiest way to receive changes is to receive each
1058
feature as a small context diff or unidiff, suitable for `patch'.  Each
1059
message sent to me should include the changes to C code and header
1060
files for a single feature, plus `ChangeLog' entries for each directory
1061
where files were modified, and diffs for any changes needed to the
1062
manuals (`gdb/doc/gdb.texinfo' or `gdb/doc/gdbint.texinfo').  If there
1063
are a lot of changes for a single feature, they can be split down into
1064
multiple messages.
1065
 
1066
   In this way, if we read and like the feature, we can add it to the
1067
sources with a single patch command, do some testing, and check it in.
1068
If you leave out the `ChangeLog', we have to write one.  If you leave
1069
out the doc, we have to puzzle out what needs documenting.  Etc., etc.
1070
 
1071
   The reason to send each change in a separate message is that we will
1072
not install some of the changes.  They'll be returned to you with
1073
questions or comments.  If we're doing our job correctly, the message
1074
back to you will say what you have to fix in order to make the change
1075
acceptable.  The reason to have separate messages for separate features
1076
is so that the acceptable changes can be installed while one or more
1077
changes are being reworked.  If multiple features are sent in a single
1078
message, we tend to not put in the effort to sort out the acceptable
1079
changes from the unacceptable, so none of the features get installed
1080
until all are acceptable.
1081
 
1082
   If this sounds painful or authoritarian, well, it is.  But we get a
1083
lot of bug reports and a lot of patches, and many of them don't get
1084
installed because we don't have the time to finish the job that the bug
1085
reporter or the contributor could have done.  Patches that arrive
1086
complete, working, and well designed, tend to get installed on the day
1087
they arrive.  The others go into a queue and get installed as time
1088
permits, which, since the maintainers have many demands to meet, may not
1089
be for quite some time.
1090
 
1091
   Please send patches directly to the GDB maintainers
1092
.
1093
 
1094
Obsolete Conditionals
1095
=====================
1096
 
1097
   Fragments of old code in GDB sometimes reference or set the following
1098
configuration macros.  They should not be used by new code, and old uses
1099
should be removed as those parts of the debugger are otherwise touched.
1100
 
1101
`STACK_END_ADDR'
1102
     This macro used to define where the end of the stack appeared, for
1103
     use in interpreting core file formats that don't record this
1104
     address in the core file itself.  This information is now
1105
     configured in BFD, and GDB gets the info portably from there.  The
1106
     values in GDB's configuration files should be moved into BFD
1107
     configuration files (if needed there), and deleted from all of
1108
     GDB's config files.
1109
 
1110
     Any `FOO-xdep.c' file that references STACK_END_ADDR is so old
1111
     that it has never been converted to use BFD.  Now that's old!
1112
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.