More changes for objfiles.
[deliverable/binutils-gdb.git] / gdb / ChangeLog
CommitLineData
a048c8f5
JG
1Sat Nov 9 00:40:32 1991 John Gilmore (gnu at cygnus.com)
2
3 Add tracking of object files (that contain symbols) to gdb.
4 This includes a "struct objfile" that owns symtabs and psymtabs
5 that were read in from that binary file.
6
7 * symfile.h: Add struct objfile. Add pointer to the objfile
8 into the struct sym_fns.
9 Replace global `symfile' and `symfile_mtime' with
10 `symfile_objfile'. Add global object_files chain.
11
12 * symfile.c: Move param.h above symtab.h.
13 (sort_misc_function_vector): Add.
14 (syms_from_objfile): Was syms_from_bfd.
15 (symfile_open): Now returns objfile.
16 (allocate_objfile): New.
17 (free_objfile): New, replacing free_all_.*symtabs.
18 (symfile_init): Takes objfile arg, puts it in sym_fns result.
19 (reread_symbols): Searches whole chain of objfiles.
20 (allocate_symtab): Takes objfile as new parameter, chains them.
21 Handle INIT_EXTRA_SYMTAB_INFO.
22 (free_all_psymtabs, free_all_symtabs): Move here from symmisc.c.
23
24 * dbxread.c: Make more errors into complaints.
25 (push_subfile, pop_subfile): Move to buildsym.c.
26 (dbx_symfile_read, dbx_symfile_init, fill_symbuf, read_dbx_symtab,
27 start_psymtab, psymtab_to_symtab_1, read_ofile_symtab,
28 dbx_psymtab_to_symtab, ): Use bfd ops, don't use file descriptor.
29 Pass objfile. Change callers.
30 (fill_symbuf, SWAP_SYMBOL): Take bfd as arg.
31 (read_dbx_symtab): Just wipe out new symbols, not all, on error.
32 (end_psymtab): Blow away psymtab if empty.
33 (process_symbol_pair): Swallow into read_ofile_symtab.
34 (process_one_symbol): Use push_context and pop_context.
35 (virtual_context): Delete #if 0'd obsolete stuff.
36
37 * buildsym.c (end_symtab): Pass objfile.
38 (dbx_lookup_type): Handle null typevector.
39 (dbx_alloc_type): Check file number, not sym number, for -1.
40 (find_symbol_in_list): Add for xcoffread.
41 (start_symtab): Default typevector is empty. Keep reusing same
42 context_stack.
43 (end_symtab): Take objfile argument and pass it to
44 allocate_symtab. Don't make a symtab if no blocks or symbols.
45 Handle empty typevector.
46 (push_context): New function for context stack nesting.
47 (read_type): Mark FIXME where we need to reintroduce type smashing.
48
49 * buildsym.h (pop_context): Macro, paired with push_context.
50 (subfile_stack): Move here from dbxread.c.
51
52 * coffread.c (end_symtab, read_coff_symtab): Take and use objfile arg.
53 (read_coff_symtab): Cleanup by freeing objfile, not all symtabs.
54
55 * mipsread.c (read_mips_symtab, parse_partial_symbols, parse_fdr,
56 new_psymtab, new_symtab): Take and use objfile arg.
57
58 * dwarfread.c (scan_compilation_units, start_psymtab,
59 process_dies, end_symtab, dwarf_build_psymtabs,
60 read_lexical_block_scope, read_func_scope, read_file_scope): Take
61 and use objfile argument.
62 (psymtab_to_symtab_1, read_ofile_symtab): Don't take or use file
63 descriptor. Use BFD internal functions instead.
64 (end_symtab): Call global allocate_symtab.
65
1d82d3dc 66 * elfread.c, target.c: Minor changes to accommodate objfiles.
a048c8f5
JG
67 * symtab.h: partial_symbol_table has no symfile_name member now.
68 (fn_fieldlists voffset): avoid non-int bitfield.
69 (struct symtab): Add objfile * and objfile_chain * of symtabs.
70 (struct partial_symtab): Add objfile * and objfile_chain * of
71 psymtabs. Remove symfile_name.
72
1d82d3dc
JG
73 * symmisc.c: Lose free_all_symtabs, free_all_psymtabs.
74 (printsyms_command): Rename from print_symtabs. Add selective
75 listing if 2nd argument given. Print objfile info.
76 (printpsyms_command): Rename from print_partial_symtabs. Ditto all.
77 (printobjfiles_command): New; prints objfiles lists, and checks
78 for consistency of symtab, psymtab, and objfile lists.
79
a048c8f5
JG
80 * symfile.h, symfile.c, symtab.h: Lint
81
c4668207
JG
82Fri Nov 8 23:38:48 1991 John Gilmore (gnu at cygnus.com)
83
84 * command.c: Include param.h.
85 * defs.h (warning_setup, warning): Declare.
86 * expprint.c (print_subexp, UNOP_MEMVAL case): Lint.
87 * inflow.c (new_tty): Use USE_O_NOCTTY #define.
88 * language.c, printcmd.c (print_scalar_formatted), signame.c,
89 stack.c: lint.
90
b92c774e
SC
91Thu Nov 7 18:26:15 1991 Steve Chamberlain (sac at rtl.cygnus.com)
92
b715d5b4
SC
93 * Makefile.in: link with libiberty after libreadline, since
94 readline might want something in libiberty.
b92c774e
SC
95 * m88k-xdep.c: Fixed the register offsets in the ptrace_user
96 struct for BCS 88k machines.
97 * xm-m88k.h: don't define USIZE if already defined.
98 * configure.in: Added delta88 target.
99
fbcb5095
JG
100Thu Nov 7 04:51:19 1991 John Gilmore (gnu at cygnus.com)
101
1bf068b8
JG
102 * am29k-pinsn.c, am29k-opcode.h: Fix decoding of mtacc, dmac, fmac.
103
fbcb5095
JG
104 * tm-*.h: Remove READ_DBX_FORMAT, COFF_FORMAT, and
105 READ_MIPS_FORMAT, which have been unused since BFD. Still
106 remaining is COFF_NO_LONG_FILE_NAMES.
107 * tm-sun3.h, tm-altos.h: Remove detritus accidentally left from
108 function calling code moved to m68k-tdep.c.
109
e64fbb3a
JG
110Wed Nov 6 17:21:59 1991 John Gilmore (gnu at cygnus.com)
111
112 * coffread.c: Eliminate c_nsyms in favor of c_naux.
113 Complain if no auxents on .bf and .ef FCN symbols, and assume
114 lots of line numbers.
115 (init_linenos, enter_linenos): Use a sentinel at the end of the
116 read-in linenos, to make for a fast, safe loop-end test.
117
118Wed Nov 6 02:54:08 1991 Steve Chamberlain (sac at cygnus.com)
119
120 * coffread.c (read_coff_symtab): coffread used to rely on the
121 x_sym.x_misc.x_lnsz.x_lnno field giving the # of linnos in a
122 function. Two of the formats I'm using (29k and 88k) don't seem to
123 set it. Ths patch to fcn_last_line and (enter_linenos) is an
124 attempt to use the actual size of the linno table in the file to set
125 the number of linenos to process.
126
0aaa124f
SC
127Tue Nov 5 22:47:46 1991 Steve Chamberlain (sac at cygnus.com)
128
129 * Makefile.in: put a - infront of the mv y.tab.c c-exp.tab.c and
130 mv y.tab.c m2-exp.tab.c, so that if bison is used, and the files
131 are created in place, so the mv fails, then the make continues.
132
545af6ce
PB
133Tue Nov 5 16:47:47 1991 Per Bothner (bothner at cygnus.com)
134
135 Add C++ as a separate language.
136 * defs.h (enum language): Add language_cplus.
137 * dwarfread.c (end_symtab): Support language_cplus.
138 * c-exp.y: Add new struct language_defn cplus_language_defn.
139 Don't set c to be the default language (see main.c).
140 * c-exp.y (yylex): Only look for field of this if
141 language is C++. (First difference from C!)
142 * language.c: Add case branches for C++ (currently, all
143 the same as C). Also, add c++ to "usage" note for "set lang".
144 * valprint.c (typedef_print). Add case branches for C++.
145 * main.c (main): New way to set initial language: Look at
146 file extension of psymtab containing main(). (Same as we
147 do for symtabs, but avoid loading the symtab yet.)
148 * symtab.c: New routine find_main_psymtab(), used by main()
149 to set initial language.
150 * symfile.c (allocate_symtab): Move code for mapping file
151 extensions-> languages to new deduce_language_from_filename().
152
153 Fix a C++ problem when looking for methods in super-classes.
154 There was confusion between base and derived types.
155 * valops.c (value_fn_field): Change function interface.
156 * values.c: Use new value_fn_field interface.
157
abefb1f1
PB
158Mon Nov 4 10:49:33 1991 Per Bothner (bothner at cygnus.com)
159
160 * infrun.c: Fixed typo in comment.
161 * utils.c: All the v*fprintf emulation is now in libiberty,
162 so we can get rid of some junk.
163 * xm-sun3os4.h, xm-sun4os4.h, xconfig/decstation, xconfig/i386sco,
164 xconfig/sun3os4, xconfig/sun4os4: Don`t need HAVE_STRSTR any more.
165 * m68k-pinsn.c (print_insn_arg): Support BB/BW/BL
166 type operands, as used by branch instructions.
167 * gmalloc.c: Fix prototype of memcpy.
168 * elfread.c: Comment out register_addr, since it conflicts
169 with the one in coredep.c.
170 * buildsym.h: Remove extern declarations of two functions
171 that are really static in buildsym.c.
172 * tm-mips.h: Add symbolic names for more registers.
173 * mips-xdep.c (store_inferior_registers): Use new register names.
174 * xm-mips.h: Simplify REGISTER_U_ADDR, since it is now
175 only used for core files, not ptrace. Therefore,
176 the KERNEL_U_ADDR hack is no longer needed.
177 The mapping to ptrace number is now in in mips-xdep.c.
178 * mips-xdep.c: Define REGISTER_PTRACE_ADDR (using the
179 mapping from the old REGISTER_U_ADDR), and use it
180 in {fetch,store}_inferior_registers.
181 * mipsread.c: Rename #include ecoff.h to new name coff-mips.h.
182 * mips-tdep.c (mips_push_dummy_frame, mips_pop_frame):
183 Save/restore FP regs correctly (?).
184 * dbxread.c: Remove duplicate define_symbol and type_synonym_name
185 (these had been previously moved to buildsym.c).
186 Hence, define_symbol becomes extern instead of static.
187 * buildsym.c (read_struct_type): Comment out bogus handling
188 of C++ operator methods. Minor hacking of reading of class
189 contexts. Make define_symbol non-static, so dbxread.c can call it.
190
c9bd6710
JG
191Fri Nov 1 11:05:47 1991 John Gilmore (gnu at cygnus.com)
192
193 * mipsread.c (read_mips_symtab, read_the_mips_symtab): Use real
194 filename with error messages.
195 * stack.c (frame_select_command): Rename to select_frame_command
196 to avoid "fr" and "fra" having nonunique completions.
197 * symfile.c (sort_symtab_syms): Ignore sort of zero symtab *.
198 (symfile_init): Print file format name when unable to handle it.
199 (free_named_symtabs): Use BLOCKVECTOR rather than obsolete BLOCKLIST.
200 * symmisc.c (free_symtab): Only free linetable if nonzero.
201 * symtab.h: Remove obsolete BLOCKLIST macros.
202
d7d1098d
SG
203Thu Oct 31 18:12:43 1991 Stu Grossman (grossman at cygnus.com)
204
205 * infrun.c (wait_for_inferior): another stepi/nexti fix. Ensure
206 that stop_step is 1 at bottom of main loop. I don't know why this
207 needs to be done, but it helps me sleep better at night.
208
8b3c897a
SG
209Sun Oct 27 18:18:39 1991 Stu Grossman (grossman at cygnus.com)
210
211 * main.c (initialize_history): Read history after reading all
212 init files.
213
4137c5fc
JG
214Sun Oct 27 14:09:25 1991 John Gilmore (gnu at cygnus.com)
215
216 * buildsym.c: Break out initial malloc sizes.
217 (record_line): Record directly in a subfile. Alloc on demand.
218 (compare_line_numbers): Add from xcoffread.c.
219 (end_symtab): New params say whether to sort pendings and
220 linetable. Patch block stabs if defined. Shrink linetable before
221 allocating the symtab.
222 * buildsym.h: Delete line_vector* and prev_line_number. Add
223 global_stabs and file_stabs for xcoffread.
224 * dbxread.c (start_subfile): Move to buildsym. Change above calls.
225 * symtab.h: LINETABLE(symtab) can now be null. Zap LINELIST.
226 * symmisc.c, symtab.c: Cope with null LINETABLEs.
227
228 * blockframe.c: Pass fromleaf to INIT_EXTRA_FRAME_INFO.
229 * tm-29k.h, tm-88k.h, tm-i960.h, tm-irix3.h, tm-mips.h, tm-pyr.h,
230 tm-sparc.h: Accept fromleaf parameter.
231 * c-exp.y (yyerror): Pass error message if given.
232 * configure.in: Add rs6000 host and target.
233 * inflow.c (new_tty): O_NOCTTY kludge for RS/6000.
234 * symfile.h (entry_point): Add.
235
c0302457
JG
236Sat Oct 26 00:16:32 1991 John Gilmore (gnu at cygus.com)
237
238 * buildsym.c: New file. Breaks out symbol-table-building routines
239 from dbxread.c, so they can be shared with xcoffread.c.
240 * buildsym.h: New file. Declarations for buildsym.c users.
241 * dbxread.c: Remove large chunks into buildsym.c.
d47d5315
JG
242 * Makefile.in: Add buildsym.c and buildsym.h.
243
244 * symfile.c (syms_from_bfd): New routine.
245 (add_symbol_file): Call it to do the real work.
246 (syms_from_bfd): Initialize entry_point before calling symfile_init.
247 * symtab.h, symfile.c, coffread.c, mipsread.c, dwarfread.c:
248 Avoid declaring or setting entry_point (symfile.h & symfile.c cope).
c0302457 249
bcccec8c
PB
250Fri Oct 25 18:59:32 1991 Per Bothner (bothner at cygnus.com)
251
252 Various fixes to improve g++ debugging.
253 * symtab.h: Add is_const and is_volatile flags for each method.
254 These are bit fields - take their space from voffset,
255 which shrinks to 30 bits. Since voffset is now a bitfield,
256 make it unsigned for portability. This changes its interpretation
257 slightly: Static methods now have voffset 1 instead of -1,
258 and virtual offsets start at 2, not 1.
259 * symtab.c: Renamed gdb_mangle_typename to gdb_mangle_name,
260 since it now returns an entire magled method name, not just
261 the type part. This avoids some duplication.
262 It also allows us to correctly mangle const and volatile
263 methods (using the new is_const and is_volatile bit fields
264 mentioned above).
265 * valprint.c (type_print_base), values.c (check_stub_method):
266 Simplify by using new gdb_mangle_name.
267 * values.c (value_headof): Fix to correctly handle single
268 inheritance (actually two fixes, either of which suffices).
269 * dbxread.c (read_struct_type): Handle const and volatile
270 method specifiers.
271 * dbxread.c (read_struct_type): Yet one more place where
272 we must handle '\\' continuations.
273 * valprint.c (vtbl_ptr_name): Add final '\0'.
274
eb3f3e5c
SG
275Fri Oct 25 16:06:38 1991 Stu Grossman (grossman at cygnus.com)
276
5ab580cc
SG
277 * tm-sparc.h, tm-68k.h (EXTRACT_RETURN_VALUE): fix output of
278 short return values for sparc and 68k. Patch from Paul Eggert.
279
eb3f3e5c
SG
280 * coffread.c, coredep.c, i386-xdep.c: install patches for
281 SysV/386 3.2 from Mauro DePalma.
282
9cb602e1
JG
283Fri Oct 25 02:02:13 1991 John Gilmore (gnu at cygnus.com)
284
c58215f2
JG
285 * core.c (core_file_info), exec.c (exec_file_info): Print file
286 type. Use printf_filtered.
287
9cb602e1
JG
288 * valops.c (value_fetch_lazy): Avoid 0-length fetches.
289
b662acae
FF
290Thu Oct 24 23:06:40 1991 Fred Fish (fnf at cygnus.com)
291
c8c0a2bd
FF
292 * dwarfread.c: Add casts to remove compiler warnings.
293
84d82b1c
FF
294 * tm-3b1.h, tm-68k.h, tm-altos.h, tm-amix.h, tm-hp300bsd.h,
295 tm-hp300hpux.h, tm-isi.h, tm-news.h, tm-pn.h, tm-sun2.h,
296 tm-sun3.h: Remove locally duplicated code for calling functions
297 in the inferior. The only differences were in the specific trap
298 vectors used and whether or not an fpu was present. These are
299 now handled by appropriate definitions of BPT_VECTOR and
300 HAVE_68881 respectively. Other minor obvious cleanups.
301
302 * valops.c: Correct a minor misspelling.
303
ed317bb3
FF
304 * utils.c: Remove local BSD/USG hacks that are now in libiberty.
305
b662acae
FF
306 * dwarfread.c: Remove prototype for dwarfwarn. Does not work
307 with <varargs.h>.
308
313fdead
JG
309Thu Oct 24 09:33:44 1991 John Gilmore (gnu at cygnus.com)
310
b0077123
JG
311 * stack.c (frame_command): Always print. Use new
312 frame_select_command to select a frame without printing.
313
313fdead
JG
314 * dwarfread.c: Use <varargs.h>, since <stdarg.h> is not portable.
315
4a35d6e9
FF
316Thu Oct 24 01:32:51 1991 Fred Fish (fnf at cygnus.com)
317
35f5886e
FF
318 * dwarfread.c: New file for DWARF debugging format support.
319
320 * elfread.c: New file for ELF object file format support.
321
322 * procfs.c: New file for SVR4 /proc (process file system) support.
323
324 * tm-amix.h, xm-amix.h, tconfig/amix, xconfig/amix: New files for
325 Amiga UNIX support.
326
327 * xm-svr4.h, tm-svr4.h: New files for SVR4 support.
328
329 * xm-m68k.h: New file for host machines with m68k cpu.
330
bb4ff694
FF
331 * Makefile.in: Add elfread.c and dwarfread.c to SFILES_MAINDIR.
332 Add elfread.o and dwarfread.o to OBS.
333
334 * symfile.h: Add "elf" to list of supported formats in comment.
335
e2aab031
FF
336 * c-exp.y, defs.h, symtab.h, valprint.c: Add three new builtin
337 types to gdb, builtin_type_long_double, builtin_type_complex, and
338 builtin_type_double_complex. Add and use new TARGET_SHORT_BIT,
339 TARGET_INT_BIT, TARGET_LONG_BIT, TARGET_FLOAT_BIT,
340 TARGET_DOUBLE_BIT, TARGET_LONG_DOUBLE_BIT, TARGET_COMPLEX_BIT, and
341 TARGET_DOUBLE_COMPLEX_BIT, as the sizes in bits of the indicated
342 types on the target machine (ala the existing TARGET_LONG_LONG_BIT).
343
02070680
FF
344 * infrun.c: When using SVR4 /proc interface instead of ptrace(),
345 call proc_set_exec_trap() to setup child to stop at first instruction.
346
347 * inftarg.c: When using SVR4 /proc interface, call proc_wait()
348 rather than wait().
349
350 * m68k-tdep.c: Add new routines supply_gregset(), fill_gregset(),
351 supply_fpregset(), and fill_fpregset(), which are machine
352 dependent support routines for SVR4 /proc interface.
353
2bc2e684
FF
354 * utils.c: Add warning_setup() and warning(). Warning() behaves
355 the same as error() except that it returns normally rather than
356 jumping back to command level. Modules that don't want to call
357 warning() for some reason, but want to produce their own warnings,
358 can call warning_setup() to ensure compatibility with the way
359 warning() and error() deal with the terminal.
360
eaa1ef1d
FF
361 * symtab.c: Make internal errors produce more useful messages.
362
dcd15e5e
FF
363 * tm-68k.h: Move code that is duplicated in almost every single
364 m68k based machine's configuration files to this common file.
365 Duplications in the configuration files still need to be removed
366 (FIXME).
367
150f5436
FF
368 * infrun.c (child_create_inferior): System V versions must call
369 setpgrp() with no arguments, to comply with prototyping typically
370 in <unistd.h>.
371
cb17dfb1
FF
372 * munch: Add support for SVR4 style nm output.
373
4a35d6e9
FF
374 * dbxread.c, mipsread.c symmisc.c, symtab.c: Remove the object
375 file specific fields from the partial symbol table structure and
376 replace them with a pointer to private data for each different
377 flavor of object file reader to initialize appropriately.
378
b0077123
JG
379Wed Oct 23 09:38:20 1991 John Gilmore (gnu at cygnus.com)
380
381 * xconfig/sun[34]os4: Add note about strstr botch on sunos4.0.3c
382 and previous.
383
384 * mipsread.c (fixup_undef_type): New function. If a struct /
385 union / enum is defined in a header file but nowhere else used,
386 (by typedefing, pointer referencing or declaration) the mipsread code
387 builds the complete tree for the structure but leaves its code as
388 TYPE_CODE_UNDEF as it doesn't know what kind of aggregate it is.
389 Guess its type based on the details of the members.
390
0d3e7f60
SG
391Tue Oct 22 18:04:32 1991 Stu Grossman (grossman at cygnus.com)
392
393 * infrun.c (wait_for_inferior): Check return value from
394 find_pc_line.
395
bc6c937d
SG
396Mon Oct 21 17:47:03 1991 Stu Grossman (grossman at cygnus.com)
397
398 * infrun.c (wait_for_inferior): fix stepi/nexti that was broken
399 by my last edit to this routine.
400
b0077123
JG
401Mon Oct 21 14:27:43 1991 John Gilmore (gnu at cygnus.com)
402
403 * tm-sun3.h (FIX_CALL_DUMMY): problem with cross debugging.
404 FIX_CALL_DUMMY does unaligned accesses and/or forgets to byte swap
405 the values before putting them into the dummy code. (From Peter
406 Schauer)
407
44e4e473
SC
408Mon Oct 21 10:04:39 1991 Steve Chamberlain (steve at rtl.cygnus.com)
409
410 * configure.in: added ebmon target.
411
785ce19c 412Wed Oct 16 22:49:58 1991 John Gilmore (gnu at cygnus.com)
a1b8c5d6
JG
413
414 GDB-4.2 release!
415
416 * Makefile.in: Roll VERSION to 4.2.
44e4e473 417 * README, TODO, WHATS.NEW: Update.
a1b8c5d6
JG
418
419 * core.c (core_open): Improve error message for bad file.
420 Pass .reg virtual memory address to fetch_core_registers to help
421 it find the registers in the core-file header.
422 * coredep.c (fetch_core_registers): Take new argument, use it,
423 and pass it to register_addr to locate the block of registers.
785ce19c 424 * xm-mips.h: Update KERNEL_U_ADDR for new scheme. Cleanup a bit.
a1b8c5d6
JG
425
426 * dbxread.c (read_dbx_symtab, process_one_symbol): Handle
427 Sequent N_FN_SEQ like everybody else's N_FN.
428
429 * main.c: Circumvent SCO cc bug with #if !!defined(USG).
430 * tm-i386v.h: #endif guck.
431 * xconfig/i386*: Remove -Dgetpagesize()=4096 kludge.
785ce19c
JG
432 * xconfig/i386sco: Add HAVE_STRSTR to avoid ANSI bdeath.
433 * xconfig/tahoe: Add REGEX, which seems to be missing.
434
435 * coredep.c: Add <sys/types.h> for SCOnix.
436 * dbxread.c (read_dbx_symntab): Avoid coredump on malformed file.
437 * printcmd.c (print_formatted): Flush output before disassembly.
a1b8c5d6 438
93ae2e88
RP
439Tue Oct 15 20:12:32 1991 Roland H. Pesch (pesch at fowanton.cygnus.com)
440
9e0906a6
RP
441 * doc/refcard.tex (sec "Working Files"): consistent metavars and