summaryrefslogtreecommitdiff
path: root/open_issues/gdb.mdwn
blob: 6d08b0b3127da19467a22ef7082ebadd60d701e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
[[!meta copyright="Copyright © 2007, 2008, 2010, 2011, 2012 Free Software
Foundation, Inc."]]

[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts.  A copy of the license
is included in the section entitled [[GNU Free Documentation
License|/fdl]]."]]"""]]

[[!tag open_issue_gdb]]

Here's what's to be done for maintaining GNU GDB.

[[!toc levels=2]]


# [[General information|/gdb]]


# [[Sources|source_repositories/gdb]]


# Configuration

<!--

git checkout reviewed
git log --reverse --topo-order --pretty=fuller --stat=$COLUMNS,$COLUMNS -w -p -C --cc ..sourceware/master
-i
/^commit |^Merge:|^---$|hurd|linux|nacl|nptl|glibc|gs:|gnu-nat|i386gnu

-->

Last reviewed up to the [[Git mirror's 38950d85c63f8528d11112d10b11bfa76e3d5bf8
(2012-11-11) sources|source_repositories/gdb]].

  * Globally

      * a.out, COFF, PE image support and 64 bit support are not interesting.

      * In the testsuites, `.exp` and `.d` files very likely should not only
        care for `*-*-linux*`, but also `*-*-gnu*`.  (If the need to be
        conditionalized like this at all.)

  * `bfd/`

    See [[binutils]].

  * `libdecnumber/`

    Should/can probably align to GNU/Linux.

  * Have a look at config/i386/i386gnu.mh.

  * configure.tgt

      * glibc-tdep et al. also for GNU/Hurd?

  * [[gdbserver]]

  * 82763a3d329b0d342d0273941b1521be9ef0c604 »MODIFIED is unknown, pass it as
    true.«


# Build

Here's a log of a GDB build run; this is from our [[Git
repository|source_repositories/gdb]]'s `tschwinge/Ferry_Tagscherer` branch,
commit 38950d85c63f8528d11112d10b11bfa76e3d5bf8 (2012-11-11), run on
kepler.SCHWINGE and coulomb.SCHWINGE.

    $ export LC_ALL=C
    $ ../Ferry_Tagscherer/configure --prefix="$PWD".install SHELL=/bin/dash CC=gcc-4.6 CXX=g++-4.6 --disable-werror 2>&1 | tee log_build
    [...]
    $ make 2>&1 | tee log_build_
    [...]

Different hosts may default to different shells and compiler versions; thus
harmonized.

There are several occurences of *error: dereferencing type-punned pointer will
break strict-aliasing rules* in the MIG-generated stub files; thus no `-Werror`
until that is resolved ([[strict_aliasing]]).

This takes up around 200 MiB and needs roughly 7 min on kepler.SCHWINGE and 23
min on coulomb.SCHWINGE.

<!--

    $ (make && touch .go-install) 2>&1 | tee log_build_ && test -f .go-install && (make install && touch .go-test) 2>&1 | tee log_install && test -f .go-test && make -k check 2>&1 | tee log_test

-->


## Analysis

x86 GNU/Linux' and GNU/Hurd's configurations are slightly different, thus mask
out most of the differences that are due to GNU/Linux supporting more core file
formats and more emulation vectors.

    $ toolchain/logs/process gdb build

  * DFP

        -checking for decimal floating point... bid
        +checking for decimal floating point... configure: WARNING: decimal float is not supported for this target, ignored
        +dpd

    Have to sync libdecnumber?

  * Why do we specify `-D_GNU_SOURCE`, and GNU/Linux doesn't?

  * GNU/Linux: `gdb/symfile-mem.c` for vDSO.

  * GNU/Linux: `gdb/i386-nat.c` for hardware breakpoints, etc. -- we should
    probably use that, too.  Related to Samuel's Hurd GDB patch?

  * `gdb/gnu-nat.c`

        gnu-nat.c: In function 'proc_set_exception_port':
        gnu-nat.c:409:3: warning: format '%d' expects argument of type 'int', but argument 8 has type 'mach_port_t' [-Wformat]
        gnu-nat.c: In function 'proc_steal_exc_port':
        gnu-nat.c:449:7: warning: format '%d' expects argument of type 'int', but argument 8 has type 'mach_port_t' [-Wformat]
        gnu-nat.c:470:7: warning: format '%d' expects argument of type 'int', but argument 8 has type 'mach_port_t' [-Wformat]
        gnu-nat.c: In function 'make_proc':
        gnu-nat.c:583:7: warning: format '%d' expects argument of type 'int', but argument 2 has type 'mach_port_t' [-Wformat]
        gnu-nat.c:586:7: warning: format '%d' expects argument of type 'int', but argument 8 has type 'mach_port_t' [-Wformat]
        gnu-nat.c: In function 'inf_set_pid':
        gnu-nat.c:761:3: warning: format '%d' expects argument of type 'int', but argument 7 has type 'task_t' [-Wformat]
        gnu-nat.c: In function 'inf_validate_procs':
        gnu-nat.c:1085:6: warning: format '%d' expects argument of type 'int', but argument 8 has type 'thread_t' [-Wformat]
        gnu-nat.c: In function 'inf_signal':
        gnu-nat.c:1349:4: warning: format '%d' expects argument of type 'int', but argument 7 has type 'thread_t' [-Wformat]
        gnu-nat.c:1349:4: warning: format '%d' expects argument of type 'int', but argument 8 has type 'thread_t' [-Wformat]
        gnu-nat.c: In function 'S_exception_raise_request':
        gnu-nat.c:1668:3: warning: format '%d' expects argument of type 'int', but argument 7 has type 'thread_t' [-Wformat]
        gnu-nat.c:1668:3: warning: format '%d' expects argument of type 'int', but argument 8 has type 'task_t' [-Wformat]
        gnu-nat.c:1705:8: warning: format '%d' expects argument of type 'int', but argument 7 has type 'mach_port_t' [-Wformat]
        gnu-nat.c:1711:8: warning: format '%d' expects argument of type 'int', but argument 7 has type 'mach_port_t' [-Wformat]
        gnu-nat.c: In function 'do_mach_notify_dead_name':
        gnu-nat.c:1762:3: warning: format '%d' expects argument of type 'int', but argument 7 has type 'mach_port_t' [-Wformat]
        gnu-nat.c: In function 'gnu_write_inferior':
        gnu-nat.c:2383:8: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'vm_address_t' [-Wformat]
        gnu-nat.c:2393:8: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'vm_address_t' [-Wformat]
        gnu-nat.c: In function 'steal_exc_port':
        gnu-nat.c:2864:5: warning: format '%d' expects argument of type 'int', but argument 2 has type 'mach_port_t' [-Wformat]

    
  * fe19822761b4635f392875a186e48af446b40f41..7a63e9515491f21eaf07301df87d389def20e317):

    `-Wmissing-prototypes`

        gnu-nat.c: At top level:
        gnu-nat.c:643:1: warning: no previous prototype for 'make_inf' []
        gnu-nat.c: At top level:
        gnu-nat.c:879:1: warning: no previous prototype for 'inf_set_traced' []
        gnu-nat.c:980:1: warning: no previous prototype for 'inf_port_to_thread' []
        gnu-nat.c: At top level:
        gnu-nat.c:1748:1: warning: no previous prototype for 'inf_task_died_status' []
        gnu-nat.c: At top level:
        gnu-nat.c:2273:1: warning: no previous prototype for 'gnu_read_inferior' []
        gnu-nat.c:2319:1: warning: no previous prototype for 'gnu_write_inferior' []
        gnu-nat.c: At top level:
        gnu-nat.c:3415:1: warning: no previous prototype for '_initialize_gnu_nat' []
        notify_S.c:305:24: warning: no previous prototype for 'notify_server' []
        notify_S.c:341:28: warning: no previous prototype for 'notify_server_routine' []
        process_reply_S.c:343:24: warning: no previous prototype for 'process_reply_server' []
        process_reply_S.c:379:28: warning: no previous prototype for 'process_reply_server_routine' []
        msg_reply_S.c:165:24: warning: no previous prototype for 'msg_reply_server' []
        msg_reply_S.c:201:28: warning: no previous prototype for 'msg_reply_server_routine' []
        exc_request_S.c:157:24: warning: no previous prototype for 'exc_server' []
        exc_request_S.c:193:28: warning: no previous prototype for 'exc_server_routine' []

  * `dlopen`/`-ldl`

        -checking for library containing dlopen... none required
        +checking for library containing dlopen... -ldl

  * `O_NOFOLLOW`

    First seen in
    20f498edfd7e57d3297febcf9c7c7d667cc74239..69a5e2b022c7d15ec4c7c49e6f53a8d924d3b72b:

        -checking for working fcntl.h... yes
        +checking for working fcntl.h... no (bad O_NOFOLLOW)

    [[!taglink open_issue_glibc]]?

  * Why does GNU/Linux have an additional `-ldl -rdynamic` when linking `gdb`?


# Install

    $ make install 2>&1 | tee log_install
    [...]

This takes up around 50 MiB, and needs roughly 1 min on kepler.SCHWINGE and 2
min on coulomb.SCHWINGE.


## Analysis

    $ toolchain/logs/process gdb install

  * `libtool: finish`: `ldconfig` is not run for the Hurd.


# Testsuite

    $ make -k check
    [...]

This needs roughly 14 min on kepler.SCHWINGE and 135 min on coulomb.SCHWINGE.

When running `make -k check 2>&1 | tee log_test`, at the end of the testsuite
the `tee` process does not terminate if there are still stray leftover
processes that [have their stdout/stderr
open](http://sourceware.org/ml/gdb-patches/2012-10/msg00489.html).  `kill`ing
these (`SIGKILL` may be needed), makes the `tee` process terminate, too.  On
GNU/Hurd, these generally are `gdb.multi/watchpoint-multi`, and an unknown
(`?`) one ("57 PIDs before" `expect [...] gdb.cp`).


## Analysis

    $ toolchain/logs/process gdb test

  * Disabled

      * `gdb.base/morestack.exp`

        TODO `-fsplit-stack` issue.

      * `gdb.base/readline.exp`

        [[term_blocking]] issue.

      * `gdb.base/sigall.exp`

        From `send signal TSTP` on, all FAIL running into timeouts.

  * `UNSUPPORTED: gdb.threads/ia64-sigill.exp: Couldn't compile ../../../master/gdb/testsuite/gdb.threads/ia64-sigill.c: unrecognized error`

        ../../../master/gdb/testsuite/gdb.threads/ia64-sigill.c:29:24: fatal error: asm/unistd.h: No such file or directory

  * `UNSUPPORTED: gdb.threads/multi-create.exp: Couldn't compile ../../../master/gdb/testsuite/gdb.threads/multi-create.c: unrecognized error`
        ../../../master/gdb/testsuite/gdb.threads/multi-create.c: In function 'create_function':
        ../../../master/gdb/testsuite/gdb.threads/multi-create.c:46:39: error: 'PTHREAD_STACK_MIN' undeclared (first use in this function)
        ../../../master/gdb/testsuite/gdb.threads/multi-create.c:46:39: note: each undeclared identifier is reported only once for each function it appears in
        ../../../master/gdb/testsuite/gdb.threads/multi-create.c: In function 'main':
        ../../../master/gdb/testsuite/gdb.threads/multi-create.c:73:39: error: 'PTHREAD_STACK_MIN' undeclared (first use in this function)

  * `UNSUPPORTED: gdb.threads/staticthreads.exp: Couldn't compile ../../../master/gdb/testsuite/gdb.threads/staticthreads.c: unrecognized error`

        ../../../master/gdb/testsuite/gdb.threads/staticthreads.c: In function 'main':
        ../../../master/gdb/testsuite/gdb.threads/staticthreads.c:52:37: error: 'PTHREAD_STACK_MIN' undeclared (first use in this function)
        ../../../master/gdb/testsuite/gdb.threads/staticthreads.c:52:37: note: each undeclared identifier is reported only once for each function it appears in

  * `UNSUPPORTED: gdb.threads/watchpoint-fork.exp: parent: multithreaded: Couldn't compile ../../../Ferry_Tagscherer/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c ../../../Ferry_Tagscherer/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c: unrecognized error`

        ../../../Ferry_Tagscherer/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c:29:24: fatal error: asm/unistd.h: No such file or directory

  * `UNSUPPORTED: gdb.threads/create-fail.exp: Couldn't compile ../../../Ferry_Tagscherer/gdb/testsuite/gdb.threads/create-fail.c: unrecognized error`

        [...]/gdb.threads/create-fail.c:77: undefined reference to `pthread_attr_setaffinity_np'
        [...]/gdb.threads/create-fail.c:83: undefined reference to `pthread_create'

  * `UNSUPPORTED: gdb.threads/siginfo-threads.exp: Couldn't compile ../../../Ferry_Tagscherer/gdb/testsuite/gdb.threads/siginfo-threads.c: unrecognized error`

        ../../../Ferry_Tagscherer/gdb/testsuite/gdb.threads/sigstep-threads.c:22:24: fatal error: asm/unistd.h: No such file or directory

  * `UNTESTED: gdb.base/longest-types.exp: longest-types.exp`

        ../../../Ferry_Tagscherer/gdb/testsuite/gdb.base/longest-types.c:20:8: error: size of array 'buf' is too large

    Also on GNU/Linux.

TODO.