import gdb-1999-09-08 snapshot

This commit is contained in:
Stan Shebs 1999-09-09 00:02:17 +00:00
parent 325188ecac
commit d4f3574e77
201 changed files with 8614 additions and 4843 deletions

View File

@ -1,3 +1,462 @@
1999-09-07 J.T. Conklin <jtc@redback.com>
* i386-stub.c (exceptionHook, oldExceptionHook): Removed.
(handle_exception): Removed #if'd out exception hook code.
* i386-stub.c, m68k-stub.c (error): Removed unused variable.
* i386-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
sparcl-stub.c, sparclet-stub.c (remcomInBuffer, remcomOutBuffer):
Make static.
Tue Sep 7 14:06:22 1999 Kevin Buettner <kevinb@cygnus.com>
* config/i386/tm-linux.h (SOFUN_ADDRESS_MAYBE_MISSING):
Define.
Tue Sep 7 08:18:01 1999 Kevin Buettner <kevinb@cygnus.com>
From Jim Blandy <jimb@cygnus.com>:
Step into calls to functions in shared libraries properly. See
the comments for SKIP_SOLIB_RESOLVER atop infrun.c for details.
* infrun.c (SKIP_SOLIB_RESOLVER): New macro.
1999-09-05 Fred Fish <fnf@cygnus.com>
* elfread.c (elf_symtab_read): Remove separately passed bfd
pointer and offset. Pick up bfd pointer from objfile, and
get offset from objfile's section_offsets.
Fri Sep 3 22:29:39 1999 Kevin Buettner <kevinb@cygnus.com>
* config/i386/tm-linux.h (REGISTER_NAMES): Changed register
named "foo" to "fopo" which more accurately describes the FPU
Operand Pointer Offset. The real reason for this change, of
course, is that many programmers use $foo as a convenience
variable and are likely to be unpleasantly surprised to find
that they're unwittingly changing the state of their ia32 FPU.
1999-09-03 Jason Molenda (jsm@bugshack.cygnus.com)
* monitor.c (monitor_supply_register): Stop scanning val string
if a newline is encountered.
1999-09-03 Jason Molenda (jsm@bugshack.cygnus.com)
monitor.c (TARGET_BUF_SIZE): New macro, defined to 2048.
(monitor_expect_regexp, monitor_wait, monitor_dump_reg_block,
monitor_dump_reg_block): Dump hard-coded constants in favor
of TARGET_BUF_SIZE.
(readchar): Re-enable output of characters read from monitor when
remotedebug is set.
(monitor_supply_register): Use ULONGEST to hold value.
Replace strtoul() call with hand-coded loop to handle values
larger than 'long'.
(monitor_store_register): Use ULONGEST to hold value.
Fri Sep 3 00:47:44 1999 Kevin Buettner <kevinb@cygnus.com>
[Merged linux/x86 floating point code from Bill Metzenthen,
Jim Blandy, Anthony Green, H. J. Liu, and possibly others. The
following remarks are Jim Blandy's.]
* findvar.c (extract_floating): Call TARGET_EXTRACT_FLOATING, if
#defined.
(store_floating): Call TARGET_STORE_FLOATING, if #defined.
* i386-tdep.c (i386_print_register, i386_do_registers_info): New
functions.
(i386_extract_return_value): GNU/Linux returns floating point
values in a floating point register too.
(set_disassembly_flavor): Add prototype.
(i386_extract_return_value): Use FPDATA_REGNUM, not FP0_REGNUM (
which wasn't the first FP data register).
(i386_do_registers_info): Use FPSTART_REGNUM and FPEND_REGNUM as
the limits of the FPU-related registers.
(i386_extract_return_value): Tell GDB how to find return values
larger than four bytes. (Thanks to Paul N. Hilfinger for the bug
report.)
* i387-tdep.c (print_387_control_word): Break out bit-splitting into...
(print_387_control_bits): New function.
(print_387_status_word): Break out bit-splitting into...
(print_387_status_bits): New function.
(i387_print_register, i387_float_info, i387_hex_float_input): New
functions.
(i387_extract_floating, i387_store_floating): New functions.
* valprint.c (print_floating): Use macro TARGET_ANALYZE_FLOATING,
if it's #defined. Tolerate values of `nonnegative' other than
zero and one.
* i386-linux-nat.c: New file.
* Makefile.in (ALLDEPFILES): Mention i386-linux-nat.c.
(i386-linux-nat.o): New rule, listing dependencies.
* config/i386/linux.mh (NATDEPFILES): Use i386-linux-nat.o, not
the plain i386v4-nat.o.
* config/i386/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define.
* config/i386/xm-linux.h: Define HOST_I386.
* config/i386/tm-linux.h (FP0_REGNUM): Replaced by...
(FPSTART_REGNUM, FPCONTROL_REGNUM, FPSTATUS_REGNUM, FPTAG_REGNUM,
FPDATA_REGNUM, FPEND_REGNUM): New definitions.
(REGISTER_BYTES): Changed accordingly.
(SKIP_SOLIB_RESOLVER): #define this.
(i386_linux_skip_solib_resolver): New declaration.
(i387_float_info): Added extern decl for this function.
(TARGET_EXTRACT_FLOATING, TARGET_STORE_FLOATING,
TARGET_ANALYZE_FLOATING): Define.
(i387_extract_floating, i387_store_floating): New extern decls.
(I386_GNULINUX_TARGET): Define.
(NUM_REGS, NUM_FREGS, REGISTER_NAMES, FP0_REGNUM, FPDATA_REGNUM,
FPENV_BYTES, FPREG_RAW_SIZE, FPREG_BYTES, REGISTER_BYTES,
REGISTER_BYTE, REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE,
MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE,
TARGET_LONG_DOUBLE_BIT, FLOAT_INFO, DO_REGISTERS_INFO): New
definitions, perhaps overriding those inherited from
config/i386/tm-i386.h.
(i386_do_registers_info, i387_print_register, double_to_i387,
i387_to_double): New declarations.
(LD_I387): Define iff both the host and target are using i387
FPU's.
(HEX_FLOAT_INPUT, REGISTER_CONVERTIBLE,
REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW,
REGISTER_VIRTUAL_TYPE): Define these if LD_I387 is defined.
* source.c (list_command): List the right number of source lines,
even if we're at the top of the file.
1999-09-02 Stan Shebs <shebs@andros.cygnus.com>
* infrun.c (step_over_function): New function, broken out from the
step_over_function label in handle_inferior_event.
(handle_inferior_event): Change a goto into a function call.
Thu Sep 2 18:26:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (GDB_WERROR_CFLAGS, GBB_WARN_CFLAGS): Define.
(INTERNAL_CFLAGS): Update
* configure.in (WERROR_CFLAGS, WARN_CFLAGS): Sync with
../sim/common/aclocal.m4.
* configure: Re-generate.
Thu Sep 2 00:27:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (z8k-tdep.o): For moment, don't try to compile with
-Werror. See Makefile.in.
* z8k-tdep.c (z8k_set_pointer_size): Document problem.
* config/z8k/tm-z8k.h (z8k_print_register_hook, z8k_frame_chain,
z8k_saved_pc_after_call, z8k_frame_saved_pc,
z8k_set_pointer_size): Declare.
(z8k_skip_prologue): Fix typo. Was mz8k_skip_prologue.
(FRAME_CHAIN, PRINT_REGISTER_HOOK, FRAME_SAVED_PC,
SAVED_PC_AFTER_CALL): Update.
* z8k-tdep.c (z8k_print_register_hook): Rename
z8k_print_register_hook.
(z8k_frame_chain): Rename frame_chain.
(z8k_saved_pc_after_call): Rename saved_pc_after_call.
(z8k_frame_saved_pc): Rename frame_saved_pc.
(z8k_print_register_hook): Fix printf.
(read_memory_pointer): Add declaration.
("value.h"): Include.
* Makefile.in (z8k-tdep.o): Add dependency on value.h.
* config/sparc/tm-sparc.h (PRINT_EXTRA_FRAME_INFO): Fix
printf. calls
* Makefile.in (remote-e7000.o): For moment, don't try to compile
with -Werror. See Makefile.in.
* sh-tdep.c (sh_show_regs): Fix printf calls.
* xcoffsolib.c (solib_info): Fix Printf calls.
* dink32-rom.c: #include "symfile.h" for generic_load and
"inferior.h" for write_pc.
* Makefile.in (dink32-rom.o): Update.
* config/mn10300/tm-mn10300.h (mn10300_store_struct_return),
config/mn10200/tm-mn10200.h (mn10200_store_struct_return): Add
declarations.
Tue Aug 31 00:48:27 1999 Andrew Cagney <cagney@amy.cygnus.com>
* config/mips/tm-tx49el.h (REGISTER_SIM_REGNO): Define.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register):
Pass REGISTER_SIM_REGNO converted register number to the
simulator.
1999-09-01 Tom Tromey <tromey@cygnus.com>
* config/i386/nm-linux.h (PREPARE_TO_PROCEED): Added argument.
1999-09-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* values.c (value_virtual_fn_field): Remove unused var(s).
* thread.c (prune_threads): Ditto.
* symtab.c (lookup_transparent_type): Ditto.
(decode_line_1): Ditto.
(make_symbol_overload_list): Ditto.
* rs6000-tdep.c (frame_get_saved_regs): Ditto.
(set_processor): Ditto.
* remote.c (remote_remove_breakpoint): Ditto.
(remote_query): Ditto.
(readtty): Ditto.
* remote-sds.c (sds_fetch_registers): Ditto.
(putmessage): Ditto.
* ppcbug-rom.c (ppcbug_supply_register): Ditto.
(ppcbug_open): Remove unused prototype.
* parse.c (parse_nested_classes_for_hpacc): Remove unused var(s).
* ocd.c (ocd_open): Ditto.
(ocd_get_packet): Ditto.
* monitor.c (monitor_error): Ditto.
(monitor_wait_srec_ack): Ditto.
* main.c (main): Ditto.
* gdbtypes.c (count_virtual_fns): Ditto.
* exec.c (exec_file_command): Ditto.
* event-top.c: Include handle_sigwinch() function prototype within
appropriate #ifdef.
* eval.c (evaluate_subexp_standard): Remove unused variable.
(evaluate_subexp_standard): Remove unused variables.
* dink32-rom.c (dink32_supply_register): Remove unused variable.
* dbxread.c (elfstab_build_psymtabs): Ditto.
* command.c (do_setshow_command): Ditto.
* breakpoint.c (solib_load_unload_1): Remove unused variables 'i'
and 'sal'.
(until_break_command): Remove unused variables 'arg1' and 'arg2'.
(create_exception_catchpoint): Remove unused variable 'i'.
* ax-gdb.c (gen_sub): Remove unused variable.
(_initialize_ax_gdb): Ditto.
* ser-pipe.c (pipe_readchar): If timeout is expired return
SERIAL_TIMEOUT.
* ser-tcp.c (tcp_readchar): If timeout is expired return
SERIAL_TIMEOUT.
Wed Sep 1 15:07:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
* version.h: New file.
* Makefile.in (version_h): Define.
(version.o): Add target.
* remote-array.c: #include "version.h".
(version): Delete extern declarations.
* Makefile.in (remote-array.o): Add dependency on version.h.
* top.c: #include "version.h".
(version, host_name, target_name): Delete extern declarations.
* Makefile.in (top.o): Add dependency on version.h.
* remote.c (remote_remove_watchpoint, remote_insert_watchpoint),
remote-array.c (array_open), remote-mips.c (send_srec),
dve3900-rom.c (store_bitmapped_register): Fix Printfs.
* mips-tdep.c (mips_print_extra_frame_info, print_unpack),
m32r-rom.c (m32r_load_section), m32r-tdep.c (m32r_frame_chain),
dsrec.c (load_srec): Fix printf problems.
Wed Sep 1 13:16:49 1999 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (monitor.o): For moment, don't try to compile with
-Werror. monitor.c has -Wformat problems. See Makefile.in for
more info.
Tue Aug 31 21:23:38 1999 Jeffrey A Law (law@cygnus.com)
* hppa-tdep.c (prologue_inst_adjust_sp): Correct offset computation
for doubleword store instructions.
(hppa_frame_find_saved_regs): Similarly.
Wed Sep 1 09:22:50 1999 Andrew Cagney <cagney@b1.cygnus.com>
* d30v-tdep.c (d30v_print_register):
(tdisassemble_command):
* d10v-tdep.c (show_regs, trace_info, tdisassemble_command): Fix
printf problems.
* remote-sim.c (dump_mem), remote-rdi.c (arm_rdi_create_inferior):
Fix printf arguments.
* remote-mips.c, mips-tdep.c: Move declaration of
``mips_set_processor_type_command'' from here.
* config/mips/tm-mips.h: To here.
* remote-array.c: #include "inferior.h".
* config/mips/tm-embed.h (remote_mips_stopped_by_watchpoint): Add
declaration.
* remote-mips.c (remote_mips_stopped_by_watchpoint): Define using
ISO-C prototype.
(monitor_supports_breakpoints): Integer variable.
* m32r-rom.c: #include "inferior.h" and <ctype.h>
* config/m32r/tm-m32r.h (m32r_write_sp): Add declaration.
* config/i960/tm-i960.h (leafproc_return, i960_pop_frame): Add
declaration.
(POP_FRAME): Call i960_pop_frame.
* i960-tdep.c (i960_pop_frame): Rename pop_frame.
* mon960-rom.c: #include "inferior.h" for declaration of write_pc.
1999-08-15 Fred Fish <fnf@cygnus.com>
* objfiles.c (objfile_relocate): Use SIZEOF_SECTION_OFFSETS when
allocating section_offsets array.
* remote-os9k.c (rombug_wait): Ditto.
* remote-vx.c (vx_add_symbols): Ditto.
* remote.c (get_offsets): Ditto.
(remote_cisco_objfile_relocate): Ditto.
* rs6000-nat.c (vmap_symtab): Ditto.
* dstread.c (dst_symfile_offsets): Set section_offsets directly instead
of returning a pointer to section offsets.
* somread.c (som_symfile_offsets): Ditto.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* symfile.c (default_symfile_offsets): Ditto.
(syms_from_objfile): The sym_offsets function has already set section
offsets and no longer returns a value.
* xcoffread.c (scan_xcoff_symtab): Eliminate section_offsets passed
separate from objfile.
(xcoff_start_psymtab): Ditto.
(START_PSYMTAB): Ditto.
* os9kread.c (read_minimal_symbols): Ditto.
(read_os9k_psymtab): Ditto.
(os9k_start_psymtab): Ditto.
(record_minimal_symbol): Ditto.
* dbxread.c (START_PSYMTAB): Ditto.
(start_psymtab): Ditto.
* mdebugread.c (START_PSYMTAB): Ditto.
(elfmdebug_build_psymtabs): Ditto.
(mdebug_build_psymtabs): Ditto.
(parse_partial_symbols): Ditto.
(new_psymtab): Ditto.
* dwarfread.c (dwarf_build_psymtabs): Ditto.
* partial-stab.h (START_PSYMTAB): Ditto.
* stabsread.h (start_psymtab): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs): Ditto.
(dwarf2_build_psymtabs_easy): Ditto.
(dwarf2_build_psymtabs_hard): Ditto.
* hp-psymtab-read.c (hpread_build_psymtabs): Ditto.
(hpread_quick_traverse): Ditto.
(hpread_start_psymtab): Ditto.
(scan_procs): Ditto.
* hpread.c (hpread_build_psymtabs): Ditto.
* symfile.h (dwarf2_build_psymtabs): Ditto.
* dbxread.c (read_dbx_symtab): Use ANOFFSET to access section
offsets.
* core-cisco.c (get_seg_info): Make static.
* coffread.c (enter_linenos): Pass objfile instead of section
offsets.
* jv-vm.c (jv_vm_internal_lookup_symbol): Call allocate_objfile
with the right number of arguments.
* dbxread.c (dbx_symfile_read): No need to explicitly pass
text addr and size. Let read_dbx_symtab find them.
(read_dbx_symtab): Get text addr and size from objfile.
(dbx_symfile_read): Remove dead code (call to strlen);
1999-08-31 Michael Snyder <msnyder@cleaver.cygnus.com>
* Makefile.in: add rule for sol-thread.o.
Add rule for linux-thread.o.
1999-08-13 Jim Kingdon <kingdon@redhat.com>
Threads code from gdb 4.18-codefusion-990706
[Thanks to Eric Paire, H. J. Liu, Jim Blandy and others]
* infrun.c (signal_stop_update, signal_print_update,
signal_pass_update): new functions.
* inferior.h: new prototypes for above functions.
* target.h (enum strata): add thread stratum.
* linux-thread.c: new file. Support for debugging linux threads.
* config/i386/nm-linux.h: several new prototypes for above.
* config/i386/linux.mh: add linux-thread.o to NATDEPFILES.
More threads code from the same place:
* config/i386/tm-linux.h (REALTIME_LO, REALTIME_HI): Add
definitions.
* target.h (enum target_signal): Add TARGET_SIGNAL_REALTIME_32.
* target.c (signals, target_signal_from_host,
target_signal_to_host): Add clauses for
TARGET_SIGNAL_REALTIME_32.
1999-08-31 Neil Schellenberger <neil.schellenberger@crosskeys.com>
* sol-thread.c (sol_thread_detach): strip thread-id out of
inferior_pid, so that procfs_detach can't choke on it.
1999-08-31 J.T. Conklin <jtc@redback.com>
* i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
sparcl-stub.c, sparclet-stub.c (getpacket): Remove 'buffer' arg,
define it as a pointer to &remcomInBuffer[0].
(handle_exception): Update.
* sparc-stub.c, sparcl-stub.c, sparclet-stub.c (handle_exception):
Removed #ifdef'd out code which implements the non-standard 'b'
(set baud rate) command.
1999-08-31 Stan Shebs <shebs@andros.cygnus.com>
* infrun.c (keep_going): New function, broken out from the
keep_going label in handle_inferior_event.
(handle_inferior_event): Change more gotos into function calls.
Tue Aug 31 02:29:27 1999 Jeffrey A Law (law@cygnus.com)
* hppa-tdep.c (read_unwind_info): Handle multiple unwind sections.
Tue Aug 31 15:28:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
* config/alpha/tm-alpha.h (PRINT_EXTRA_FRAME_INFO): Fix printf
format argument.
* alpha-tdep.c (heuristic_proc_start): Ditto.
From Stan Shebs <shebs@andros.cygnus.com>:
* defs.h (strlen_paddr): Fix prototype - add void argument list.
Tue Aug 31 14:02:12 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (gdb_print_host_address), utils.c
(gdb_print_host_address): Rename gdb_print_address.
* expprint.c, gdbtypes.c, symmisc.c: Update.
*expprint.c: Use gdb_print_host_address when displaying native
pointers.
Sat Aug 28 14:23:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
* scm-valprint.c (scm_ipruk), jv-valprint.c (java_value_print),
cp-valprint.c (cp_print_class_member), exec.c (exec_files_info),
remote.c (putpkt_binary, compare_sections_command,
remote_cisco_section_offsets), dcache.c (dcache_info),
breakpoint.c (break_at_finish_at_depth_command_1,
break_at_finish_command_1), symfile.c (generic_load),
(report_transfer_performance), top.c (get_prompt_1), f-valprint.c
(f_val_print), maint.c (maintenance_translate_address): Fix printf
-Wformat warnings. Use paddr, paddr_nz, sizeof_paddr, paddr_u and
paddr_d to print addresses. Change ``d'' to ``ld''.
* utils.c (strlen_paddr): New function.
Tue Aug 31 01:36:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
* config/d30v/tm-d30v.h (d30v_frame_chain,
d30v_init_frame_pc): Add declaration.
* arc-tdep.c (arc_pop_frame): Rename pop_frame.
(arc_push_dummy_frame): Rename push_dummy_frame.
(arc_set_cpu_type_command): Add declaration.
* config/arc/tm-arc.h (arc_pop_frame, arc_push_dummy_frame): Add
declaration.
1999-08-30 Stan Shebs <shebs@andros.cygnus.com>
* infrun.c (prepare_to_wait): New function, broken out from the

View File

@ -126,6 +126,8 @@ READLINE_CFLAGS = -I$(READLINE_SRC)/..
WARN_CFLAGS = @WARN_CFLAGS@
WERROR_CFLAGS = @WERROR_CFLAGS@
GDB_WARN_CFLAGS = $(WARN_CFLAGS)
GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
# Where is the INTL library? Typically in ../intl.
INTL_DIR = ../intl
@ -188,8 +190,8 @@ INTERNAL_WARN_CFLAGS = \
$(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
$(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \
$(INTL_CFLAGS) $(TUI_CFLAGS) $(ENABLE_CFLAGS) $(WARN_CFLAGS)
INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(WERROR_CFLAGS)
$(INTL_CFLAGS) $(TUI_CFLAGS) $(ENABLE_CFLAGS) $(GDB_WARN_CFLAGS)
INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
@ -227,7 +229,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
VERSION = 19990830
VERSION = 19990908
DIST=gdb
LINT=/usr/5bin/lint
@ -453,6 +455,7 @@ inferior_h = inferior.h $(breakpoint_h)
tracepoint_h = tracepoint.h
ax_h = ax.h
event_loop_h = event-loop.h
version_h = version.h
# Header files that need to have srcdir added. Note that in the cases
# where we use a macro like $(gdbcmd_h), things are carefully arranged
@ -829,9 +832,12 @@ copying.c: COPYING copying.awk
awk -f $(srcdir)/copying.awk < $(srcdir)/COPYING > copying.c
version.c: Makefile
echo 'char *version = "$(VERSION)";' >version.c
echo 'char *host_name = "$(host_alias)";' >> version.c
echo 'char *target_name = "$(target_alias)";' >> version.c
rm -f version.c
echo '#include "version.h"' >> version.c
echo 'const char version[] = "$(VERSION)";' >> version.c
echo 'const char host_name[] = "$(host_alias)";' >> version.c
echo 'const char target_name[] = "$(target_alias)";' >> version.c
version.o: version.c $(version_h)
# c-exp.tab.c is generated in objdir from c-exp.y if it doesn't exist
# in srcdir, then compiled in objdir to c-exp.tab.o.
@ -942,7 +948,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
gould-tdep.c gould-xdep.c h8300-tdep.c h8500-tdep.c \
hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c \
hp-psymtab-read.c hp-symtab-read.c \
i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c \
i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c i386-linux-nat.c \
i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-tdep.c \
i387-tdep.c \
i960-tdep.c \
@ -1092,7 +1098,7 @@ delta68-nat.o: delta68-nat.c $(defs_h)
demangle.o: demangle.c $(defs_h) $(gdbcmd_h) gdb_string.h
dink32-rom.o: dink32-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
$(inferior_h) target.h serial.h terminal.h
$(inferior_h) target.h serial.h terminal.h symfile.h
dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) gdb_string.h
@ -1190,6 +1196,9 @@ i386mach-nat.o: i386mach-nat.c $(defs_h) $(gdbcore_h) $(inferior_h)
i386v-nat.o: i386v-nat.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) language.h target.h
i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
$(symtab_h) $(frame_h) $(symfile_h) $(objfiles_h)
i386v4-nat.o: i386v4-nat.c $(defs_h)
i387-tdep.o: i387-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
@ -1309,8 +1318,14 @@ mipsread.o: mipsread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h
# FIXME: Monitor.c has -Wformat problems. The code using the macros
# RDEBUG and EXTRA_RDEBUG needs be replaced with something that:
# doesn't cause -Wformat errors; sends all output to gdb_stdlog
# instead of stdout; and controls the output throug a ``set
# monitordebug'' command/variable. cagney, 1999-09-01.
monitor.o: monitor.c monitor.h $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
$(inferior_h) target.h serial.h terminal.h gdb_string.h
$(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $<
news-xdep.o: news-xdep.c
@ -1382,6 +1397,12 @@ printcmd.o: printcmd.c $(breakpoint_h) $(defs_h) $(expression_h) \
procfs.o: procfs.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
target.h gdb_string.h
sol-thread.o: sol-thread.c $(defs_h) gdbthread.h target.h $(inferior_h) \
$(gdbcmd_h)
linux-thread.o: linux-thread.c $(breakpoint_h) $(gdbcmd_h) $(wait_h) \
gdbthread.h $(gdbcore_h) $(inferior_h) target.h $(defs_h)
# OBSOLETE pyr-tdep.o: pyr-tdep.c $(defs_h)
# OBSOLETE pyr-xdep.o: pyr-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
@ -1392,7 +1413,8 @@ remote-adapt.o: remote-adapt.c $(wait_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) target.h terminal.h gdb_string.h
remote-array.o: remote-array.c $(wait_h) $(defs_h) $(gdbcore_h) target.h \
gdb_string.h $(command_h) serial.h monitor.h $(remote_utils_h)
gdb_string.h $(command_h) serial.h monitor.h $(remote_utils_h) \
$(version_h)
remote-rdi.o: remote-rdi.c $(wait_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) gdb_string.h
@ -1416,8 +1438,13 @@ remote-rdp.o: remote-rdp.c $(wait_h) $(defs_h) $(gdbcore_h) \
remote-bug.o: remote-bug.c $(wait_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) target.h terminal.h $(remote_utils_h) gdb_string.h
# FIXME: For the SH target, remote-e7000 contains numerous -Wformat
# warnings. Since the fixes involve modifications to the code that
# handles the SH remote protocol the changes need to be tested against
# an SH board before they can be committed. cagney 1999-09-01.
remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) target.h \
$(wait_h) serial.h gdb_string.h
$(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $<
remote-eb.o: remote-eb.c $(wait_h) $(srcdir)/config/a29k/tm-a29k.h \
$(defs_h) $(gdbcore_h) $(inferior_h) symfile.h target.h terminal.h \
@ -1587,7 +1614,7 @@ thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h
top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \
$(defs_h) $(gdbcmd_h) $(inferior_h) language.h signals.h \
$(remote_utils_h) gdb_string.h $(event_loop_h)
$(remote_utils_h) gdb_string.h $(event_loop_h) $(version_h)
typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
$(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \
@ -1645,8 +1672,12 @@ xcoffread.o: xcoffread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \
xcoffsolib.o: xcoffsolib.c $(bfd_h) $(defs_h) xcoffsolib.h
# FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't
# declared -Wimplicit fails. It should be using the GDBARCH framework.
# cagney 1999-09-02.
z8k-tdep.o: z8k-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) $(frame_h) \
$(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(gdbcore_h)
$(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(gdbcore_h) $(value_h)
$(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $<
c-exp.tab.o: c-exp.tab.c c-lang.h $(defs_h) $(expression_h) \
$(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \

View File

@ -465,7 +465,7 @@ heuristic_proc_start (pc)
else
warning ("Hit heuristic-fence-post without finding");
warning ("enclosing function for address 0x%lx", pc);
warning ("enclosing function for address 0x%s", paddr_nz (pc));
if (!blurb_printed)
{
printf_filtered ("\

View File

@ -27,6 +27,10 @@
#include "symtab.h"
#include "gdbcmd.h"
/* Local functions */
static int arc_set_cpu_type (char *str);
/* Current CPU, set with the "set cpu" command. */
static int arc_bfd_mach_type;
char *arc_cpu_type;
@ -404,7 +408,7 @@ frame_find_saved_regs (fip, fsrp)
}
void
push_dummy_frame ()
arc_push_dummy_frame (void)
{
CORE_ADDR sp = read_register (SP_REGNUM);
int regnum;
@ -425,7 +429,7 @@ push_dummy_frame ()
}
void
pop_frame ()
arc_pop_frame (void)
{
struct frame_info *frame = get_current_frame ();
CORE_ADDR fp;
@ -641,9 +645,7 @@ arc_print_insn (vma, info)
/* Command to set cpu type. */
void
arc_set_cpu_type_command (args, from_tty)
char *args;
int from_tty;
arc_set_cpu_type_command (char *args, int from_tty)
{
int i;
@ -677,7 +679,7 @@ arc_show_cpu_type_command (args, from_tty)
/* Modify the actual cpu type.
Result is a boolean indicating success. */
int
static int
arc_set_cpu_type (str)
char *str;
{

View File

@ -1049,8 +1049,6 @@ gen_sub (ax, value, value1, value2)
struct agent_expr *ax;
struct axs_value *value, *value1, *value2;
{
struct type *element;
if (value1->type->code == TYPE_CODE_PTR)
{
/* Is it PTR - INT? */
@ -1943,8 +1941,6 @@ void _initialize_ax_gdb PARAMS ((void));
void
_initialize_ax_gdb ()
{
struct cmd_list_element *c;
add_cmd ("agent", class_maintenance, agent_command,
"Translate an expression into remote agent bytecode.",
&maintenancelist);

View File

@ -3415,10 +3415,8 @@ solib_load_unload_1 (hookname, tempflag, dll_pathname, cond_string, bp_kind)
{
struct breakpoint *b;
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct cleanup *old_chain;
struct cleanup *canonical_strings_chain = NULL;
int i;
char *addr_start = hookname;
char *addr_end = NULL;
char **canonical = (char **) NULL;
@ -4101,9 +4099,9 @@ break_at_finish_at_depth_command_1 (arg, flag, from_tty)
{
addr_string = (char *) xmalloc (26 + extra_args_len);
if (extra_args_len)
sprintf (addr_string, "*0x%x %s", high, extra_args);
sprintf (addr_string, "*0x%s %s", paddr_nz (high), extra_args);
else
sprintf (addr_string, "*0x%x", high);
sprintf (addr_string, "*0x%s", paddr_nz (high));
break_command_1 (addr_string, flag, from_tty);
free (addr_string);
}
@ -4138,7 +4136,7 @@ break_at_finish_command_1 (arg, flag, from_tty)
if (selected_frame)
{
addr_string = (char *) xmalloc (15);
sprintf (addr_string, "*0x%x", selected_frame->pc);
sprintf (addr_string, "*0x%s", paddr_nz (selected_frame->pc));
if (arg)
if_arg = 1;
}
@ -4186,9 +4184,9 @@ break_at_finish_command_1 (arg, flag, from_tty)
{
break_string = (char *) xmalloc (extra_args_len + 26);
if (extra_args_len)
sprintf (break_string, "*0x%x %s", high, extra_args);
sprintf (break_string, "*0x%s %s", paddr_nz (high), extra_args);
else
sprintf (break_string, "*0x%x", high);
sprintf (break_string, "*0x%s", paddr_nz (high));
break_command_1 (break_string, flag, from_tty);
free (break_string);
}
@ -4666,7 +4664,6 @@ until_break_command (arg, from_tty)
struct frame_info *prev_frame = get_prev_frame (selected_frame);
struct breakpoint *breakpoint;
struct cleanup *old_chain;
struct continuation_arg *arg1, *arg2;
clear_proceed_status ();
@ -5238,7 +5235,6 @@ create_exception_catchpoint (tempflag, cond_string, ex_event, sal)
struct symtab_and_line *sal;
{
struct breakpoint *b;
int i;
int thread = -1; /* All threads. */
if (!sal) /* no exception support? */

View File

@ -201,7 +201,7 @@ static void patch_opaque_types PARAMS ((struct symtab *));
static void patch_type PARAMS ((struct type *, struct type *));
static void enter_linenos PARAMS ((long, int, int, struct section_offsets *));
static void enter_linenos PARAMS ((long, int, int, struct objfile *));
static void free_linetab PARAMS ((void));
@ -1081,7 +1081,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile)
fcn_first_line_addr);
else
enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
objfile->section_offsets);
objfile);
finish_block (new->name, &local_symbols, new->old_blocks,
new->start_addr,
@ -1389,11 +1389,11 @@ free_linetab ()
#endif
static void
enter_linenos (file_offset, first_line, last_line, section_offsets)
enter_linenos (file_offset, first_line, last_line, objfile)
long file_offset;
register int first_line;
register int last_line;
struct section_offsets *section_offsets;
struct objfile *objfile;
{
register char *rawptr;
struct internal_lineno lptr;
@ -1423,7 +1423,7 @@ enter_linenos (file_offset, first_line, last_line, section_offsets)
if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
record_line (current_subfile, first_line + L_LNNO32 (&lptr),
lptr.l_addr.l_paddr
+ ANOFFSET (section_offsets, SECT_OFF_TEXT));
+ ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT));
else
break;
}

View File

@ -1374,8 +1374,6 @@ do_setshow_command (arg, from_tty, c)
{
case var_string:
{
unsigned char *p;
fputs_filtered ("\"", gdb_stdout);
if (*(unsigned char **) c->var)
fputstr_filtered (*(unsigned char **) c->var, '"', gdb_stdout);

View File

@ -408,7 +408,7 @@ init_extra_frame_info PARAMS ((struct frame_info *));
#define PRINT_EXTRA_FRAME_INFO(fi) \
{ \
if (fi && fi->proc_desc && fi->proc_desc->pdr.framereg < NUM_REGS) \
printf_filtered (" frame pointer is at %s+%d\n", \
printf_filtered (" frame pointer is at %s+%ld\n", \
REGISTER_NAME (fi->proc_desc->pdr.framereg), \
fi->proc_desc->pdr.frameoffset); \
}

View File

@ -309,12 +309,14 @@ extern void frame_find_saved_regs (); /* See arc-tdep.c */
/* Things needed for making calls to functions in the inferior process */
void arc_push_dummy_frame (void);
#define PUSH_DUMMY_FRAME \
push_dummy_frame ()
arc_push_dummy_frame ()
/* Discard from the stack the innermost frame, restoring all registers. */
void arc_pop_frame (void);
#define POP_FRAME \
pop_frame ()
arc_pop_frame ()
/* This sequence of words is the instructions bl xxxx, flag 1 */
#define CALL_DUMMY { 0x28000000, 0x1fbe8001 }

View File

@ -215,6 +215,7 @@ extern void d30v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
CORE_ADDR d30v_frame_chain (struct frame_info *frame);
#define FRAME_CHAIN(FRAME) d30v_frame_chain(FRAME)
extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
#define FRAME_CHAIN_VALID(chain, thisframe) d30v_frame_chain_valid (chain, thisframe)
@ -222,6 +223,7 @@ extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
void d30v_init_frame_pc (int fromleaf, struct frame_info *prev);
#define INIT_FRAME_PC_FIRST(fromleaf, prev) d30v_init_frame_pc(fromleaf, prev)
#define INIT_FRAME_PC(fromleaf, prev) /* nada */

View File

@ -4,4 +4,5 @@ XM_FILE= xm-linux.h
XDEPFILES= ser-tcp.o
NAT_FILE= nm-linux.h
NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o core-aout.o core-regset.o i386v-nat.o i386v4-nat.o
NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o \
core-aout.o core-regset.o i386v-nat.o i386-linux-nat.o linux-thread.o

View File

@ -64,6 +64,9 @@ extern int kernel_u_size PARAMS ((void));
#include "solib.h" /* Support for shared libraries. */
#endif
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS
extern CORE_ADDR
i386_stopped_by_watchpoint PARAMS ((int));
extern int
@ -71,4 +74,22 @@ i386_insert_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len, int rw));
extern int
i386_remove_watchpoint PARAMS ((int pid, CORE_ADDR addr, int len));
/* Support for the glibc linuxthreads package. */
#ifdef __STDC__
struct objfile;
#endif
extern void
linuxthreads_new_objfile PARAMS ((struct objfile *objfile));
#define target_new_objfile(OBJFILE) linuxthreads_new_objfile (OBJFILE)
extern char *
linuxthreads_pid_to_str PARAMS ((int pid));
#define target_pid_to_str(PID) linuxthreads_pid_to_str (PID)
extern int
linuxthreads_prepare_to_proceed PARAMS ((int step));
#define PREPARE_TO_PROCEED(select_it) linuxthreads_prepare_to_proceed (1)
#endif /* #ifndef NM_LINUX_H */

View File

@ -21,8 +21,7 @@
#ifndef TM_LINUX_H
#define TM_LINUX_H
/* FIXME: If nothing else gets added to this file, it could be removed
and configure could just use tm-i386.h instead. -fnf */
#define I386_GNULINUX_TARGET
#include "i386/tm-i386.h"
@ -39,9 +38,196 @@
#include "tm-sysv4.h"
/* copy of tm-cygwin32.h */
#undef REGISTER_RAW_SIZE
#undef REGISTER_VIRTUAL_SIZE
#undef REGISTER_VIRTUAL_TYPE
#undef REGISTER_NAMES
#undef REGISTER_BYTES
#undef REGISTER_BYTE
#undef MAX_REGISTER_VIRTUAL_SIZE
#undef NUM_REGS
#undef NUM_FREGS
/* Number of machine registers */
#define NUM_REGS 31
#define NUM_FREGS 15
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
/* the order of the first 8 registers must match the compiler's
* numbering scheme (which is the same as the 386 scheme)
* also, this table must match regmap in i386-pinsn.c.
*/
#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
"esp", "ebp", "esi", "edi", \
"eip", "eflags","cs", "ss", \
"ds", "es", "fs", "gs", \
"cwd", "swd", "twd", "fip", \
"fcs", "fopo", "fos", \
"st", "st1", "st2", "st3", \
"st4", "st5", "st6", "st7",}
#define LOW_RETURN_REGNUM 0 /* holds low four bytes of result */
#define HIGH_RETURN_REGNUM 2 /* holds high four bytes of result */
#define FPSTART_REGNUM 16 /* start of FPU registers */
#define FPCONTROL_REGNUM 16 /* FPU control register */
#define FPSTATUS_REGNUM 17 /* FPU status register */
#define FPTAG_REGNUM 18 /* FPU tag register */
#define FPDATA_REGNUM 23 /* actual floating-point values */
#define FPEND_REGNUM (FPSTART_REGNUM + 14) /* last FPU register */
#define FPENV_BYTES (7 * 4)
#define FPREG_RAW_SIZE (10)
/* Total amount of space needed to store our copies of the machine's
FPU state. */
#define FPREG_BYTES (FPENV_BYTES + 8 * FPREG_RAW_SIZE)
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
#define REGISTER_BYTES (FPSTART_REGNUM * 4 + FPREG_BYTES)
/* Index within `registers' of the first byte of the space for
register N. */
#define REGISTER_BYTE(N) (((N) < FPDATA_REGNUM) ? \
(N) * 4 : \
(((N) - FPDATA_REGNUM) * FPREG_RAW_SIZE) \
+ (FPDATA_REGNUM * 4))
/* Number of bytes of storage in the actual machine representation
for register N. */
#define REGISTER_RAW_SIZE(N) (((N) < FPDATA_REGNUM) ? 4 : FPREG_RAW_SIZE)
/* Number of bytes of storage in the program's representation
for register N. */
#define REGISTER_VIRTUAL_SIZE(N) (((N) < FPDATA_REGNUM) ? 4 : FPREG_RAW_SIZE)
/* Largest value REGISTER_RAW_SIZE can have. */
#undef MAX_REGISTER_RAW_SIZE
#define MAX_REGISTER_RAW_SIZE FPREG_RAW_SIZE
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
#define MAX_REGISTER_VIRTUAL_SIZE FPREG_RAW_SIZE
#if defined(HAVE_LONG_DOUBLE) && defined(HOST_I386)
/* The host and target are i386 machines and the compiler supports
long doubles. Long doubles on the host therefore have the same
layout as a 387 FPU stack register. */
#define LD_I387
#endif
#define TARGET_LONG_DOUBLE_BIT 80
#ifdef LD_I387
extern int i387_extract_floating (PTR addr, int len, long double *dretptr);
extern int i387_store_floating (PTR addr, int len, long double val);
#define TARGET_EXTRACT_FLOATING i387_extract_floating
#define TARGET_STORE_FLOATING i387_store_floating
#define TARGET_ANALYZE_FLOATING \
do \
{ \
unsigned expon; \
\
low = extract_unsigned_integer (valaddr, 4); \
high = extract_unsigned_integer (valaddr + 4, 4); \
expon = extract_unsigned_integer (valaddr + 8, 2); \
\
nonnegative = ((expon & 0x8000) == 0); \
is_nan = ((expon & 0x7fff) == 0x7fff) \
&& ((high & 0x80000000) == 0x80000000) \
&& (((high & 0x7fffffff) | low) != 0); \
} \
while (0)
#endif
#ifndef LD_I387
/* Nonzero if register N requires conversion
from raw format to virtual format. */
#define REGISTER_CONVERTIBLE(N) \
((N < FPDATA_REGNUM) ? 0 : 1)
#endif
#ifdef LD_I387
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
{ \
long double val = *((long double *)FROM); \
store_floating ((TO), TYPE_LENGTH (TYPE), val); \
}
#else
/* Convert data from raw format for register REGNUM in buffer FROM
to virtual format with type TYPE in buffer TO. */
extern void
i387_to_double PARAMS ((char *, char *));
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
{ \
double val; \
i387_to_double ((FROM), (char *)&val); \
store_floating ((TO), TYPE_LENGTH (TYPE), val); \
}
#endif
#ifdef LD_I387
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
{ \
long double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
*((long double *)TO) = val; \
}
#else
extern void
double_to_i387 PARAMS ((char *, char *));
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
{ \
double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
double_to_i387((char *)&val, (TO)); \
}
#endif
/* Return the GDB type object for the "standard" data type
of data in register N. */
#ifdef LD_I387
#define REGISTER_VIRTUAL_TYPE(N) \
((N < FPDATA_REGNUM) ? builtin_type_int : \
builtin_type_long_double)
#else
#define REGISTER_VIRTUAL_TYPE(N) \
((N < FPDATA_REGNUM) ? builtin_type_int : \
builtin_type_double)
#endif
/* end of copy */
extern void i387_float_info(void);
#define FLOAT_INFO { i387_float_info (); }
/* The following works around a problem with /usr/include/sys/procfs.h */
#define sys_quotactl 1
/* Define DO_REGISTERS_INFO() to do machine-specific formatting
of register dumps. */
#define DO_REGISTERS_INFO(_regnum, fp) i386_do_registers_info(_regnum, fp)
extern void i386_do_registers_info PARAMS ((int, int));
extern void i387_print_register PARAMS ((char *, int));
/* When the i386 Linux kernel calls a signal handler, the return
address points to a bit of code on the stack. These definitions
are used to identify this bit of code as a signal trampoline in
@ -104,4 +290,29 @@ extern CORE_ADDR i386_linux_sigtramp_saved_pc PARAMS ((struct frame_info *));
extern CORE_ADDR i386_linux_sigtramp_saved_sp PARAMS ((struct frame_info *));
/* Some versions of Linux have real-time signal support in the C library, and
some don't. We have to include this file to find out. */
#include <signal.h>
#ifdef __SIGRTMIN
#define REALTIME_LO __SIGRTMIN
#define REALTIME_HI (__SIGRTMAX + 1)
#else
#define REALTIME_LO 32
#define REALTIME_HI 64
#endif
/* When we call a function in a shared library, and the PLT sends us
into the dynamic linker to find the function's real address, we
need to skip over the dynamic linker call. This function decides
when to skip, and where to skip to. See the comments for
SKIP_SOLIB_RESOLVER at the top of infrun.c. */
#define SKIP_SOLIB_RESOLVER i386_linux_skip_solib_resolver
extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
/* N_FUN symbols in shared libaries have 0 for their values and need
to be relocated. */
#define SOFUN_ADDRESS_MAYBE_MISSING
#endif /* #ifndef TM_LINUX_H */

View File

@ -21,6 +21,8 @@
#ifndef XM_LINUX_H
#define XM_LINUX_H
#define HOST_I386
#define HOST_BYTE_ORDER LITTLE_ENDIAN
#define HAVE_TERMIOS

View File

@ -287,6 +287,7 @@ extern use_struct_convention_fn i960_use_struct_convention;
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
CORE_ADDR leafproc_return (CORE_ADDR ip);
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(leafproc_return ((FI)->pc) != 0)
@ -341,8 +342,10 @@ error("Function calls into the inferior process are not supported on the i960")
/* Discard from the stack the innermost frame, restoring all registers. */
void i960_pop_frame (void);
#define POP_FRAME \
pop_frame ()
i960_pop_frame ()
/* This sequence of words is the instructions

View File

@ -168,6 +168,7 @@ extern CORE_ADDR m32r_skip_prologue PARAMS ((CORE_ADDR pc));
#define COERCE_FLOAT_TO_DOUBLE 1
extern void m32r_write_sp (CORE_ADDR val);
#define TARGET_WRITE_SP m32r_write_sp

View File

@ -43,6 +43,7 @@ int remote_mips_remove_watchpoint PARAMS ((CORE_ADDR addr, int len, int type));
#define HAVE_NONSTEPPABLE_WATCHPOINT
int remote_mips_stopped_by_watchpoint (void);
#define STOPPED_BY_WATCHPOINT(w) remote_mips_stopped_by_watchpoint ()
#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \

View File

@ -579,3 +579,7 @@ typedef unsigned long t_inst; /* Integer big enough to hold an instruction */
(((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
#define MSYMBOL_SIZE(msym) \
((long) MSYMBOL_INFO (msym) & 0x7fffffff)
/* Command to set the processor type. */
extern void mips_set_processor_type_command (char *, int);

View File

@ -161,6 +161,8 @@ extern CORE_ADDR mn10200_frame_saved_pc PARAMS ((struct frame_info *));
} \
}
extern CORE_ADDR mn10200_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
#define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) \
(SP) = mn10200_store_struct_return (STRUCT_ADDR, SP)

View File

@ -104,6 +104,8 @@ void mn10300_store_return_value PARAMS ((struct type * type, char *valbuf));
#define STORE_RETURN_VALUE(TYPE, VALBUF) \
mn10300_store_return_value (TYPE, VALBUF)
extern CORE_ADDR mn10300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
#define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) \
(mn10300_store_struct_return (STRUCT_ADDR, SP))

View File

@ -339,8 +339,8 @@ extern void sparc_init_extra_frame_info PARAMS ((int, struct frame_info *));
#define PRINT_EXTRA_FRAME_INFO(fi) \
{ \
if ((fi) && (fi)->flat) \
printf_filtered (" flat, pc saved at 0x%x, fp saved at 0x%x\n", \
(fi)->pc_addr, (fi)->fp_addr); \
printf_filtered (" flat, pc saved at 0x%s, fp saved at 0x%s\n", \
paddr_nz ((fi)->pc_addr), paddr_nz ((fi)->fp_addr)); \
}
#define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe))

View File

@ -42,7 +42,7 @@
to reach some "real" code. */
#define SKIP_PROLOGUE(ip) (z8k_skip_prologue (ip))
extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
extern CORE_ADDR z8k_skip_prologue PARAMS ((CORE_ADDR ip));
/* Immediately after a function call, return the saved pc.
@ -50,7 +50,9 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
the new frame is not set up until the new function executes
some instructions. */
#define SAVED_PC_AFTER_CALL(frame) saved_pc_after_call(frame)
extern int z8k_saved_pc_after_call (struct frame_info *frame);
#define SAVED_PC_AFTER_CALL(frame) z8k_saved_pc_after_call(frame)
/* Stack grows downward. */
@ -167,7 +169,8 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
is the address of a ptr sized byte word containing the calling
frame's address. */
#define FRAME_CHAIN(thisframe) frame_chain(thisframe);
extern CORE_ADDR z8k_frame_chain (struct frame_info *thisframe);
#define FRAME_CHAIN(thisframe) z8k_frame_chain(thisframe);
@ -179,7 +182,8 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME)
extern CORE_ADDR z8k_frame_saved_pc (struct frame_info *frame);
#define FRAME_SAVED_PC(FRAME) z8k_frame_saved_pc(FRAME)
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
@ -276,9 +280,11 @@ int sim_z8001_mode;
#define NO_STD_REGS
#define PRINT_REGISTER_HOOK(regno) print_register_hook(regno)
extern void z8k_print_register_hook (int regno);
#define PRINT_REGISTER_HOOK(regno) z8k_print_register_hook(regno)
extern void z8k_set_pointer_size (int newsize);
#define INIT_EXTRA_SYMTAB_INFO \
z8k_set_pointer_size(objfile->obfd->arch_info->bits_per_address);

75
gdb/configure vendored
View File

@ -5163,10 +5163,9 @@ case "${enableval}" in
build_warnings="${t} ${build_warnings}";;
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
else
build_warnings=""
if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
echo "Setting warning flags = $build_warnings" 6>&1
fi
WARN_CFLAGS=""
WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
@ -5180,6 +5179,10 @@ then
esac
done
fi
else
build_warnings=""
fi
@ -5216,12 +5219,12 @@ fi
# In the Cygwin environment, we need some additional flags.
echo $ac_n "checking for cygwin""... $ac_c" 1>&6
echo "configure:5343: checking for cygwin" >&5
echo "configure:5346: checking for cygwin" >&5
if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5348 "configure"
#line 5351 "configure"
#include "confdefs.h"
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
@ -5255,7 +5258,7 @@ if test x$gdb_cv_os_cygwin = xyes; then
else
TERM_LIB=
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
echo "configure:5382: checking for tgetent in -lncurses" >&5
echo "configure:5385: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -5263,7 +5266,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5390 "configure"
#line 5393 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -5274,7 +5277,7 @@ int main() {
tgetent()
; return 0; }
EOF
if { (eval echo configure:5401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -5293,7 +5296,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6
echo "configure:5420: checking for tgetent in -lHcurses" >&5
echo "configure:5423: checking for tgetent in -lHcurses" >&5
ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -5301,7 +5304,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lHcurses $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5428 "configure"
#line 5431 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -5312,7 +5315,7 @@ int main() {
tgetent()
; return 0; }
EOF
if { (eval echo configure:5439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -5331,7 +5334,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6
echo "configure:5458: checking for tgetent in -ltermlib" >&5
echo "configure:5461: checking for tgetent in -ltermlib" >&5
ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -5339,7 +5342,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermlib $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5466 "configure"
#line 5469 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -5350,7 +5353,7 @@ int main() {
tgetent()
; return 0; }
EOF
if { (eval echo configure:5477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -5369,7 +5372,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
echo "configure:5496: checking for tgetent in -ltermcap" >&5
echo "configure:5499: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -5377,7 +5380,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5504 "configure"
#line 5507 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -5388,7 +5391,7 @@ int main() {
tgetent()
; return 0; }
EOF
if { (eval echo configure:5515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -5407,7 +5410,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
echo "configure:5534: checking for tgetent in -lcurses" >&5
echo "configure:5537: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -5415,7 +5418,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5542 "configure"
#line 5545 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -5426,7 +5429,7 @@ int main() {
tgetent()
; return 0; }
EOF
if { (eval echo configure:5553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -5445,7 +5448,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6
echo "configure:5572: checking for tgetent in -lterminfo" >&5
echo "configure:5575: checking for tgetent in -lterminfo" >&5
ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -5453,7 +5456,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lterminfo $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5580 "configure"
#line 5583 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -5464,7 +5467,7 @@ int main() {
tgetent()
; return 0; }
EOF
if { (eval echo configure:5591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -5516,7 +5519,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:6727: checking for X" >&5
echo "configure:6730: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@ -5578,12 +5581,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
#line 6789 "configure"
#line 6792 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:6797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -5652,14 +5655,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6863 "configure"
#line 6866 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:6873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@ -5939,12 +5942,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
echo "configure:7221: checking for Cygwin environment" >&5
echo "configure:7224: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7226 "configure"
#line 7229 "configure"
#include "confdefs.h"
int main() {
@ -5955,7 +5958,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
if { (eval echo configure:7237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:7240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@ -5972,19 +5975,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
echo "configure:7254: checking for mingw32 environment" >&5
echo "configure:7257: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7259 "configure"
#line 7262 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
if { (eval echo configure:7266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:7269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@ -6003,7 +6006,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
echo "configure:7285: checking for executable suffix" >&5
echo "configure:7288: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -6013,7 +6016,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
if { (eval echo configure:7295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:7298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;

View File

@ -399,8 +399,10 @@ case "${enableval}" in
*,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${t} ${build_warnings}";;
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac],[build_warnings=""])dnl
esac
if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
echo "Setting warning flags = $build_warnings" 6>&1
fi
WARN_CFLAGS=""
WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
@ -413,7 +415,8 @@ then
*) WARN_CFLAGS="${WARN_CFLAGS} $w"
esac
done
fi
fi],[build_warnings=""])dnl
AC_SUBST(WARN_CFLAGS)
AC_SUBST(WERROR_CFLAGS)

View File

@ -726,7 +726,7 @@ cp_print_class_member (valaddr, domain, stream, prefix)
fprintf_filtered (stream, " (offset in bits)");
}
else
fprintf_filtered (stream, "%d", val >> 3);
fprintf_filtered (stream, "%ld", (long) (val >> 3));
}

View File

@ -729,34 +729,35 @@ show_regs (args, from_tty)
int from_tty;
{
int a;
printf_filtered ("PC=%04x (0x%x) PSW=%04x RPT_S=%04x RPT_E=%04x RPT_C=%04x\n",
read_register (PC_REGNUM), D10V_MAKE_IADDR (read_register (PC_REGNUM)),
read_register (PSW_REGNUM),
read_register (24),
read_register (25),
read_register (23));
printf_filtered ("R0-R7 %04x %04x %04x %04x %04x %04x %04x %04x\n",
read_register (0),
read_register (1),
read_register (2),
read_register (3),
read_register (4),
read_register (5),
read_register (6),
read_register (7));
printf_filtered ("R8-R15 %04x %04x %04x %04x %04x %04x %04x %04x\n",
read_register (8),
read_register (9),
read_register (10),
read_register (11),
read_register (12),
read_register (13),
read_register (14),
read_register (15));
printf_filtered ("IMAP0 %04x IMAP1 %04x DMAP %04x\n",
read_register (IMAP0_REGNUM),
read_register (IMAP1_REGNUM),
read_register (DMAP_REGNUM));
printf_filtered ("PC=%04lx (0x%lx) PSW=%04lx RPT_S=%04lx RPT_E=%04lx RPT_C=%04lx\n",
(long) read_register (PC_REGNUM),
(long) D10V_MAKE_IADDR (read_register (PC_REGNUM)),
(long) read_register (PSW_REGNUM),
(long) read_register (24),
(long) read_register (25),
(long) read_register (23));
printf_filtered ("R0-R7 %04lx %04lx %04lx %04lx %04lx %04lx %04lx %04lx\n",
(long) read_register (0),
(long) read_register (1),
(long) read_register (2),
(long) read_register (3),
(long) read_register (4),
(long) read_register (5),
(long) read_register (6),
(long) read_register (7));
printf_filtered ("R8-R15 %04lx %04lx %04lx %04lx %04lx %04lx %04lx %04lx\n",
(long) read_register (8),
(long) read_register (9),
(long) read_register (10),
(long) read_register (11),
(long) read_register (12),
(long) read_register (13),
(long) read_register (14),
(long) read_register (15));
printf_filtered ("IMAP0 %04lx IMAP1 %04lx DMAP %04lx\n",
(long) read_register (IMAP0_REGNUM),
(long) read_register (IMAP1_REGNUM),
(long) read_register (DMAP_REGNUM));
printf_filtered ("A0-A1");
for (a = A0_REGNUM; a <= A0_REGNUM + 1; a++)
{
@ -1129,10 +1130,11 @@ trace_info (args, from_tty)
for (i = 0; i < trace_data.size; ++i)
{
printf_filtered ("%d: %d instruction%s at 0x%x\n",
i, trace_data.counts[i],
printf_filtered ("%d: %d instruction%s at 0x%s\n",
i,
trace_data.counts[i],
(trace_data.counts[i] == 1 ? "" : "s"),
trace_data.addrs[i]);
paddr_nz (trace_data.addrs[i]));
}
}
else
@ -1261,7 +1263,7 @@ tdisassemble_command (arg, from_tty)
high = low;
}
printf_filtered ("Dump of trace from %d to %d:\n", low, high);
printf_filtered ("Dump of trace from %s to %s:\n", paddr_u (low), paddr_u (high));
display_trace (low, high);

View File

@ -34,6 +34,8 @@
#include "symfile.h"
#include "objfiles.h"
#include "language.h" /* For local_hex_string() */
void d30v_frame_find_saved_regs PARAMS ((struct frame_info * fi,
struct frame_saved_regs * fsr));
void d30v_frame_find_saved_regs_offsets PARAMS ((struct frame_info * fi,
@ -727,10 +729,11 @@ d30v_print_register (regnum, tabular)
if (regnum < A0_REGNUM)
{
if (tabular)
printf_filtered ("%08x", read_register (regnum));
printf_filtered ("%08lx", (long) read_register (regnum));
else
printf_filtered ("0x%x %d", read_register (regnum),
read_register (regnum));
printf_filtered ("0x%lx %ld",
(long) read_register (regnum),
(long) read_register (regnum));
}
else
{
@ -1162,10 +1165,10 @@ trace_info (args, from_tty)
for (i = 0; i < trace_data.size; ++i)
{
printf_filtered ("%d: %d instruction%s at 0x%x\n",
printf_filtered ("%d: %d instruction%s at 0x%s\n",
i, trace_data.counts[i],
(trace_data.counts[i] == 1 ? "" : "s"),
trace_data.addrs[i]);
paddr_nz (trace_data.addrs[i]));
}
}
else
@ -1294,7 +1297,9 @@ tdisassemble_command (arg, from_tty)
high = low;
}
printf_filtered ("Dump of trace from %d to %d:\n", low, high);
printf_filtered ("Dump of trace from %s to %s:\n",
paddr_u (low),
paddr_u (high));
display_trace (low, high);

View File

@ -289,7 +289,7 @@ static void
read_dbx_dynamic_symtab PARAMS ((struct objfile * objfile));
static void
read_dbx_symtab PARAMS ((struct objfile *, CORE_ADDR, int));
read_dbx_symtab PARAMS ((struct objfile *));
static void
free_bincl_list PARAMS ((struct objfile *));
@ -333,6 +333,10 @@ add_old_header_file PARAMS ((char *, int));
static void
add_this_object_header_file PARAMS ((int));
static struct partial_symtab *
start_psymtab PARAMS ((struct objfile *, char *, CORE_ADDR, int,
struct partial_symbol **, struct partial_symbol **));
/* Free up old header file tables */
static void
@ -571,8 +575,6 @@ record_minimal_symbol (name, address, type, objfile)
put all the relevant info into a "struct dbx_symfile_info",
hung off the objfile structure.
SECTION_OFFSETS contains offsets relative to which the symbols in the
various sections are (depending where the sections were actually loaded).
MAINLINE is true if we are reading the main symbol
table (as opposed to a shared lib or dynamically loaded file). */
@ -585,8 +587,6 @@ dbx_symfile_read (objfile, mainline)
int val;
struct cleanup *back_to;
val = strlen (objfile->name);
sym_bfd = objfile->obfd;
/* .o and .nlm files are relocatables with text, data and bss segs based at
@ -625,12 +625,9 @@ dbx_symfile_read (objfile, mainline)
init_minimal_symbol_collection ();
make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
/* Now that the symbol table data of the executable file are all in core,
process them and define symbols accordingly. */
/* Read stabs data from executable file and define symbols. */
read_dbx_symtab (objfile,
DBX_TEXT_ADDR (objfile),
DBX_TEXT_SIZE (objfile));
read_dbx_symtab (objfile);
/* Add the dynamic symbols. */
@ -1239,21 +1236,17 @@ read_dbx_dynamic_symtab (objfile)
do_cleanups (back_to);
}
/* Given pointers to an a.out symbol table in core containing dbx
style data, setup partial_symtab's describing each source file for
which debugging information is available.
SYMFILE_NAME is the name of the file we are reading from
and SECTION_OFFSETS is the set of offsets for the various sections
of the file (a set of zeros if the mainline program). */
/* Setup partial_symtab's describing each source file for which
debugging information is available. */
static void
read_dbx_symtab (objfile, text_addr, text_size)
read_dbx_symtab (objfile)
struct objfile *objfile;
CORE_ADDR text_addr;
int text_size;
{
register struct external_nlist *bufp = 0; /* =0 avoids gcc -Wall glitch */
struct internal_nlist nlist;
CORE_ADDR text_addr;
int text_size;
register char *namestring;
int nsl;
@ -1276,6 +1269,9 @@ read_dbx_symtab (objfile, text_addr, text_size)
struct partial_symtab **dependency_list;
int dependencies_used, dependencies_allocated;
text_addr = DBX_TEXT_ADDR (objfile);
text_size = DBX_TEXT_SIZE (objfile);
/* FIXME. We probably want to change stringtab_global rather than add this
while processing every symbol entry. FIXME. */
file_string_table_offset = 0;
@ -1361,8 +1357,8 @@ read_dbx_symtab (objfile, text_addr, text_size)
#define CUR_SYMBOL_VALUE nlist.n_value
#define CUR_SYMBOL_STRX nlist.n_strx
#define DBXREAD_ONLY
#define START_PSYMTAB(ofile,secoff,fname,low,symoff,global_syms,static_syms)\
start_psymtab(ofile, secoff, fname, low, symoff, global_syms, static_syms)
#define START_PSYMTAB(ofile,fname,low,symoff,global_syms,static_syms)\
start_psymtab(ofile, fname, low, symoff, global_syms, static_syms)
#define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)\
end_psymtab(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)
@ -1385,7 +1381,7 @@ read_dbx_symtab (objfile, text_addr, text_size)
/* Don't set pst->texthigh lower than it already is. */
CORE_ADDR text_end =
(lowest_text_address == (CORE_ADDR) -1
? (text_addr + objfile->section_offsets->offsets[SECT_OFF_TEXT])
? (text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT))
: lowest_text_address)
+ text_size;
@ -1406,11 +1402,9 @@ read_dbx_symtab (objfile, text_addr, text_size)
(normal). */
struct partial_symtab *
start_psymtab (objfile, section_offsets,
filename, textlow, ldsymoff, global_syms, static_syms)
static struct partial_symtab *
start_psymtab (objfile, filename, textlow, ldsymoff, global_syms, static_syms)
struct objfile *objfile;
struct section_offsets *section_offsets;
char *filename;
CORE_ADDR textlow;
int ldsymoff;
@ -1418,7 +1412,7 @@ start_psymtab (objfile, section_offsets,
struct partial_symbol **static_syms;
{
struct partial_symtab *result =
start_psymtab_common (objfile, section_offsets,
start_psymtab_common (objfile, objfile->section_offsets,
filename, textlow, global_syms, static_syms);
result->read_symtab_private = (char *)
@ -2635,7 +2629,6 @@ elfstab_build_psymtabs (objfile, mainline,
bfd *sym_bfd = objfile->obfd;
char *name = bfd_get_filename (sym_bfd);
struct dbx_symfile_info *info;
asection *text_sect;
/* There is already a dbx_symfile_info allocated by our caller.
It might even contain some info from the ELF symtab to help us. */

View File

@ -525,8 +525,8 @@ dcache_info (exp, tty)
for (p = last_cache->valid_head; p; p = p->p)
{
int j;
printf_filtered ("Line at %08xd, referenced %d times\n",
p->addr, p->refs);
printf_filtered ("Line at %s, referenced %d times\n",
paddr (p->addr), p->refs);
for (j = 0; j < LINE_SIZE; j++)
printf_filtered ("%02x", p->data[j] & 0xFF);

View File

@ -517,12 +517,13 @@ extern void fputstr_unfiltered PARAMS ((const char *str, int quotr, GDB_FILE *st
extern void fputstrn_unfiltered PARAMS ((const char *str, int n, int quotr, GDB_FILE *stream));
extern void gdb_print_address PARAMS ((void *, GDB_FILE *));
/* Display the host ADDR on STREAM formatted as ``0x%x''. */
extern void gdb_print_host_address (void *addr, struct gdb_file *stream);
/* Convert a CORE_ADDR into a HEX string. paddr() is like %08lx.
paddr_nz() is like %lx. paddr_u() is like %lu. paddr_width() is
for ``%*''. */
extern int strlen_paddr ();
extern int strlen_paddr (void);
extern char* paddr (CORE_ADDR addr);
extern char* paddr_nz (CORE_ADDR addr);
extern char* paddr_u (CORE_ADDR addr);

View File

@ -24,6 +24,8 @@
#include "target.h"
#include "monitor.h"
#include "serial.h"
#include "symfile.h" /* For generic_load() */
#include "inferior.h" /* For write_pc() */
static void dink32_open PARAMS ((char *args, int from_tty));
@ -34,7 +36,7 @@ dink32_supply_register (regname, regnamelen, val, vallen)
char *val;
int vallen;
{
int regno = 0, base = 0;
int regno = 0;
if (regnamelen < 2 || regnamelen > 4)
return;

View File

@ -1,3 +1,25 @@
1999-09-07 Stan Shebs <shebs@andros.cygnus.com>
* gdb.texinfo: Fiks speling errers.
* gdb.texinfo: Fix uses of @multitable.
From Eli Zaretskii <eliz@is.elta.co.il>:
* gdb.texinfo: Include details specific to DOS host, clarify
some confusing language, fix @ref/@xref/@pxref usages, add
comments about using with optimization, add more indexing,
fix info about disassembly-flavor.
Tue Sep 7 09:11:24 1999 Kevin Buettner <kevinb@cygnus.com>
* gdbint.texinfo (IN_SOLIB_DYNSYM_RESOLVE_CODE,
SKIP_SOLIB_RESOLVER): Define.
Fri Sep 3 18:05:14 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdb.texinfo (Protocol): Review. Add tables describing ``q'' and
``g'' packets.
1999-08-30 Stan Shebs <shebs@andros.cygnus.com>
* gdb.texinfo: Create a new "Configurations" chapter with

File diff suppressed because it is too large Load Diff

View File

@ -1481,6 +1481,17 @@ trampoline that connects to a shared library.
Define this to evaluate to nonzero if the program is stopped in the
trampoline that returns from a shared library.
@item IN_SOLIB_DYNSYM_RESOLVE_CODE pc
Define this to evaluate to nonzero if the program is stopped in the
dynamic linker.
@item SKIP_SOLIB_RESOLVER pc
Define this to evaluate to the (nonzero) address at which execution
should continue to get past the dynamic linker's symbol resolution
function. A zero value indicates that it is not important or necessary
to set a breakpoint to get through the dynamic linker and that single
stepping will suffice.
@item IS_TRAPPED_INTERNALVAR (name)
This is an ugly hook to allow the specification of special actions that
should occur as a side-effect of setting the value of a variable

View File

@ -98,8 +98,14 @@ load_srec (desc, file, load_offset, maxrecsize, flags, hashmark, waitack)
bfd_vma addr = bfd_get_section_vma (abfd, s) + load_offset;
bfd_size_type size = bfd_get_section_size_before_reloc (s);
char *section_name = (char *) bfd_get_section_name (abfd, s);
printf_filtered ("%s\t: 0x%08x .. 0x%08x ",
section_name, (int) addr, (int) addr + size);
/* Both GDB and BFD have mechanisms for printing addresses.
In the below, GDB's is used so that the address is
consistent with the rest of GDB. BFD's printf_vma() could
have also been used. cagney 1999-09-01 */
printf_filtered ("%s\t: 0x%s .. 0x%s ",
section_name,
paddr (addr),
paddr (addr + size));
gdb_flush (gdb_stdout);
data_count += size;

View File

@ -1638,13 +1638,13 @@ init_dst_sections (chan)
struct section_offsets dst_symfile_faker =
{0};
struct section_offsets *
void
dst_symfile_offsets (objfile, addr)
struct objfile *objfile;
CORE_ADDR addr;
{
objfile->num_sections = 1;
return &dst_symfile_faker;
objfile->section_offsets = &dst_symfile_faker;
}
/* Register our ability to parse symbols for DST BFD files */

View File

@ -532,7 +532,7 @@ store_bitmapped_register (regno, bf)
oldbits = (oldval >> bf->start) & mask;
newbits = (newval >> bf->start) & mask;
if (oldbits != newbits)
monitor_printf ("%s %x ", bf->user_name, newbits);
monitor_printf ("%s %lx ", bf->user_name, newbits);
}
}

View File

@ -563,14 +563,10 @@ extern int info_verbose; /* From main.c; nonzero => verbose */
static void dwarf2_locate_sections PARAMS ((bfd *, asection *, PTR));
#if 0
static void dwarf2_build_psymtabs_easy PARAMS ((struct objfile *,
struct section_offsets *,
int));
static void dwarf2_build_psymtabs_easy PARAMS ((struct objfile *, int));
#endif
static void dwarf2_build_psymtabs_hard PARAMS ((struct objfile *,
struct section_offsets *,
int));
static void dwarf2_build_psymtabs_hard PARAMS ((struct objfile *, int));
static char *scan_partial_symbols PARAMS ((char *, struct objfile *,
CORE_ADDR *, CORE_ADDR *));
@ -840,9 +836,8 @@ dwarf2_locate_sections (ignore_abfd, sectp, ignore_ptr)
/* Build a partial symbol table. */
void
dwarf2_build_psymtabs (objfile, section_offsets, mainline)
dwarf2_build_psymtabs (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
@ -867,17 +862,17 @@ dwarf2_build_psymtabs (objfile, section_offsets, mainline)
#if 0
if (dwarf_aranges_offset && dwarf_pubnames_offset)
{
/* Things are significanlty easier if we have .debug_aranges and
/* Things are significantly easier if we have .debug_aranges and
.debug_pubnames sections */
dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline);
dwarf2_build_psymtabs_easy (objfile, mainline);
}
else
#endif
/* only test this case for now */
{
/* In this case we have to work a bit harder */
dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline);
dwarf2_build_psymtabs_hard (objfile, mainline);
}
}
@ -886,9 +881,8 @@ dwarf2_build_psymtabs (objfile, section_offsets, mainline)
.debug_pubnames and .debug_aranges sections. */
static void
dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline)
dwarf2_build_psymtabs_easy (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
bfd *abfd = objfile->obfd;
@ -923,9 +917,8 @@ dwarf2_build_psymtabs_easy (objfile, section_offsets, mainline)
.debug_info and .debug_abbrev sections. */
static void
dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
dwarf2_build_psymtabs_hard (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
/* Instead of reading this into a big buffer, we should probably use
@ -1002,7 +995,7 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
set_cu_language (comp_unit_die.language);
/* Allocate a new partial symbol table structure */
pst = start_psymtab_common (objfile, section_offsets,
pst = start_psymtab_common (objfile, objfile->section_offsets,
comp_unit_die.name ? comp_unit_die.name : "",
comp_unit_die.lowpc,
objfile->global_psymbols.next,
@ -1016,7 +1009,7 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer;
DWARF_ABBREV_SIZE (pst) = dwarf_abbrev_size;
DWARF_LINE_BUFFER (pst) = dwarf_line_buffer;
baseaddr = ANOFFSET (section_offsets, 0);
baseaddr = ANOFFSET (objfile->section_offsets, 0);
/* Store the function that reads in the rest of the symbol table */
pst->read_symtab = dwarf2_psymtab_to_symtab;

View File

@ -704,7 +704,6 @@ set_cu_language (dip)
SYNOPSIS
void dwarf_build_psymtabs (struct objfile *objfile,
struct section_offsets *section_offsets,
int mainline, file_ptr dbfoff, unsigned int dbfsize,
file_ptr lnoffset, unsigned int lnsize)
@ -728,10 +727,9 @@ set_cu_language (dip)
*/
void
dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
dwarf_build_psymtabs (objfile, mainline, dbfoff, dbfsize,
lnoffset, lnsize)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
file_ptr dbfoff;
unsigned int dbfsize;
@ -765,8 +763,8 @@ dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
/* Save the relocation factor where everybody can see it. */
base_section_offsets = section_offsets;
baseaddr = ANOFFSET (section_offsets, 0);
base_section_offsets = objfile->section_offsets;
baseaddr = ANOFFSET (objfile->section_offsets, 0);
/* Follow the compilation unit sibling chain, building a partial symbol
table entry for each one. Save enough information about each compilation

View File

@ -77,7 +77,7 @@ static void
elf_symfile_finish PARAMS ((struct objfile *));
static void
elf_symtab_read PARAMS ((bfd *, CORE_ADDR, struct objfile *, int));
elf_symtab_read PARAMS ((struct objfile *, int));
static void
free_elfinfo PARAMS ((void *));
@ -221,15 +221,13 @@ record_minimal_symbol_and_info (name, address, ms_type, info, bfd_section,
SYNOPSIS
void elf_symtab_read (bfd *abfd, CORE_ADDR addr,
struct objfile *objfile, int dynamic)
void elf_symtab_read (struct objfile *objfile, int dynamic)
DESCRIPTION
Given an open bfd, a base address to relocate symbols to, and a
flag that specifies whether or not this bfd is for an executable
or not (may be shared library for example), add all the global
function and data symbols to the minimal symbol table.
Given an objfile and a flag that specifies whether or not the objfile
is for an executable or not (may be shared library for example), add
all the global function and data symbols to the minimal symbol table.
In stabs-in-ELF, as implemented by Sun, there are some local symbols
defined in the ELF symbol table, which can be used to locate
@ -240,9 +238,7 @@ record_minimal_symbol_and_info (name, address, ms_type, info, bfd_section,
*/
static void
elf_symtab_read (abfd, addr, objfile, dynamic)
bfd *abfd;
CORE_ADDR addr;
elf_symtab_read (objfile, dynamic)
struct objfile *objfile;
int dynamic;
{
@ -254,6 +250,7 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
int index;
struct cleanup *back_to;
CORE_ADDR symaddr;
CORE_ADDR offset;
enum minimal_symbol_type ms_type;
/* If sectinfo is nonNULL, it contains section info that should end up
filed in the objfile. */
@ -267,11 +264,11 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
#endif
struct dbx_symfile_info *dbx = objfile->sym_stab_info;
unsigned long size;
int stripped = (bfd_get_symcount (abfd) == 0);
int stripped = (bfd_get_symcount (objfile->obfd) == 0);
if (dynamic)
{
storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd);
storage_needed = bfd_get_dynamic_symtab_upper_bound (objfile->obfd);
/* Nothing to be done if there is no dynamic symtab. */
if (storage_needed < 0)
@ -279,9 +276,9 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
}
else
{
storage_needed = bfd_get_symtab_upper_bound (abfd);
storage_needed = bfd_get_symtab_upper_bound (objfile->obfd);
if (storage_needed < 0)
error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd),
bfd_errmsg (bfd_get_error ()));
}
if (storage_needed > 0)
@ -289,13 +286,15 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
symbol_table = (asymbol **) xmalloc (storage_needed);
back_to = make_cleanup (free, symbol_table);
if (dynamic)
number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd,
number_of_symbols = bfd_canonicalize_dynamic_symtab (objfile->obfd,
symbol_table);
else
number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
number_of_symbols = bfd_canonicalize_symtab (objfile->obfd, symbol_table);
if (number_of_symbols < 0)
error ("Can't read symbols from %s: %s", bfd_get_filename (abfd),
error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd),
bfd_errmsg (bfd_get_error ()));
/* FIXME: Should use section specific offset, not SECT_OFF_TEXT. */
offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
for (i = 0; i < number_of_symbols; i++)
{
sym = symbol_table[i];
@ -316,14 +315,14 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
a shared library.
If its value is non zero then it is usually the address
of the corresponding entry in the procedure linkage table,
relative to the base address.
plus the desired section offset.
If its value is zero then the dynamic linker has to resolve
the symbol. We are unable to find any meaningful address
for this symbol in the executable file, so we skip it. */
symaddr = sym->value;
if (symaddr == 0)
continue;
symaddr += addr;
symaddr += offset;
msym = record_minimal_symbol_and_info
((char *) sym->name, symaddr,
mst_solib_trampoline, NULL, sym->section, objfile);
@ -365,10 +364,10 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
interested in will have a section. */
/* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
/* Relocate all non-absolute symbols by base address. */
/* Relocate all non-absolute symbols by the section offset. */
if (sym->section != &bfd_abs_section)
{
symaddr += addr;
symaddr += offset;
}
/* For non-absolute symbols, use the type of the section
they are relative to, to intuit text/data. Bfd provides
@ -397,12 +396,12 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
}
/* If it is an Irix dynamic symbol, skip section name
symbols, relocate all others. */
symbols, relocate all others by section offset. */
if (ms_type != mst_abs)
{
if (sym->name[0] == '.')
continue;
symaddr += addr;
symaddr += offset;
}
}
else if (sym->section->flags & SEC_CODE)
@ -498,10 +497,10 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
}
/* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
/* Relocate non-absolute symbols by base address. */
/* Relocate non-absolute symbols by the section offset. */
if (sym->section != &bfd_abs_section)
{
symaddr += addr;
symaddr += offset;
}
sectinfo->sections[index] = symaddr;
/* The special local symbols don't go in the
@ -608,13 +607,11 @@ elf_symfile_read (objfile, mainline)
chain of info into the dbx_symfile_info in objfile->sym_stab_info,
which can later be used by elfstab_offset_sections. */
/* FIXME, should take a section_offsets param, not just an offset. */
offset = ANOFFSET (objfile->section_offsets, 0);
elf_symtab_read (abfd, offset, objfile, 0);
elf_symtab_read (objfile, 0);
/* Add the dynamic symbols. */
elf_symtab_read (abfd, offset, objfile, 1);
elf_symtab_read (objfile, 1);
/* Now process debugging information, which is contained in
special ELF sections. */
@ -651,8 +648,7 @@ elf_symfile_read (objfile, mainline)
information. */
swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
if (swap)
elfmdebug_build_psymtabs (objfile, swap, ei.mdebugsect,
objfile->section_offsets);
elfmdebug_build_psymtabs (objfile, swap, ei.mdebugsect);
}
if (ei.stabsect)
{
@ -674,13 +670,13 @@ elf_symfile_read (objfile, mainline)
if (dwarf2_has_info (abfd))
{
/* DWARF 2 sections */
dwarf2_build_psymtabs (objfile, objfile->section_offsets, mainline);
dwarf2_build_psymtabs (objfile, mainline);
}
else if (ei.dboffset && ei.lnoffset)
{
/* DWARF sections */
dwarf_build_psymtabs (objfile,
objfile->section_offsets, mainline,
mainline,
ei.dboffset, ei.dbsize,
ei.lnoffset, ei.lnsize);
}

View File

@ -394,7 +394,6 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
int code;
int ix;
long mem_offset;
struct symbol *sym;
struct type **arg_types;
int save_pos1;
@ -842,10 +841,6 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
int static_memfuncp;
value_ptr temp = arg2;
char tstr[256];
struct fn_field *fns_ptr;
int num_fns;
struct type *basetype;
int boffset;
/* Method invocation : stuff "this" as first parameter */
/* pai: this used to have lookup_pointer_type for some reason,

View File

@ -52,7 +52,9 @@ void handle_sigint PARAMS ((int));
static void handle_sigquit PARAMS ((int));
static void handle_sighup PARAMS ((int));
static void handle_sigfpe PARAMS ((int));
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
static void handle_sigwinch PARAMS ((int));
#endif
/* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT. */
#ifndef STOP_SIGNAL
#ifdef SIGTSTP

View File

@ -315,11 +315,7 @@ exec_file_command (args, from_tty)
char *args;
int from_tty;
{
char **argv;
char *filename;
target_preopen (from_tty);
exec_file_attach (args, from_tty);
}
@ -618,13 +614,21 @@ exec_files_info (t)
struct vmap *vp;
printf_unfiltered ("\tMapping info for file `%s'.\n", vmap->name);
printf_unfiltered ("\t %8.8s %8.8s %8.8s %8.8s %8.8s %s\n",
"tstart", "tend", "dstart", "dend", "section",
printf_unfiltered ("\t %*s %*s %*s %*s %8.8s %s\n",
strlen_paddr (), "tstart",
strlen_paddr (), "tend",
strlen_paddr (), "dstart",
strlen_paddr (), "dend",
"section",
"file(member)");
for (vp = vmap; vp; vp = vp->nxt)
printf_unfiltered ("\t0x%8.8x 0x%8.8x 0x%8.8x 0x%8.8x %s%s%s%s\n",
vp->tstart, vp->tend, vp->dstart, vp->dend, vp->name,
printf_unfiltered ("\t0x%s 0x%s 0x%s 0x%s %s%s%s%s\n",
paddr (vp->tstart),
paddr (vp->tend),
paddr (vp->dstart),
paddr (vp->dend),
vp->name,
*vp->member ? "(" : "", vp->member,
*vp->member ? ")" : "");
}

View File

@ -706,7 +706,7 @@ dump_prefix_expression (exp, stream, note)
int eltsize;
fprintf_filtered (stream, "Dump of expression @ ");
gdb_print_address (exp, stream);
gdb_print_host_address (exp, stream);
fprintf_filtered (stream, ", %s:\nExpression: `", note);
if (exp->elts[0].opcode != OP_TYPE)
print_expression (exp, stream);
@ -831,7 +831,9 @@ dump_subexp (exp, stream, elt)
elt = dump_subexp (exp, stream, elt);
break;
case OP_LONG:
fprintf_filtered (stream, "Type @0x%x (", exp->elts[elt].type);
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, "), value %ld (0x%lx)",
(long) exp->elts[elt + 1].longconst,
@ -839,16 +841,20 @@ dump_subexp (exp, stream, elt)
elt += 3;
break;
case OP_DOUBLE:
fprintf_filtered (stream, "Type @0x%x (", exp->elts[elt].type);
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, "), value %g",
(double) exp->elts[elt + 1].doubleconst);
elt += 3;
break;
case OP_VAR_VALUE:
fprintf_filtered (stream, "Block @0x%x, symbol @0x%x (%s)",
exp->elts[elt].block,
exp->elts[elt + 1].symbol,
fprintf_filtered (stream, "Block @");
gdb_print_host_address (exp->elts[elt].block, stream);
fprintf_filtered (stream, ", symbol @");
gdb_print_host_address (exp->elts[elt + 1].symbol, stream);
fprintf_filtered (stream, " (%s)",
SYMBOL_NAME (exp->elts[elt + 1].symbol));
elt += 3;
break;
@ -863,8 +869,9 @@ dump_subexp (exp, stream, elt)
elt += 2;
break;
case OP_INTERNALVAR:
fprintf_filtered (stream, "Internal var @0x%x (%s)",
exp->elts[elt].internalvar,
fprintf_filtered (stream, "Internal var @");
gdb_print_host_address (exp->elts[elt].internalvar, stream);
fprintf_filtered (stream, " (%s)",
exp->elts[elt].internalvar->name);
elt += 2;
break;
@ -898,15 +905,17 @@ dump_subexp (exp, stream, elt)
break;
case UNOP_MEMVAL:
case UNOP_CAST:
fprintf_filtered (stream, "Type @0x%x (",
exp->elts[elt].type);
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, ")");
elt = dump_subexp (exp, stream, elt + 2);
break;
case OP_TYPE:
fprintf_filtered (stream, "Type @0x%x (",
exp->elts[elt].type);
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, ")");
elt += 2;
@ -929,7 +938,9 @@ dump_subexp (exp, stream, elt)
char *elem_name;
int len;
fprintf_filtered (stream, "Type @0x%x (", exp->elts[elt].type);
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, ") ");
@ -972,7 +983,7 @@ dump_postfix_expression (exp, stream, note)
int elt;
fprintf_filtered (stream, "Dump of expression @ ");
gdb_print_address (exp, stream);
gdb_print_host_address (exp, stream);
fprintf_filtered (stream, ", %s:\nExpression: `", note);
if (exp->elts[0].opcode != OP_TYPE)
print_expression (exp, stream);

View File

@ -431,7 +431,7 @@ f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
}
if (addressprint && format != 's')
fprintf_filtered (stream, "0x%x", addr);
fprintf_filtered (stream, "0x%s", paddr_nz (addr));
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */

View File

@ -328,6 +328,10 @@ extract_floating (addr, len)
else
floatformat_to_doublest (TARGET_LONG_DOUBLE_FORMAT, addr, &dretval);
}
#ifdef TARGET_EXTRACT_FLOATING
else if (TARGET_EXTRACT_FLOATING (addr, len, &dretval))
return dretval;
#endif
else
{
error ("Can't deal with a floating point number of %d bytes.", len);
@ -371,6 +375,10 @@ store_floating (addr, len, val)
else
floatformat_from_doublest (TARGET_LONG_DOUBLE_FORMAT, &val, addr);
}
#ifdef TARGET_STORE_FLOATING
else if (TARGET_STORE_FLOATING (addr, len, val))
return;
#endif
else
{
error ("Can't deal with a floating point number of %d bytes.", len);

View File

@ -1623,11 +1623,11 @@ is_integral_type (t)
CHECK_TYPEDEF (t);
return
((t != NULL)
&& ((TYPE_CODE(t) == TYPE_CODE_INT)
|| (TYPE_CODE(t) == TYPE_CODE_ENUM)
|| (TYPE_CODE(t) == TYPE_CODE_CHAR)
|| (TYPE_CODE(t) == TYPE_CODE_RANGE)
|| (TYPE_CODE(t) == TYPE_CODE_BOOL)));
&& ((TYPE_CODE (t) == TYPE_CODE_INT)
|| (TYPE_CODE (t) == TYPE_CODE_ENUM)
|| (TYPE_CODE (t) == TYPE_CODE_CHAR)
|| (TYPE_CODE (t) == TYPE_CODE_RANGE)
|| (TYPE_CODE (t) == TYPE_CODE_BOOL)));
}
/* Chill varying string and arrays are represented as follows:
@ -1994,9 +1994,7 @@ int
count_virtual_fns (dclass)
struct type *dclass;
{
int base; /* index for base classes */
int fn, oi; /* function and overloaded instance indices */
int vfuncs; /* count to return */
/* recurse on bases that can share virtual table */
@ -2485,7 +2483,7 @@ dump_fn_fieldlists (type, spaces)
struct fn_field *f;
printfi_filtered (spaces, "fn_fieldlists ");
gdb_print_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
gdb_print_host_address (TYPE_FN_FIELDLISTS (type), gdb_stdout);
printf_filtered ("\n");
for (method_idx = 0; method_idx < TYPE_NFN_FIELDS (type); method_idx++)
{
@ -2493,8 +2491,8 @@ dump_fn_fieldlists (type, spaces)
printfi_filtered (spaces + 2, "[%d] name '%s' (",
method_idx,
TYPE_FN_FIELDLIST_NAME (type, method_idx));
gdb_print_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
gdb_stdout);
gdb_print_host_address (TYPE_FN_FIELDLIST_NAME (type, method_idx),
gdb_stdout);
printf_filtered (") length %d\n",
TYPE_FN_FIELDLIST_LENGTH (type, method_idx));
for (overload_idx = 0;
@ -2504,24 +2502,24 @@ dump_fn_fieldlists (type, spaces)
printfi_filtered (spaces + 4, "[%d] physname '%s' (",
overload_idx,
TYPE_FN_FIELD_PHYSNAME (f, overload_idx));
gdb_print_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
gdb_stdout);
gdb_print_host_address (TYPE_FN_FIELD_PHYSNAME (f, overload_idx),
gdb_stdout);
printf_filtered (")\n");
printfi_filtered (spaces + 8, "type ");
gdb_print_address (TYPE_FN_FIELD_TYPE (f, overload_idx), gdb_stdout);
gdb_print_host_address (TYPE_FN_FIELD_TYPE (f, overload_idx), gdb_stdout);
printf_filtered ("\n");
recursive_dump_type (TYPE_FN_FIELD_TYPE (f, overload_idx),
spaces + 8 + 2);
printfi_filtered (spaces + 8, "args ");
gdb_print_address (TYPE_FN_FIELD_ARGS (f, overload_idx), gdb_stdout);
gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx), gdb_stdout);
printf_filtered ("\n");
print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx), spaces);
printfi_filtered (spaces + 8, "fcontext ");
gdb_print_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
gdb_stdout);
gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces + 8, "is_const %d\n",
@ -2555,7 +2553,7 @@ print_cplus_stuff (type, spaces)
{
printfi_filtered (spaces, "virtual_field_bits (%d bits at *",
TYPE_N_BASECLASSES (type));
gdb_print_address (TYPE_FIELD_VIRTUAL_BITS (type), gdb_stdout);
gdb_print_host_address (TYPE_FIELD_VIRTUAL_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_VIRTUAL_BITS (type),
@ -2568,7 +2566,7 @@ print_cplus_stuff (type, spaces)
{
printfi_filtered (spaces, "private_field_bits (%d bits at *",
TYPE_NFIELDS (type));
gdb_print_address (TYPE_FIELD_PRIVATE_BITS (type), gdb_stdout);
gdb_print_host_address (TYPE_FIELD_PRIVATE_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_PRIVATE_BITS (type),
TYPE_NFIELDS (type));
@ -2578,7 +2576,7 @@ print_cplus_stuff (type, spaces)
{
printfi_filtered (spaces, "protected_field_bits (%d bits at *",
TYPE_NFIELDS (type));
gdb_print_address (TYPE_FIELD_PROTECTED_BITS (type), gdb_stdout);
gdb_print_host_address (TYPE_FIELD_PROTECTED_BITS (type), gdb_stdout);
printf_filtered (")");
print_bit_vector (TYPE_FIELD_PROTECTED_BITS (type),
TYPE_NFIELDS (type));
@ -2617,7 +2615,7 @@ recursive_dump_type (type, spaces)
if (type == first_dont_print[i])
{
printfi_filtered (spaces, "type node ");
gdb_print_address (type, gdb_stdout);
gdb_print_host_address (type, gdb_stdout);
printf_filtered (" <same as already seen type>\n");
return;
}
@ -2627,17 +2625,17 @@ recursive_dump_type (type, spaces)
}
printfi_filtered (spaces, "type node ");
gdb_print_address (type, gdb_stdout);
gdb_print_host_address (type, gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "name '%s' (",
TYPE_NAME (type) ? TYPE_NAME (type) : "<NULL>");
gdb_print_address (TYPE_NAME (type), gdb_stdout);
gdb_print_host_address (TYPE_NAME (type), gdb_stdout);
printf_filtered (")\n");
if (TYPE_TAG_NAME (type) != NULL)
{
printfi_filtered (spaces, "tagname '%s' (",
TYPE_TAG_NAME (type));
gdb_print_address (TYPE_TAG_NAME (type), gdb_stdout);
gdb_print_host_address (TYPE_TAG_NAME (type), gdb_stdout);
printf_filtered (")\n");
}
printfi_filtered (spaces, "code 0x%x ", TYPE_CODE (type));
@ -2710,20 +2708,20 @@ recursive_dump_type (type, spaces)
puts_filtered ("\n");
printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
printfi_filtered (spaces, "objfile ");
gdb_print_address (TYPE_OBJFILE (type), gdb_stdout);
gdb_print_host_address (TYPE_OBJFILE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "target_type ");
gdb_print_address (TYPE_TARGET_TYPE (type), gdb_stdout);
gdb_print_host_address (TYPE_TARGET_TYPE (type), gdb_stdout);
printf_filtered ("\n");
if (TYPE_TARGET_TYPE (type) != NULL)
{
recursive_dump_type (TYPE_TARGET_TYPE (type), spaces + 2);
}
printfi_filtered (spaces, "pointer_type ");
gdb_print_address (TYPE_POINTER_TYPE (type), gdb_stdout);
gdb_print_host_address (TYPE_POINTER_TYPE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "reference_type ");
gdb_print_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout);
printf_filtered ("\n");
printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type));
if (TYPE_FLAGS (type) & TYPE_FLAG_UNSIGNED)
@ -2736,7 +2734,7 @@ recursive_dump_type (type, spaces)
}
puts_filtered ("\n");
printfi_filtered (spaces, "nfields %d ", TYPE_NFIELDS (type));
gdb_print_address (TYPE_FIELDS (type), gdb_stdout);
gdb_print_host_address (TYPE_FIELDS (type), gdb_stdout);
puts_filtered ("\n");
for (idx = 0; idx < TYPE_NFIELDS (type); idx++)
{
@ -2744,12 +2742,12 @@ recursive_dump_type (type, spaces)
"[%d] bitpos %d bitsize %d type ",
idx, TYPE_FIELD_BITPOS (type, idx),
TYPE_FIELD_BITSIZE (type, idx));
gdb_print_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout);
gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout);
printf_filtered (" name '%s' (",
TYPE_FIELD_NAME (type, idx) != NULL
? TYPE_FIELD_NAME (type, idx)
: "<NULL>");
gdb_print_address (TYPE_FIELD_NAME (type, idx), gdb_stdout);
gdb_print_host_address (TYPE_FIELD_NAME (type, idx), gdb_stdout);
printf_filtered (")\n");
if (TYPE_FIELD_TYPE (type, idx) != NULL)
{
@ -2757,7 +2755,7 @@ recursive_dump_type (type, spaces)
}
}
printfi_filtered (spaces, "vptr_basetype ");
gdb_print_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
gdb_print_host_address (TYPE_VPTR_BASETYPE (type), gdb_stdout);
puts_filtered ("\n");
if (TYPE_VPTR_BASETYPE (type) != NULL)
{
@ -2769,14 +2767,14 @@ recursive_dump_type (type, spaces)
case TYPE_CODE_METHOD:
case TYPE_CODE_FUNC:
printfi_filtered (spaces, "arg_types ");
gdb_print_address (TYPE_ARG_TYPES (type), gdb_stdout);
gdb_print_host_address (TYPE_ARG_TYPES (type), gdb_stdout);
puts_filtered ("\n");
print_arg_types (TYPE_ARG_TYPES (type), spaces);
break;
case TYPE_CODE_STRUCT:
printfi_filtered (spaces, "cplus_stuff ");
gdb_print_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
gdb_print_host_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
puts_filtered ("\n");
print_cplus_stuff (type, spaces);
break;
@ -2786,7 +2784,7 @@ recursive_dump_type (type, spaces)
the value. Pick cplus_struct_type, even though we know it isn't
any particular one. */
printfi_filtered (spaces, "type_specific ");
gdb_print_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
gdb_print_host_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
if (TYPE_CPLUS_SPECIFIC (type) != NULL)
{
printf_filtered (" (unknown data form)");

View File

@ -45,7 +45,7 @@ void
do_pxdb PARAMS ((bfd *));
void hpread_build_psymtabs
PARAMS ((struct objfile *, struct section_offsets *, int));
PARAMS ((struct objfile *, int));
void hpread_symfile_finish
PARAMS ((struct objfile *));
@ -57,7 +57,7 @@ static unsigned long hpread_get_textlow
PARAMS ((int, int, struct objfile *, int));
static struct partial_symtab *hpread_start_psymtab
PARAMS ((struct objfile *, struct section_offsets *, char *, CORE_ADDR, int,
PARAMS ((struct objfile *, char *, CORE_ADDR, int,
struct partial_symbol **, struct partial_symbol **));
static struct partial_symtab *hpread_end_psymtab
@ -516,7 +516,7 @@ find_next_module_isym (index, qMD, curr_md, pxdb_header_p)
organized in a separate routine, although it does take lots of arguments. pai/1997-10-08 */
static int
scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile, section_offsets)
scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile)
int *curr_pd_p; /* pointer to current proc index */
quick_procedure_entry *qPD; /* the procedure quick lookup table */
int max_procs; /* number of entries in proc. table */
@ -525,7 +525,6 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
struct partial_symtab *pst; /* current psymtab */
char *vt_bits; /* strings table of SOM debug space */
struct objfile *objfile; /* current object file */
struct section_offsets *section_offsets; /* not really used for HP-UX currently */
{
union dnttentry *dn_bufp;
int symbol_count = 0; /* Total number of symbols in this psymtab */
@ -602,7 +601,7 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
LOC_BLOCK, /* "I am a routine" */
&objfile->global_psymbols,
(qPD[curr_pd].adrStart + /* Starting address of rtn */
ANOFFSET (section_offsets, SECT_OFF_TEXT)),
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)),
0, /* core addr?? */
trans_lang ((enum hp_language) qPD[curr_pd].language),
objfile);
@ -615,7 +614,7 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
LOC_BLOCK, /* "I am a routine" */
&objfile->static_psymbols,
(qPD[curr_pd].adrStart + /* Starting address of rtn */
ANOFFSET (section_offsets, SECT_OFF_TEXT)),
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)),
0, /* core addr?? */
trans_lang ((enum hp_language) qPD[curr_pd].language),
objfile);
@ -647,9 +646,8 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
entry for it, so in such cases we create a psymtab for the file. */
int
hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header_p)
hpread_quick_traverse (objfile, gntt_bits, vt_bits, pxdb_header_p)
struct objfile *objfile; /* The object file descriptor */
struct section_offsets *section_offsets; /* ?? Null for HP */
char *gntt_bits; /* GNTT entries, loaded in from the file */
char *vt_bits; /* VT (string) entries ditto. */
PXDB_header_ptr pxdb_header_p; /* Pointer to pxdb header ditto */
@ -862,7 +860,6 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
might help. */
pst = hpread_start_psymtab (objfile,
section_offsets, /* ?? */
mod_name_string,
CURR_MODULE_START, /* Low text address: bogus! */
(CURR_MODULE_ISYM * sizeof (struct dntt_type_block)),
@ -964,7 +961,6 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
And it's not even the right byte offset, as we're using
the size of a union! FIXME! */
pst = hpread_start_psymtab (objfile,
section_offsets, /* ?? */
full_name_string,
start_adr, /* Low text address */
(start_sym * sizeof (struct dntt_type_block)),
@ -980,8 +976,7 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
file, based on the starting addresses. */
syms_in_pst = scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
start_adr, end_adr,
pst, vt_bits, objfile, section_offsets);
start_adr, end_adr, pst, vt_bits, objfile);
/* Get ending symbol offset */
@ -1194,7 +1189,6 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
And it's not even the right byte offset, as we're using
the size of a union! FIXME! */
pst = hpread_start_psymtab (objfile,
section_offsets, /* ?? */
full_name_string,
start_adr, /* Low text address */
(start_sym * sizeof (struct dntt_type_block)),
@ -1210,8 +1204,7 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
module, based on the starting addresses. */
syms_in_pst = scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
start_adr, end_adr,
pst, vt_bits, objfile, section_offsets);
start_adr, end_adr, pst, vt_bits, objfile);
/* Get ending symbol offset */
@ -1308,7 +1301,6 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
}
#endif
pst = hpread_start_psymtab (objfile,
section_offsets, /* ?? */
"orphans",
start_adr, /* Low text address */
(CURR_PROC_ISYM * sizeof (struct dntt_type_block)),
@ -1317,8 +1309,7 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
static_syms);
scan_procs (&curr_pd, qPD, pxdb_header_p->pd_entries,
start_adr, end_adr,
pst, vt_bits, objfile, section_offsets);
start_adr, end_adr, pst, vt_bits, objfile);
pst = hpread_end_psymtab (pst,
NULL, /* psymtab_include_list */
@ -1340,7 +1331,6 @@ hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header
If null psts were kept on the chain, this would be
a solution. FIXME */
pst = hpread_start_psymtab (objfile,
section_offsets,
"globals",
0,
(pxdb_header_p->globals
@ -1578,14 +1568,12 @@ hpread_symfile_init (objfile)
We assume hpread_symfile_init has been called to initialize the
symbol reader's private data structures.
SECTION_OFFSETS contains offsets relative to which the symbols in the
various sections are (depending where the sections were actually loaded).
MAINLINE is true if we are reading the main symbol table (as
opposed to a shared lib or dynamically loaded file). */
void
hpread_build_psymtabs (objfile, section_offsets, mainline)
hpread_build_psymtabs (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
@ -1679,7 +1667,6 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
not found we give up on the quick table stuff,
and fall back on the slower method */
found_modules_in_program = hpread_quick_traverse (objfile,
section_offsets,
GNTT (objfile),
VT (objfile),
&pxdb_header);
@ -1829,8 +1816,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
past_first_source_file = 1;
valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
pst = hpread_start_psymtab (objfile, section_offsets,
valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
pst = hpread_start_psymtab (objfile,
namestring, valu,
(hp_symnum
* sizeof (struct dntt_type_block)),
@ -1863,10 +1850,10 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
/* Now begin a new module and a new psymtab for it */
SET_NAMESTRING (dn_bufp, &namestring, objfile);
valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
if (!pst)
{
pst = hpread_start_psymtab (objfile, section_offsets,
pst = hpread_start_psymtab (objfile,
namestring, valu,
(hp_symnum
* sizeof (struct dntt_type_block)),
@ -1881,12 +1868,12 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
case DNTT_TYPE_ENTRY:
/* The beginning of a function. DNTT_TYPE_ENTRY may also denote
a secondary entry point. */
valu = dn_bufp->dfunc.hiaddr + ANOFFSET (section_offsets,
valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT);
if (valu > texthigh)
texthigh = valu;
valu = dn_bufp->dfunc.lowaddr +
ANOFFSET (section_offsets, SECT_OFF_TEXT);
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
SET_NAMESTRING (dn_bufp, &namestring, objfile);
if (dn_bufp->dfunc.global)
add_psymbol_to_list (namestring, strlen (namestring),
@ -1902,12 +1889,12 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
continue;
case DNTT_TYPE_DOC_FUNCTION:
valu = dn_bufp->ddocfunc.hiaddr + ANOFFSET (section_offsets,
valu = dn_bufp->ddocfunc.hiaddr + ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT);
if (valu > texthigh)
texthigh = valu;
valu = dn_bufp->ddocfunc.lowaddr +
ANOFFSET (section_offsets, SECT_OFF_TEXT);
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
SET_NAMESTRING (dn_bufp, &namestring, objfile);
if (dn_bufp->ddocfunc.global)
add_psymbol_to_list (namestring, strlen (namestring),
@ -1985,7 +1972,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
SET_NAMESTRING (dn_bufp, &namestring, objfile);
if (!pst)
{
pst = hpread_start_psymtab (objfile, section_offsets,
pst = hpread_start_psymtab (objfile,
"globals", 0,
(hp_symnum
* sizeof (struct dntt_type_block)),
@ -1997,7 +1984,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
valu = dn_bufp->dsvar.location;
/* Relocate in case it's in a shared library */
if (storage == LOC_STATIC)
valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
valu += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
/* Luckily, dvar, svar, typedef, and tagdef all
have their "global" bit in the same place, so it works
@ -2069,7 +2056,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
SET_NAMESTRING (dn_bufp, &namestring, objfile);
if (!pst)
{
pst = hpread_start_psymtab (objfile, section_offsets,
pst = hpread_start_psymtab (objfile,
"globals", 0,
(hp_symnum
* sizeof (struct dntt_type_block)),
@ -2212,20 +2199,19 @@ hpread_get_textlow (global, index, objfile, symcount)
(normal). */
static struct partial_symtab *
hpread_start_psymtab (objfile, section_offsets,
hpread_start_psymtab (objfile,
filename, textlow, ldsymoff, global_syms, static_syms)
struct objfile *objfile;
struct section_offsets *section_offsets;
char *filename;
CORE_ADDR textlow;
int ldsymoff;
struct partial_symbol **global_syms;
struct partial_symbol **static_syms;
{
int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
extern void hpread_psymtab_to_symtab ();
struct partial_symtab *result =
start_psymtab_common (objfile, section_offsets,
start_psymtab_common (objfile, objfile->section_offsets,
filename, textlow, global_syms, static_syms);
result->textlow += offset;

View File

@ -419,9 +419,9 @@ static void
read_unwind_info (objfile)
struct objfile *objfile;
{
asection *unwind_sec, *elf_unwind_sec, *stub_unwind_sec;
unsigned unwind_size, elf_unwind_size, stub_unwind_size, total_size;
unsigned index, unwind_entries, elf_unwind_entries;
asection *unwind_sec, *stub_unwind_sec;
unsigned unwind_size, stub_unwind_size, total_size;
unsigned index, unwind_entries;
unsigned stub_entries, total_entries;
CORE_ADDR text_offset;
struct obj_unwind_info *ui;
@ -435,35 +435,32 @@ read_unwind_info (objfile)
ui->cache = NULL;
ui->last = -1;
/* Get hooks to all unwind sections. Note there is no linker-stub unwind
section in ELF at the moment. */
unwind_sec = bfd_get_section_by_name (objfile->obfd, "$UNWIND_START$");
elf_unwind_sec = bfd_get_section_by_name (objfile->obfd, ".PARISC.unwind");
/* For reasons unknown the HP PA64 tools generate multiple unwinder
sections in a single executable. So we just iterate over every
section in the BFD looking for unwinder sections intead of trying
to do a lookup with bfd_get_section_by_name.
First determine the total size of the unwind tables so that we
can allocate memory in a nice big hunk. */
total_entries = 0;
for (unwind_sec = objfile->obfd->sections;
unwind_sec;
unwind_sec = unwind_sec->next)
{
if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0
|| strcmp (unwind_sec->name, ".PARISC.unwind") == 0)
{
unwind_size = bfd_section_size (objfile->obfd, unwind_sec);
unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
total_entries += unwind_entries;
}
}
/* Now compute the size of the stub unwinds. Note the ELF tools do not
use stub unwinds at the curren time. */
stub_unwind_sec = bfd_get_section_by_name (objfile->obfd, "$UNWIND_END$");
/* Get sizes and unwind counts for all sections. */
if (unwind_sec)
{
unwind_size = bfd_section_size (objfile->obfd, unwind_sec);
unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
}
else
{
unwind_size = 0;
unwind_entries = 0;
}
if (elf_unwind_sec)
{
elf_unwind_size = bfd_section_size (objfile->obfd, elf_unwind_sec);
elf_unwind_entries = elf_unwind_size / UNWIND_ENTRY_SIZE;
}
else
{
elf_unwind_size = 0;
elf_unwind_entries = 0;
}
if (stub_unwind_sec)
{
stub_unwind_size = bfd_section_size (objfile->obfd, stub_unwind_sec);
@ -476,7 +473,7 @@ read_unwind_info (objfile)
}
/* Compute total number of unwind entries and their total size. */
total_entries = unwind_entries + elf_unwind_entries + stub_entries;
total_entries += stub_entries;
total_size = total_entries * sizeof (struct unwind_table_entry);
/* Allocate memory for the unwind table. */
@ -484,16 +481,26 @@ read_unwind_info (objfile)
obstack_alloc (&objfile->psymbol_obstack, total_size);
ui->last = total_entries - 1;
/* Internalize the standard unwind entries. */
/* Now read in each unwind section and internalize the standard unwind
entries. */
index = 0;
internalize_unwinds (objfile, &ui->table[index], unwind_sec,
unwind_entries, unwind_size, text_offset);
index += unwind_entries;
internalize_unwinds (objfile, &ui->table[index], elf_unwind_sec,
elf_unwind_entries, elf_unwind_size, text_offset);
index += elf_unwind_entries;
for (unwind_sec = objfile->obfd->sections;
unwind_sec;
unwind_sec = unwind_sec->next)
{
if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0
|| strcmp (unwind_sec->name, ".PARISC.unwind") == 0)
{
unwind_size = bfd_section_size (objfile->obfd, unwind_sec);
unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
/* Now internalize the stub unwind entries. */
internalize_unwinds (objfile, &ui->table[index], unwind_sec,
unwind_entries, unwind_size, text_offset);
index += unwind_entries;
}
}
/* Now read in and internalize the stub unwind entries. */
if (stub_unwind_size > 0)
{
unsigned int i;
@ -3272,7 +3279,7 @@ prologue_inst_adjust_sp (inst)
/* std,ma X,D(sp) */
if ((inst & 0xffe00008) == 0x73c00008)
return (inst & 0x1 ? -1 << 16 : 0) | (((inst >> 4) & 0x3ff) << 3);
return (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3);
/* addil high21,%r1; ldo low11,(%r1),%r30)
save high bits in save_high21 for later use. */
@ -3703,6 +3710,7 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
int status, i, reg;
char buf[4];
int fp_loc = -1;
int final_iteration;
/* Zero out everything. */
memset (frame_saved_regs, '\0', sizeof (struct frame_saved_regs));
@ -3805,7 +3813,9 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
Some unexpected things are expected with debugging optimized code, so
we allow this routine to walk past user instructions in optimized
GCC code. */
while (save_gr || save_fr || save_rp || save_sp || stack_remaining > 0)
final_iteration = 0;
while ((save_gr || save_fr || save_rp || save_sp || stack_remaining > 0)
&& pc <= frame_info->pc)
{
status = target_read_memory (pc, buf, 4);
inst = extract_unsigned_integer (buf, 4);
@ -3853,7 +3863,7 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
CORE_ADDR offset;
if ((inst >> 26) == 0x1c)
offset = (inst & 0x1 ? -1 << 16 : 0) | (((inst >> 4) & 0x3ff) << 3);
offset = (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3);
else if ((inst >> 26) == 0x03)
offset = low_sign_extend (inst & 0x1f, 5);
else
@ -3908,11 +3918,15 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
}
}
/* Quit if we hit any kind of branch. This can happen if a prologue
instruction is in the delay slot of the first call/branch. */
if (is_branch (inst))
/* Quit if we hit any kind of branch the previous iteration.
if (final_iteration)
break;
/* We want to look precisely one instruction beyond the branch
if we have not found everything yet. */
if (is_branch (inst))
final_iteration = 1;
/* Bump the PC. */
pc += 4;
}

View File

@ -159,12 +159,12 @@ static struct type *hpread_read_struct_type
PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
void hpread_build_psymtabs
PARAMS ((struct objfile *, struct section_offsets *, int));
PARAMS ((struct objfile *, int));
void hpread_symfile_finish PARAMS ((struct objfile *));
static struct partial_symtab *hpread_start_psymtab
PARAMS ((struct objfile *, struct section_offsets *, char *, CORE_ADDR, int,
PARAMS ((struct objfile *, char *, CORE_ADDR, int,
struct partial_symbol **, struct partial_symbol **));
static struct partial_symtab *hpread_end_psymtab
@ -305,15 +305,12 @@ hpread_symfile_init (objfile)
We assume hpread_symfile_init has been called to initialize the
symbol reader's private data structures.
SECTION_OFFSETS contains offsets relative to which the symbols in the
various sections are (depending where the sections were actually loaded).
MAINLINE is true if we are reading the main symbol
table (as opposed to a shared lib or dynamically loaded file). */
void
hpread_build_psymtabs (objfile, section_offsets, mainline)
hpread_build_psymtabs (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
char *namestring;
@ -469,8 +466,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
past_first_source_file = 1;
valu = hpread_get_textlow (i, hp_symnum, objfile);
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
pst = hpread_start_psymtab (objfile, section_offsets,
valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
pst = hpread_start_psymtab (objfile,
namestring, valu,
(hp_symnum
* sizeof (struct dntt_type_block)),
@ -487,10 +484,10 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
is supposed to be. */
SET_NAMESTRING (dn_bufp, &namestring, objfile);
valu = hpread_get_textlow (i, hp_symnum, objfile);
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
if (!pst)
{
pst = hpread_start_psymtab (objfile, section_offsets,
pst = hpread_start_psymtab (objfile,
namestring, valu,
(hp_symnum
* sizeof (struct dntt_type_block)),
@ -504,12 +501,12 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
case DNTT_TYPE_ENTRY:
/* The beginning of a function. DNTT_TYPE_ENTRY may also denote
a secondary entry point. */
valu = dn_bufp->dfunc.hiaddr + ANOFFSET (section_offsets,
valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT);
if (valu > texthigh)
texthigh = valu;
valu = dn_bufp->dfunc.lowaddr +
ANOFFSET (section_offsets, SECT_OFF_TEXT);
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
SET_NAMESTRING (dn_bufp, &namestring, objfile);
add_psymbol_to_list (namestring, strlen (namestring),
VAR_NAMESPACE, LOC_BLOCK,
@ -571,7 +568,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
SET_NAMESTRING (dn_bufp, &namestring, objfile);
if (!pst)
{
pst = hpread_start_psymtab (objfile, section_offsets,
pst = hpread_start_psymtab (objfile,
"globals", 0,
(hp_symnum
* sizeof (struct dntt_type_block)),
@ -602,7 +599,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
SET_NAMESTRING (dn_bufp, &namestring, objfile);
if (!pst)
{
pst = hpread_start_psymtab (objfile, section_offsets,
pst = hpread_start_psymtab (objfile,
"globals", 0,
(hp_symnum
* sizeof (struct dntt_type_block)),
@ -826,10 +823,9 @@ hpread_has_name (kind)
(normal). */
static struct partial_symtab *
hpread_start_psymtab (objfile, section_offsets,
filename, textlow, ldsymoff, global_syms, static_syms)
hpread_start_psymtab (objfile, filename, textlow, ldsymoff, global_syms,
static_syms)
struct objfile *objfile;
struct section_offsets *section_offsets;
char *filename;
CORE_ADDR textlow;
int ldsymoff;

379
gdb/i386-linux-nat.c Normal file
View File

@ -0,0 +1,379 @@
/* Native-dependent code for Linux running on i386's, for GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "inferior.h"
#include "gdbcore.h"
/* For i386_linux_skip_solib_resolver */
#include "symtab.h"
#include "frame.h"
#include "symfile.h"
#include "objfiles.h"
#include <sys/ptrace.h>
#include <sys/user.h>
#include <sys/procfs.h>
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
/* This is a duplicate of the table in i386-xdep.c. */
static int regmap[] =
{
EAX, ECX, EDX, EBX,
UESP, EBP, ESI, EDI,
EIP, EFL, CS, SS,
DS, ES, FS, GS,
};
/* FIXME: These routine absolutely depends upon (NUM_REGS - NUM_FREGS)
being less than or equal to the number of registers that can be stored
in a gregset_t. Note that with the current scheme there will typically
be more registers actually stored in a gregset_t that what we know
about. This is bogus and should be fixed. */
/* Given a pointer to a general register set in /proc format (gregset_t *),
unpack the register contents and supply them as gdb's idea of the current
register values. */
void
supply_gregset (gregsetp)
gregset_t *gregsetp;
{
register int regi;
register greg_t *regp = (greg_t *) gregsetp;
for (regi = 0 ; regi < (NUM_REGS - NUM_FREGS) ; regi++)
{
supply_register (regi, (char *) (regp + regmap[regi]));
}
}
void
fill_gregset (gregsetp, regno)
gregset_t *gregsetp;
int regno;
{
int regi;
register greg_t *regp = (greg_t *) gregsetp;
for (regi = 0 ; regi < (NUM_REGS - NUM_FREGS) ; regi++)
{
if ((regno == -1) || (regno == regi))
{
*(regp + regmap[regi]) = *(int *) &registers[REGISTER_BYTE (regi)];
}
}
}
/* Given a pointer to a floating point register set in (fpregset_t *)
format, unpack the register contents and supply them as gdb's
idea of the current floating point register values. */
void
supply_fpregset (fpregsetp)
fpregset_t *fpregsetp;
{
register int regi;
char *from;
from = (char *) &(fpregsetp->st_space[0]);
for (regi = FPSTART_REGNUM ; regi <= FPEND_REGNUM ; regi++)
{
supply_register(regi, from);
from += REGISTER_RAW_SIZE(regi);
}
}
/* Given a pointer to a floating point register set in (fpregset_t *)
format, update all of the registers from gdb's idea
of the current floating point register set. */
void
fill_fpregset (fpregsetp, regno)
fpregset_t *fpregsetp;
int regno;
{
int regi;
char *to;
char *from;
to = (char *) &(fpregsetp->st_space[0]);
for (regi = FPSTART_REGNUM ; regi <= FPEND_REGNUM ; regi++)
{
from = (char *) &registers[REGISTER_BYTE (regi)];
memcpy (to, from, REGISTER_RAW_SIZE (regi));
to += REGISTER_RAW_SIZE(regi);
}
}
/*
Get the whole floating point state of the process and
store the floating point stack into registers[].
*/
static void
fetch_fpregs(void)
{
int ret, regno;
char buf[FPREG_BYTES];
ret = ptrace (PTRACE_GETFPREGS, inferior_pid, 0, (int)buf);
if ( ret < 0 )
{
warning ("Couldn't get floating point status");
return;
}
for ( regno = 0; regno < NUM_FREGS; regno++ )
{
if ( regno < 7 )
supply_register (NUM_REGS-NUM_FREGS+regno, buf + regno*4);
else
supply_register (NUM_REGS-NUM_FREGS+regno,
buf + FPENV_BYTES + (regno-7)*FPREG_RAW_SIZE);
}
}
/*
Get the whole floating point state of the process and
replace the contents from registers[].
*/
static void
store_fpregs(void)
{
int ret, regno;
char buf[FPREG_BYTES];
ret = ptrace (PTRACE_GETFPREGS, inferior_pid, 0, (int)buf);
if ( ret < 0 )
{
warning ("Couldn't get floating point status");
return;
}
for ( regno = 0; regno < NUM_FREGS; regno++ )
{
if ( register_valid[regno] )
{
if ( regno < 7 )
{
read_register_gen (NUM_REGS-NUM_FREGS+regno,
buf + regno*4);
}
else
{
read_register_gen (NUM_REGS-NUM_FREGS+regno,
buf + FPENV_BYTES + (regno-7)*FPREG_RAW_SIZE);
}
}
}
ret = ptrace (PTRACE_SETFPREGS, inferior_pid, 0, (int)buf);
if ( ret < 0 )
{
warning ("Couldn't write floating point status");
return;
}
}
/*
Get state of all non-fp registers of the process and
store into registers[].
*/
static void
fetch_regs(void)
{
int ret, regno;
char buf[17*sizeof(unsigned int)];
ret = ptrace (PTRACE_GETREGS, inferior_pid, 0, (int)buf);
if ( ret < 0 )
{
warning ("Couldn't get registers");
return;
}
for ( regno = 0; regno < NUM_REGS-NUM_FREGS; regno++ )
supply_register (regno, buf + register_addr (regno, U_REGS_OFFSET));
}
/*
Get the whole non-floating-point register state of the process and
replace them in the process from registers[].
*/
static void
store_regs(void)
{
int ret, regno;
char buf[17*sizeof(unsigned int)];
ret = ptrace (PTRACE_GETREGS, inferior_pid, 0, (int)buf);
if ( ret < 0 )
{
warning ("Couldn't get registers");
return;
}
for ( regno = 0; regno < NUM_REGS-NUM_FREGS; regno++ )
{
if ( register_valid[regno] )
read_register_gen (regno, buf + register_addr (regno, U_REGS_OFFSET));
}
ret = ptrace (PTRACE_SETREGS, inferior_pid, 0, (int)buf);
if ( ret < 0 )
{
warning ("Couldn't write floating point status");
return;
}
}
/* Fetch registers from the child process.
Fetch all if regno == -1, otherwise fetch all ordinary
registers or all floating point registers depending
upon the value of regno. */
void
fetch_inferior_registers (regno)
int regno;
{
if ( (regno < NUM_REGS - NUM_FREGS) || (regno == -1) )
fetch_regs();
if ( (regno >= NUM_REGS - NUM_FREGS) || (regno == -1) )
fetch_fpregs();
}
/* Store our register values back into the inferior.
If REGNO is -1, do this for all registers.
Otherwise, REGNO specifies which register, which
then determines whether we store all ordinary
registers or all of the floating point registers. */
void
store_inferior_registers (regno)
int regno;
{
if ( (regno < NUM_REGS - NUM_FREGS) || (regno == -1) )
store_regs();
if ( (regno >= NUM_REGS - NUM_FREGS) || (regno == -1) )
store_fpregs();
}
/* Find the minimal symbol named NAME, and return both the minsym
struct and its objfile. This probably ought to be in minsym.c, but
everything there is trying to deal with things like C++ and
SOFUN_ADDRESS_MAYBE_TURQUOISE, ... Since this is so simple, it may
be considered too special-purpose for general consumption. */
static struct minimal_symbol *
find_minsym_and_objfile (char *name, struct objfile **objfile_p)
{
struct objfile *objfile;
ALL_OBJFILES (objfile)
{
struct minimal_symbol *msym;
ALL_OBJFILE_MSYMBOLS (objfile, msym)
{
if (SYMBOL_NAME (msym)
&& STREQ (SYMBOL_NAME (msym), name))
{
*objfile_p = objfile;
return msym;
}
}
}
return 0;
}
static CORE_ADDR
skip_hurd_resolver (CORE_ADDR pc)
{
/* The HURD dynamic linker is part of the GNU C library, so many
GNU/Linux distributions use it. (All ELF versions, as far as I
know.) An unresolved PLT entry points to "_dl_runtime_resolve",
which calls "fixup" to patch the PLT, and then passes control to
the function.
We look for the symbol `_dl_runtime_resolve', and find `fixup' in
the same objfile. If we are at the entry point of `fixup', then
we set a breakpoint at the return address (at the top of the
stack), and continue.
It's kind of gross to do all these checks every time we're
called, since they don't change once the executable has gotten
started. But this is only a temporary hack --- upcoming versions
of Linux will provide a portable, efficient interface for
debugging programs that use shared libraries. */
struct objfile *objfile;
struct minimal_symbol *resolver
= find_minsym_and_objfile ("_dl_runtime_resolve", &objfile);
if (resolver)
{
struct minimal_symbol *fixup
= lookup_minimal_symbol ("fixup", 0, objfile);
if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc)
return (SAVED_PC_AFTER_CALL (get_current_frame ()));
}
return 0;
}
/* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c.
This function:
1) decides whether a PLT has sent us into the linker to resolve
a function reference, and
2) if so, tells us where to set a temporary breakpoint that will
trigger when the dynamic linker is done. */
CORE_ADDR
i386_linux_skip_solib_resolver (CORE_ADDR pc)
{
CORE_ADDR result;
/* Plug in functions for other kinds of resolvers here. */
result = skip_hurd_resolver (pc);
if (result)
return result;
return 0;
}

View File

@ -43,7 +43,6 @@
* It should use the same privilege level it runs at. It should
* install it as an interrupt gate so that interrupts are masked
* while the handler runs.
* Also, need to assign exceptionHook and oldExceptionHook.
*
* Because gdb will sometimes write to the stack area to execute function
* calls, this program cannot rely on using the supervisor stack so it
@ -97,14 +96,10 @@
*
* external low-level support routines
*/
typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
typedef void (*Function)(); /* pointer to a function */
extern void putDebugChar(); /* write a single character */
extern int getDebugChar(); /* read and return a single char */
extern Function exceptionHandler(); /* assign an exception handler */
extern ExceptionHook exceptionHook; /* hook variable for errors/exceptions */
extern void exceptionHandler(); /* assign an exception handler */
/************************************************************************/
/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
@ -138,14 +133,6 @@ int registers[NUMREGS];
int remcomStack[STACKSIZE/sizeof(int)];
static int* stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
/*
* In many cases, the system will want to continue exception processing
* when a continue command is given.
* oldExceptionHook is a function to invoke in this case.
*/
static ExceptionHook oldExceptionHook;
/*************************** ASSEMBLY CODE MACROS *************************/
/* */
@ -456,12 +443,15 @@ char ch;
return (-1);
}
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/* scan for the sequence $<data>#<checksum> */
unsigned char *
getpacket (buffer)
unsigned char *buffer;
getpacket ()
{
unsigned char *buffer = &remcomInBuffer[0];
unsigned char checksum;
unsigned char xmitcsum;
int count;
@ -557,11 +547,6 @@ void putpacket(buffer)
}
char remcomInBuffer[BUFMAX];
char remcomOutBuffer[BUFMAX];
static short error;
void debug_error(format, parm)
char * format;
char * parm;
@ -739,9 +724,8 @@ void handle_exception(int exceptionVector)
stepping = 0;
while (1==1) {
error = 0;
remcomOutBuffer[0] = 0;
ptr = getpacket(remcomInBuffer);
ptr = getpacket();
switch (*ptr++) {
case '?' : remcomOutBuffer[0] = 'S';
@ -839,25 +823,7 @@ void handle_exception(int exceptionVector)
/* set the trace bit if we're stepping */
if (stepping) registers[ PS ] |= 0x100;
/*
* If we found a match for the PC AND we are not returning
* as a result of a breakpoint (33),
* trace exception (9), nmi (31), jmp to
* the old exception handler as if this code never ran.
*/
#if 0
/* Don't really think we need this, except maybe for protection
exceptions. */
/*
* invoke the previous handler.
*/
if (oldExceptionHook)
(*oldExceptionHook) (frame->exceptionVector);
newPC = registers[ PC ]; /* pc may have changed */
#endif /* 0 */
_returnFromException(); /* this is a jump */
break;
/* kill the program */
@ -900,12 +866,6 @@ int exception;
exceptionHandler (14, _catchException14);
exceptionHandler (16, _catchException16);
if (exceptionHook != remcomHandler)
{
oldExceptionHook = exceptionHook;
exceptionHook = remcomHandler;
}
initialized = 1;
}

View File

@ -58,9 +58,11 @@ static char *valid_flavors[] =
};
static char *disassembly_flavor = att_flavor;
static void i386_print_register PARAMS ((char *, int, int));
/* This is used to keep the bfd arch_info in sync with the disassembly flavor. */
static void set_disassembly_flavor_sfunc PARAMS ((char *, int, struct cmd_list_element *));
static void set_disassembly_flavor ();
static void set_disassembly_flavor PARAMS ((void));
/* Stdio style buffering was used to minimize calls to ptrace, but this
buffering did not take into account that the code section being accessed
@ -674,21 +676,38 @@ i386_extract_return_value (type, regbuf, valbuf)
char regbuf[REGISTER_BYTES];
char *valbuf;
{
/* On AIX, floating point values are returned in floating point registers. */
#ifdef I386_AIX_TARGET
/* On AIX and i386 GNU/Linux, floating point values are returned in
floating point registers. */
#if defined(I386_AIX_TARGET) || defined(I386_GNULINUX_TARGET)
if (TYPE_CODE_FLT == TYPE_CODE (type))
{
double d;
/* 387 %st(0), gcc uses this */
floatformat_to_double (&floatformat_i387_ext,
&regbuf[REGISTER_BYTE (FP0_REGNUM)],
&regbuf[REGISTER_BYTE(FPDATA_REGNUM)],
&d);
store_floating (valbuf, TYPE_LENGTH (type), d);
}
else
#endif /* I386_AIX_TARGET */
#endif /* I386_AIX_TARGET || I386_GNULINUX_TARGET*/
{
memcpy (valbuf, regbuf, TYPE_LENGTH (type));
int len = TYPE_LENGTH (type);
int low_size = REGISTER_RAW_SIZE (LOW_RETURN_REGNUM);
int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM);
if (len <= low_size)
memcpy (valbuf, regbuf + REGISTER_BYTE (LOW_RETURN_REGNUM), len);
else if (len <= (low_size + high_size))
{
memcpy (valbuf,
regbuf + REGISTER_BYTE (LOW_RETURN_REGNUM),
low_size);
memcpy (valbuf + low_size,
regbuf + REGISTER_BYTE (HIGH_RETURN_REGNUM),
len - low_size);
}
else
error ("GDB bug: i386-tdep.c (i386_extract_return_value): Don't know how to find a return value %d bytes long", len);
}
}
@ -942,6 +961,51 @@ set_disassembly_flavor ()
set_architecture_from_arch_mach (bfd_arch_i386, bfd_mach_i386_i386_intel_syntax);
}
/* Print the register regnum, or all registers if regnum is -1 */
void
i386_do_registers_info (regnum, fpregs)
int regnum;
int fpregs;
{
char raw_regs [REGISTER_BYTES];
int i;
for (i = 0; i < NUM_REGS; i++)
read_relative_register_raw_bytes (i, raw_regs + REGISTER_BYTE (i));
if (regnum < FPSTART_REGNUM)
i386_print_register (raw_regs, regnum, fpregs);
else
i387_print_register (raw_regs, regnum);
}
static void
i386_print_register (raw_regs, regnum, fpregs)
char *raw_regs;
int regnum;
int fpregs;
{
int i;
long val;
char string[12];
for (i = 0; i < FPSTART_REGNUM; i++)
{
if ((regnum != -1) && (i != regnum))
continue;
val = extract_signed_integer (raw_regs + REGISTER_BYTE (i), 4);
sprintf(string, "0x%x", val);
printf_filtered ("%8.8s: %10.10s %11d\n", REGISTER_NAME(i), string, val);
}
if ((regnum == -1) && fpregs)
for (i = FPSTART_REGNUM; i < FPEND_REGNUM; i++)
i387_print_register (raw_regs, i);
}
void
_initialize_i386_tdep ()
{

View File

@ -22,13 +22,16 @@
#include "frame.h"
#include "inferior.h"
#include "language.h"
#include "value.h"
#include "gdbcore.h"
#include "floatformat.h"
void i387_to_double PARAMS ((char *, char *));
void double_to_i387 PARAMS ((char *, char *));
static void print_387_control_bits PARAMS ((unsigned int control));
static void print_387_status_bits PARAMS ((unsigned int status));
/* FIXME: Eliminate these routines when we have the time to change all
the callers. */
@ -48,95 +51,281 @@ double_to_i387 (from, to)
floatformat_from_double (&floatformat_i387_ext, (double *) from, to);
}
void
print_387_control_word (control)
static void
print_387_control_bits (control)
unsigned int control;
{
printf_unfiltered ("control %s: ", local_hex_string (control));
printf_unfiltered ("compute to ");
switch ((control >> 8) & 3)
{
case 0:
printf_unfiltered ("24 bits; ");
puts_unfiltered (" 24 bit; ");
break;
case 1:
printf_unfiltered ("(bad); ");
puts_unfiltered (" (bad); ");
break;
case 2:
printf_unfiltered ("53 bits; ");
puts_unfiltered (" 53 bit; ");
break;
case 3:
printf_unfiltered ("64 bits; ");
puts_unfiltered (" 64 bit; ");
break;
}
printf_unfiltered ("round ");
switch ((control >> 10) & 3)
{
case 0:
printf_unfiltered ("NEAREST; ");
puts_unfiltered ("NEAR; ");
break;
case 1:
printf_unfiltered ("DOWN; ");
puts_unfiltered ("DOWN; ");
break;
case 2:
printf_unfiltered ("UP; ");
puts_unfiltered ("UP; ");
break;
case 3:
printf_unfiltered ("CHOP; ");
puts_unfiltered ("CHOP; ");
break;
}
if (control & 0x3f)
{
printf_unfiltered ("mask:");
puts_unfiltered ("mask");
if (control & 0x0001)
printf_unfiltered (" INVALID");
puts_unfiltered (" INVAL");
if (control & 0x0002)
printf_unfiltered (" DENORM");
puts_unfiltered (" DENOR");
if (control & 0x0004)
printf_unfiltered (" DIVZ");
puts_unfiltered (" DIVZ");
if (control & 0x0008)
printf_unfiltered (" OVERF");
puts_unfiltered (" OVERF");
if (control & 0x0010)
printf_unfiltered (" UNDERF");
puts_unfiltered (" UNDER");
if (control & 0x0020)
printf_unfiltered (" LOS");
printf_unfiltered (";");
puts_unfiltered (" LOS");
puts_unfiltered (";");
}
printf_unfiltered ("\n");
if (control & 0xe080)
warning ("reserved bits on: %s\n",
warning ("\nreserved bits on: %s",
local_hex_string (control & 0xe080));
}
void
print_387_control_word (control)
unsigned int control;
{
printf_filtered ("control %s:", local_hex_string(control & 0xffff));
print_387_control_bits (control);
puts_unfiltered ("\n");
}
static void
print_387_status_bits (status)
unsigned int status;
{
printf_unfiltered (" flags %d%d%d%d; ",
(status & 0x4000) != 0,
(status & 0x0400) != 0,
(status & 0x0200) != 0,
(status & 0x0100) != 0);
printf_unfiltered ("top %d; ", (status >> 11) & 7);
if (status & 0xff)
{
puts_unfiltered ("excep");
if (status & 0x0001) puts_unfiltered (" INVAL");
if (status & 0x0002) puts_unfiltered (" DENOR");
if (status & 0x0004) puts_unfiltered (" DIVZ");
if (status & 0x0008) puts_unfiltered (" OVERF");
if (status & 0x0010) puts_unfiltered (" UNDER");
if (status & 0x0020) puts_unfiltered (" LOS");
if (status & 0x0040) puts_unfiltered (" STACK");
}
}
void
print_387_status_word (status)
unsigned int status;
{
printf_unfiltered ("status %s: ", local_hex_string (status));
if (status & 0xff)
{
printf_unfiltered ("exceptions:");
if (status & 0x0001)
printf_unfiltered (" INVALID");
if (status & 0x0002)
printf_unfiltered (" DENORM");
if (status & 0x0004)
printf_unfiltered (" DIVZ");
if (status & 0x0008)
printf_unfiltered (" OVERF");
if (status & 0x0010)
printf_unfiltered (" UNDERF");
if (status & 0x0020)
printf_unfiltered (" LOS");
if (status & 0x0040)
printf_unfiltered (" FPSTACK");
printf_unfiltered ("; ");
}
printf_unfiltered ("flags: %d%d%d%d; ",
(status & 0x4000) != 0,
(status & 0x0400) != 0,
(status & 0x0200) != 0,
(status & 0x0100) != 0);
printf_unfiltered ("top %d\n", (status >> 11) & 7);
printf_filtered ("status %s:", local_hex_string (status & 0xffff));
print_387_status_bits (status);
puts_unfiltered ("\n");
}
void
i387_print_register (raw_regs, regnum)
char *raw_regs;
int regnum;
{
unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
unsigned long val;
int j, sign, special;
unsigned swd, tags, expon, top, norm, ls, ms;
char string[12];
#if (FPREG_RAW_SIZE != 10)
#error "Bad FPREG_RAW_SIZE"
#endif
printf_filtered ("%8.8s: ", REGISTER_NAME (regnum));
if (regnum < FPDATA_REGNUM)
{
val = extract_unsigned_integer (raw_regs + REGISTER_BYTE (regnum), 4);
if ( (regnum < FPSTART_REGNUM + 3) ||
(regnum == FPSTART_REGNUM + 6) )
/* Don't print the un-modifiable bytes. */
sprintf(string, "0x%04x", val & 0xffff);
else
sprintf(string, "0x%08x", val);
printf_unfiltered ("%10.10s", string);
if (regnum == FPCONTROL_REGNUM)
print_387_control_bits (val);
else if (regnum == FPSTATUS_REGNUM)
print_387_status_bits (val);
}
else
{
/* An FPU stack register. */
if ( REGISTER_RAW_SIZE (regnum) != FPREG_RAW_SIZE )
error ("GDB bug: i387-tdep.c (i387_print_register): wrong size for FPU stack register");
/* Put the data in the buffer. No conversions are ever necessary. */
memcpy (virtual_buffer, raw_regs + REGISTER_BYTE (regnum),
FPREG_RAW_SIZE);
swd = extract_signed_integer (raw_regs + REGISTER_BYTE (FPSTATUS_REGNUM),
4);
top = (swd >> 11) & 7;
tags = extract_signed_integer (raw_regs + REGISTER_BYTE (FPTAG_REGNUM),
4);
puts_unfiltered ("0x");
for (j = 0; j < FPREG_RAW_SIZE; j++)
printf_unfiltered ("%02x",
(unsigned char)raw_regs[REGISTER_BYTE (regnum)
+ FPREG_RAW_SIZE - 1 - j]);
puts_unfiltered (" ");
special = 0;
switch ((tags >> (((regnum - FPDATA_REGNUM + top) & 7) * 2)) & 3)
{
case 0: puts_unfiltered ("Valid "); break;
case 1: puts_unfiltered ("Zero "); break;
case 2: puts_unfiltered ("Spec ");
special = 1;
break;
case 3: puts_unfiltered ("Empty "); break;
}
expon = extract_unsigned_integer (raw_regs + REGISTER_BYTE (regnum)
+ FPREG_RAW_SIZE - 2, 2);
sign = expon & 0x8000;
expon &= 0x7fff;
ms = extract_unsigned_integer (raw_regs + REGISTER_BYTE (regnum) + 4, 4);
ls = extract_signed_integer (raw_regs + REGISTER_BYTE (regnum), 4);
norm = ms & 0x80000000;
if ( expon == 0 )
{
if ( ms | ls )
{
/* Denormal or Pseudodenormal. */
if ( norm )
puts_unfiltered ("Pseudo ");
else
puts_unfiltered ("Denorm ");
}
else
{
/* Zero. */
puts_unfiltered ("Zero ");
}
}
else if ( expon == 0x7fff )
{
/* Infinity, NaN or unsupported. */
if ( (ms == 0x80000000) &&
(ls == 0) )
{
puts_unfiltered ("Infty ");
}
else if ( norm )
{
if ( ms & 0x40000000 )
puts_unfiltered ("QNaN ");
else
puts_unfiltered ("SNaN ");
}
else
{
puts_unfiltered ("Unsupp ");
}
}
else
{
/* Normal or unsupported. */
if ( norm )
puts_unfiltered ("Normal ");
else
puts_unfiltered ("Unsupp ");
}
val_print (REGISTER_VIRTUAL_TYPE (regnum), virtual_buffer, 0, 0,
gdb_stdout, 0,
1, 0, Val_pretty_default);
}
puts_filtered ("\n");
}
void i387_float_info(void)
{
char raw_regs [REGISTER_BYTES];
int i;
for (i = FPSTART_REGNUM; i <= FPEND_REGNUM; i++)
read_relative_register_raw_bytes (i, raw_regs + REGISTER_BYTE (i));
for (i = FPSTART_REGNUM; i <= FPEND_REGNUM; i++)
i387_print_register (raw_regs, i);
}
#ifdef LD_I387
int
i387_extract_floating (PTR addr, int len, DOUBLEST *dretptr)
{
if (len == TARGET_LONG_DOUBLE_BIT / 8)
{
if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
{
DOUBLEST retval;
memcpy (dretptr, addr, sizeof (retval));
}
else
floatformat_to_doublest (TARGET_LONG_DOUBLE_FORMAT, addr, dretptr);
return 1;
}
else
return 0;
}
int
i387_store_floating (PTR addr, int len, DOUBLEST val)
{
if (len == TARGET_LONG_DOUBLE_BIT / 8)
{
/* This `if' may be totally stupid. I just put it in here to be
absolutely sure I'm preserving the semantics of the code I'm
frobbing, while I try to maintain portability boundaries; I
don't actually know exactly what it's doing. -JimB, May 1999 */
if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
memcpy (addr, &val, sizeof (val));
else
floatformat_from_doublest (TARGET_LONG_DOUBLE_FORMAT, &val, addr);
return 1;
}
else
return 0;
}
#endif /* LD_I387 */

View File

@ -567,7 +567,7 @@ saved_pc_after_call (frame)
restoring all saved registers. */
void
pop_frame ()
i960_pop_frame (void)
{
register struct frame_info *current_fi, *prev_fi;
register int i;

View File

@ -258,6 +258,12 @@ extern int signal_print_state PARAMS ((int));
extern int signal_pass_state PARAMS ((int));
extern int signal_stop_update PARAMS ((int, int));
extern int signal_print_update PARAMS ((int, int));
extern int signal_pass_update PARAMS ((int, int));
/* From infcmd.c */
extern void tty_command PARAMS ((char *, int));

View File

@ -176,15 +176,53 @@ static int use_thread_step_needed = USE_THREAD_STEP_NEEDED;
#define DYNAMIC_TRAMPOLINE_NEXTPC(pc) 0
#endif
/* On SVR4 based systems, determining the callee's address is exceedingly
difficult and depends on the implementation of the run time loader.
If we are stepping at the source level, we single step until we exit
the run time loader code and reach the callee's address. */
/* If the program uses ELF-style shared libraries, then calls to
functions in shared libraries go through stubs, which live in a
table called the PLT (Procedure Linkage Table). The first time the
function is called, the stub sends control to the dynamic linker,
which looks up the function's real address, patches the stub so
that future calls will go directly to the function, and then passes
control to the function.
If we are stepping at the source level, we don't want to see any of
this --- we just want to skip over the stub and the dynamic linker.
The simple approach is to single-step until control leaves the
dynamic linker.
However, on some systems (e.g., Red Hat Linux 5.2) the dynamic
linker calls functions in the shared C library, so you can't tell
from the PC alone whether the dynamic linker is still running. In
this case, we use a step-resume breakpoint to get us past the
dynamic linker, as if we were using "next" to step over a function
call.
IN_SOLIB_DYNSYM_RESOLVE_CODE says whether we're in the dynamic
linker code or not. Normally, this means we single-step. However,
if SKIP_SOLIB_RESOLVER then returns non-zero, then its value is an
address where we can place a step-resume breakpoint to get past the
linker's symbol resolution function.
IN_SOLIB_DYNSYM_RESOLVE_CODE can generally be implemented in a
pretty portable way, by comparing the PC against the address ranges
of the dynamic linker's sections.
SKIP_SOLIB_RESOLVER is generally going to be system-specific, since
it depends on internal details of the dynamic linker. It's usually
not too hard to figure out where to put a breakpoint, but it
certainly isn't portable. SKIP_SOLIB_RESOLVER should do plenty of
sanity checking. If it can't figure things out, returning zero and
getting the (possibly confusing) stepping behavior is better than
signalling an error, which will obscure the change in the
inferior's state. */
#ifndef IN_SOLIB_DYNSYM_RESOLVE_CODE
#define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) 0
#endif
#ifndef SKIP_SOLIB_RESOLVER
#define SKIP_SOLIB_RESOLVER(pc) 0
#endif
/* For SVR4 shared libraries, each call goes through a small piece of
trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
to nonzero if we are current stopped in one of these. */
@ -1137,8 +1175,10 @@ void init_execution_control_state (struct execution_control_state * ecs);
void handle_inferior_event (struct execution_control_state * ecs);
static void check_sigtramp2 (struct execution_control_state *ecs);
static void step_over_function (struct execution_control_state *ecs);
static void stop_stepping (struct execution_control_state *ecs);
static void prepare_to_wait (struct execution_control_state *ecs);
static void keep_going (struct execution_control_state *ecs);
/* Wait for control to return from inferior to debugger.
If inferior gets a signal, we may decide to start it up again
@ -2108,15 +2148,17 @@ handle_inferior_event (struct execution_control_state *ecs)
{
trap_expected = 1;
stop_signal = TARGET_SIGNAL_0;
goto keep_going;
keep_going (ecs);
return;
}
}
else if (ecs->ws.kind == TARGET_WAITKIND_VFORKED)
{
if (ecs->random_signal) /* I.e., no catchpoint triggered for this. */
{
stop_signal = TARGET_SIGNAL_0;
goto keep_going;
stop_signal = TARGET_SIGNAL_0;
keep_going (ecs);
return;
}
}
else if (ecs->ws.kind == TARGET_WAITKIND_EXECD)
@ -2126,7 +2168,8 @@ handle_inferior_event (struct execution_control_state *ecs)
{
trap_expected = 1;
stop_signal = TARGET_SIGNAL_0;
goto keep_going;
keep_going (ecs);
return;
}
}
@ -2182,7 +2225,7 @@ handle_inferior_event (struct execution_control_state *ecs)
that case, when we reach this point, there is already a
step-resume breakpoint established, right where it should be:
immediately after the function call the user is "next"-ing
over. If we jump to step_over_function now, two bad things
over. If we call step_over_function now, two bad things
happen:
- we'll create a new breakpoint, at wherever the current
@ -2230,7 +2273,10 @@ handle_inferior_event (struct execution_control_state *ecs)
remove_breakpoints ();
breakpoints_inserted = 0;
if (!GET_LONGJMP_TARGET (&jmp_buf_pc))
goto keep_going;
{
keep_going (ecs);
return;
}
/* Need to blow away step-resume breakpoint, as it
interferes with us */
@ -2256,7 +2302,8 @@ handle_inferior_event (struct execution_control_state *ecs)
#endif /* 0 */
set_longjmp_resume_breakpoint (jmp_buf_pc, NULL);
ecs->handling_longjmp = 1; /* FIXME */
goto keep_going;
keep_going (ecs);
return;
case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME:
case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE:
@ -2269,7 +2316,8 @@ handle_inferior_event (struct execution_control_state *ecs)
step_frame_address)))
{
ecs->another_trap = 1;
goto keep_going;
keep_going (ecs);
return;
}
#endif /* 0 */
disable_longjmp_breakpoint ();
@ -2452,7 +2500,8 @@ handle_inferior_event (struct execution_control_state *ecs)
if (SOLIB_IN_DYNAMIC_LINKER (ecs->pid, stop_pc))
{
ecs->another_trap = 1;
goto keep_going;
keep_going (ecs);
return;
}
#endif
/* Else, stop and report the catchpoint(s) whose triggering
@ -2499,7 +2548,8 @@ handle_inferior_event (struct execution_control_state *ecs)
/* I'm not sure whether this needs to be check_sigtramp2 or
whether it could/should be keep_going. */
check_sigtramp2 (ecs);
goto keep_going;
keep_going (ecs);
return;
}
if (step_range_end == 0)
@ -2508,7 +2558,8 @@ handle_inferior_event (struct execution_control_state *ecs)
/* I'm not sure whether this needs to be check_sigtramp2 or
whether it could/should be keep_going. */
check_sigtramp2 (ecs);
goto keep_going;
keep_going (ecs);
return;
}
/* If stepping through a line, keep going if still within it.
@ -2522,7 +2573,8 @@ handle_inferior_event (struct execution_control_state *ecs)
/* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal.
So definately need to check for sigtramp here. */
check_sigtramp2 (ecs);
goto keep_going;
keep_going (ecs);
return;
}
/* We stepped out of the stepping range. */
@ -2532,7 +2584,27 @@ handle_inferior_event (struct execution_control_state *ecs)
until we exit the run time loader code and reach the callee's
address. */
if (step_over_calls < 0 && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
goto keep_going;
{
CORE_ADDR pc_after_resolver = SKIP_SOLIB_RESOLVER (stop_pc);
if (pc_after_resolver)
{
/* Set up a step-resume breakpoint at the address
indicated by SKIP_SOLIB_RESOLVER. */
struct symtab_and_line sr_sal;
INIT_SAL (&sr_sal);
sr_sal.pc = pc_after_resolver;
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
if (breakpoints_inserted)
insert_breakpoints ();
}
keep_going (ecs);
return;
}
/* We can't update step_sp every time through the loop, because
reading the stack pointer would slow down stepping too much.
@ -2591,7 +2663,7 @@ handle_inferior_event (struct execution_control_state *ecs)
/* We just stepped out of a signal handler and into
its calling trampoline.
Normally, we'd jump to step_over_function from
Normally, we'd call step_over_function from
here, but for some reason GDB can't unwind the
stack correctly to find the real PC for the point
user code where the signal trampoline will return
@ -2620,7 +2692,8 @@ handle_inferior_event (struct execution_control_state *ecs)
step_range_end = (step_range_start = prev_pc) + 1;
ecs->remove_breakpoints_on_following_step = 1;
goto keep_going;
keep_going (ecs);
return;
}
if (stop_pc == ecs->stop_func_start /* Quick test */
@ -2642,8 +2715,12 @@ handle_inferior_event (struct execution_control_state *ecs)
}
if (step_over_calls > 0 || IGNORE_HELPER_CALL (stop_pc))
/* We're doing a "next". */
goto step_over_function;
{
/* We're doing a "next". */
step_over_function (ecs);
keep_going (ecs);
return;
}
/* If we are in a function call trampoline (a stub between
the calling routine and the real function), locate the real
@ -2668,7 +2745,8 @@ handle_inferior_event (struct execution_control_state *ecs)
step_resume_breakpoint =
set_momentary_breakpoint (xxx, NULL, bp_step_resume);
insert_breakpoints ();
goto keep_going;
keep_going (ecs);
return;
}
}
@ -2685,40 +2763,9 @@ handle_inferior_event (struct execution_control_state *ecs)
if (tmp_sal.line != 0)
goto step_into_function;
}
step_over_function:
/* A subroutine call has happened. */
{
/* We've just entered a callee, and we wish to resume until it
returns to the caller. Setting a step_resume breakpoint on
the return address will catch a return from the callee.
However, if the callee is recursing, we want to be careful
not to catch returns of those recursive calls, but only of
THIS instance of the call.
To do this, we set the step_resume bp's frame to our current
caller's frame (step_frame_address, which is set by the "next"
or "until" command, before execution begins). */
struct symtab_and_line sr_sal;
INIT_SAL (&sr_sal); /* initialize to zeros */
sr_sal.pc =
ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
sr_sal.section = find_pc_overlay (sr_sal.pc);
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
set_momentary_breakpoint (sr_sal, get_current_frame (),
bp_step_resume);
if (!IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
step_resume_breakpoint->frame = step_frame_address;
if (breakpoints_inserted)
insert_breakpoints ();
}
goto keep_going;
step_over_function (ecs);
keep_going (ecs);
return;
step_into_function:
/* Subroutine call with source code we should not step over.
@ -2772,7 +2819,8 @@ handle_inferior_event (struct execution_control_state *ecs)
/* And make sure stepping stops right away then. */
step_range_end = step_range_start;
}
goto keep_going;
keep_going (ecs);
return;
}
/* We've wandered out of the step range. */
@ -2817,7 +2865,8 @@ handle_inferior_event (struct execution_control_state *ecs)
/* Restart without fiddling with the step ranges or
other state. */
goto keep_going;
keep_going (ecs);
return;
}
}
@ -2877,121 +2926,9 @@ handle_inferior_event (struct execution_control_state *ecs)
step_frame_address = current_frame;
}
keep_going:
/* Come to this label when you need to resume the inferior.
It's really much cleaner to do a goto than a maze of if-else
conditions. */
/* ??rehrauer: ttrace on HP-UX theoretically allows one to debug
a vforked child beetween its creation and subsequent exit or
call to exec(). However, I had big problems in this rather
creaky exec engine, getting that to work. The fundamental
problem is that I'm trying to debug two processes via an
engine that only understands a single process with possibly
multiple threads.
Hence, this spot is known to have problems when
target_can_follow_vfork_prior_to_exec returns 1. */
/* Save the pc before execution, to compare with pc after stop. */
prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
prev_func_start = ecs->stop_func_start; /* Ok, since if DECR_PC_AFTER
BREAK is defined, the
original pc would not have
been at the start of a
function. */
prev_func_name = ecs->stop_func_name;
if (ecs->update_step_sp)
step_sp = read_sp ();
ecs->update_step_sp = 0;
/* If we did not do break;, it means we should keep
running the inferior and not return to debugger. */
if (trap_expected && stop_signal != TARGET_SIGNAL_TRAP)
{
/* We took a signal (which we are supposed to pass through to
the inferior, else we'd have done a break above) and we
haven't yet gotten our trap. Simply continue. */
resume (currently_stepping (ecs), stop_signal);
}
else
{
/* Either the trap was not expected, but we are continuing
anyway (the user asked that this signal be passed to the
child)
-- or --
The signal was SIGTRAP, e.g. it was our signal, but we
decided we should resume from it.
We're going to run this baby now!
Insert breakpoints now, unless we are trying
to one-proceed past a breakpoint. */
/* If we've just finished a special step resume and we don't
want to hit a breakpoint, pull em out. */
if (step_resume_breakpoint == NULL
&& through_sigtramp_breakpoint == NULL
&& ecs->remove_breakpoints_on_following_step)
{
ecs->remove_breakpoints_on_following_step = 0;
remove_breakpoints ();
breakpoints_inserted = 0;
}
else if (!breakpoints_inserted &&
(through_sigtramp_breakpoint != NULL || !ecs->another_trap))
{
breakpoints_failed = insert_breakpoints ();
if (breakpoints_failed)
{
stop_stepping (ecs);
return;
}
breakpoints_inserted = 1;
}
trap_expected = ecs->another_trap;
/* Do not deliver SIGNAL_TRAP (except when the user
explicitly specifies that such a signal should be
delivered to the target program).
Typically, this would occure when a user is debugging a
target monitor on a simulator: the target monitor sets a
breakpoint; the simulator encounters this break-point and
halts the simulation handing control to GDB; GDB, noteing
that the break-point isn't valid, returns control back to
the simulator; the simulator then delivers the hardware
equivalent of a SIGNAL_TRAP to the program being
debugged. */
if (stop_signal == TARGET_SIGNAL_TRAP
&& !signal_program[stop_signal])
stop_signal = TARGET_SIGNAL_0;
#ifdef SHIFT_INST_REGS
/* I'm not sure when this following segment applies. I do know,
now, that we shouldn't rewrite the regs when we were stopped
by a random signal from the inferior process. */
/* FIXME: Shouldn't this be based on the valid bit of the SXIP?
(this is only used on the 88k). */
if (!bpstat_explains_signal (stop_bpstat)
&& (stop_signal != TARGET_SIGNAL_CHLD)
&& !stopped_by_random_signal)
SHIFT_INST_REGS ();
#endif /* SHIFT_INST_REGS */
resume (currently_stepping (ecs), stop_signal);
}
prepare_to_wait (ecs);
return;
keep_going (ecs);
} /* extra brace, to preserve old indentation */
stop_stepping (ecs);
}
/* Are we in the middle of stepping? */
@ -3043,6 +2980,39 @@ check_sigtramp2 (struct execution_control_state *ecs)
}
}
/* We've just entered a callee, and we wish to resume until it returns
to the caller. Setting a step_resume breakpoint on the return
address will catch a return from the callee.
However, if the callee is recursing, we want to be careful not to
catch returns of those recursive calls, but only of THIS instance
of the call.
To do this, we set the step_resume bp's frame to our current
caller's frame (step_frame_address, which is set by the "next" or
"until" command, before execution begins). */
static void
step_over_function (struct execution_control_state *ecs)
{
struct symtab_and_line sr_sal;
INIT_SAL (&sr_sal); /* initialize to zeros */
sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
sr_sal.section = find_pc_overlay (sr_sal.pc);
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
set_momentary_breakpoint (sr_sal, get_current_frame (), bp_step_resume);
if (!IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
step_resume_breakpoint->frame = step_frame_address;
if (breakpoints_inserted)
insert_breakpoints ();
}
static void
stop_stepping (struct execution_control_state *ecs)
{
@ -3084,6 +3054,118 @@ stop_stepping (struct execution_control_state *ecs)
ecs->wait_some_more = 0;
}
/* This function handles various cases where we need to continue
waiting for the inferior. */
/* (Used to be the keep_going: label in the old wait_for_inferior) */
static void
keep_going (struct execution_control_state *ecs)
{
/* ??rehrauer: ttrace on HP-UX theoretically allows one to debug a
vforked child between its creation and subsequent exit or call to
exec(). However, I had big problems in this rather creaky exec
engine, getting that to work. The fundamental problem is that
I'm trying to debug two processes via an engine that only
understands a single process with possibly multiple threads.
Hence, this spot is known to have problems when
target_can_follow_vfork_prior_to_exec returns 1. */
/* Save the pc before execution, to compare with pc after stop. */
prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
prev_func_start = ecs->stop_func_start; /* Ok, since if DECR_PC_AFTER
BREAK is defined, the
original pc would not have
been at the start of a
function. */
prev_func_name = ecs->stop_func_name;
if (ecs->update_step_sp)
step_sp = read_sp ();
ecs->update_step_sp = 0;
/* If we did not do break;, it means we should keep running the
inferior and not return to debugger. */
if (trap_expected && stop_signal != TARGET_SIGNAL_TRAP)
{
/* We took a signal (which we are supposed to pass through to
the inferior, else we'd have done a break above) and we
haven't yet gotten our trap. Simply continue. */
resume (currently_stepping (ecs), stop_signal);
}
else
{
/* Either the trap was not expected, but we are continuing
anyway (the user asked that this signal be passed to the
child)
-- or --
The signal was SIGTRAP, e.g. it was our signal, but we
decided we should resume from it.
We're going to run this baby now!
Insert breakpoints now, unless we are trying to one-proceed
past a breakpoint. */
/* If we've just finished a special step resume and we don't
want to hit a breakpoint, pull em out. */
if (step_resume_breakpoint == NULL
&& through_sigtramp_breakpoint == NULL
&& ecs->remove_breakpoints_on_following_step)
{
ecs->remove_breakpoints_on_following_step = 0;
remove_breakpoints ();
breakpoints_inserted = 0;
}
else if (!breakpoints_inserted &&
(through_sigtramp_breakpoint != NULL || !ecs->another_trap))
{
breakpoints_failed = insert_breakpoints ();
if (breakpoints_failed)
{
stop_stepping (ecs);
return;
}
breakpoints_inserted = 1;
}
trap_expected = ecs->another_trap;
/* Do not deliver SIGNAL_TRAP (except when the user explicitly
specifies that such a signal should be delivered to the
target program).
Typically, this would occure when a user is debugging a
target monitor on a simulator: the target monitor sets a
breakpoint; the simulator encounters this break-point and
halts the simulation handing control to GDB; GDB, noteing
that the break-point isn't valid, returns control back to the
simulator; the simulator then delivers the hardware
equivalent of a SIGNAL_TRAP to the program being debugged. */
if (stop_signal == TARGET_SIGNAL_TRAP
&& !signal_program[stop_signal])
stop_signal = TARGET_SIGNAL_0;
#ifdef SHIFT_INST_REGS
/* I'm not sure when this following segment applies. I do know,
now, that we shouldn't rewrite the regs when we were stopped
by a random signal from the inferior process. */
/* FIXME: Shouldn't this be based on the valid bit of the SXIP?
(this is only used on the 88k). */
if (!bpstat_explains_signal (stop_bpstat)
&& (stop_signal != TARGET_SIGNAL_CHLD)
&& !stopped_by_random_signal)
SHIFT_INST_REGS ();
#endif /* SHIFT_INST_REGS */
resume (currently_stepping (ecs), stop_signal);
}
prepare_to_wait (ecs);
}
/* This function normally comes after a resume, before
handle_inferior_event exits. It takes care of any last bits of
housekeeping, and sets the all-important wait_some_more flag. */
@ -3365,6 +3447,33 @@ signal_pass_state (int signo)
return signal_program[signo];
}
int signal_stop_update (signo, state)
int signo;
int state;
{
int ret = signal_stop[signo];
signal_stop[signo] = state;
return ret;
}
int signal_print_update (signo, state)
int signo;
int state;
{
int ret = signal_print[signo];
signal_print[signo] = state;
return ret;
}
int signal_pass_update (signo, state)
int signo;
int state;
{
int ret = signal_program[signo];
signal_program[signo] = state;
return ret;
}
static void
sig_print_header (void)
{

View File

@ -126,7 +126,7 @@ java_value_print (val, stream, format, pretty)
if (element == 0)
fprintf_filtered (stream, "null");
else
fprintf_filtered (stream, "@%x", element);
fprintf_filtered (stream, "@%s", paddr_nz (element));
things_printed++;
i += reps;

1637
gdb/linux-thread.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,8 @@
#include <time.h> /* for time_t */
#include "gdb_string.h"
#include "objfiles.h" /* for ALL_OBJFILES etc. */
#include "inferior.h" /* for write_pc() */
#include <ctype.h>
extern void report_transfer_performance PARAMS ((unsigned long, time_t, time_t));
@ -79,7 +80,7 @@ m32r_load_section (abfd, s, data_count)
print_address_numeric (section_base, 1, gdb_stdout);
printf_filtered ("\n");
gdb_flush (gdb_stdout);
monitor_printf ("%x mw\r", section_base);
monitor_printf ("%s mw\r", paddr_nz (section_base));
for (i = 0; i < section_size; i += 4)
{
QUIT;

View File

@ -179,7 +179,7 @@ extern void breakpoint(void);
static int computeSignal(int);
static void putpacket(unsigned char *);
static unsigned char *getpacket(unsigned char *);
static unsigned char *getpacket(void);
static unsigned char *mem2hex(unsigned char *, unsigned char *, int, int);
static unsigned char *hex2mem(unsigned char *, unsigned char *, int, int);
@ -310,7 +310,7 @@ handle_exception(int exceptionVector)
while (1==1) {
remcomOutBuffer[0] = 0;
ptr = getpacket(remcomInBuffer);
ptr = getpacket();
binary = 0;
switch (*ptr++) {
default: /* Unknown code. Return an empty reply message. */
@ -575,9 +575,9 @@ hex(ch)
/* scan for the sequence $<data>#<checksum> */
unsigned char *
getpacket (buffer)
unsigned char *buffer;
getpacket ()
{
unsigned char *buffer = &remcomInBuffer[0];
unsigned char checksum;
unsigned char xmitcsum;
int count;

View File

@ -514,9 +514,9 @@ m32r_frame_chain (fi)
return 0; /* in _start fn, don't chain further */
if (fi->framesize == 0)
{
printf_filtered ("cannot determine frame size @ %08x , pc(%08x)\n",
(unsigned long) fi->frame,
(unsigned long) fi->pc);
printf_filtered ("cannot determine frame size @ %s , pc(%s)\n",
paddr (fi->frame),
paddr (fi->pc));
return 0;
}
insn_debug (("m32rx frame %08x\n", fi->frame + fi->framesize));

View File

@ -522,10 +522,15 @@ char ch;
return (-1);
}
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/* scan for the sequence $<data>#<checksum> */
unsigned char *
getpacket (unsigned char *buffer)
getpacket ()
{
unsigned char *buffer = &remcomInBuffer[0];
unsigned char checksum;
unsigned char xmitcsum;
int count;
@ -622,11 +627,6 @@ char * buffer;
}
char remcomInBuffer[BUFMAX];
char remcomOutBuffer[BUFMAX];
static short error;
void debug_error(format, parm)
char * format;
char * parm;
@ -777,9 +777,8 @@ void handle_exception(int exceptionVector)
stepping = 0;
while (1==1) {
error = 0;
remcomOutBuffer[0] = 0;
ptr = getpacket(remcomInBuffer);
ptr = getpacket();
switch (*ptr++) {
case '?' : remcomOutBuffer[0] = 'S';
remcomOutBuffer[1] = hexchars[sigval >> 4];

View File

@ -119,8 +119,6 @@ main (argc, argv)
long time_at_startup = get_run_time ();
int gdb_file_size;
START_PROGRESS (argv[0], 0);
#ifdef MPW

View File

@ -347,13 +347,13 @@ maintenance_translate_address (arg, from_tty)
sym = lookup_minimal_symbol_by_pc (address);
if (sym)
printf_filtered ("%s+%u\n",
printf_filtered ("%s+%s\n",
SYMBOL_SOURCE_NAME (sym),
address - SYMBOL_VALUE_ADDRESS (sym));
paddr_u (address - SYMBOL_VALUE_ADDRESS (sym)));
else if (sect)
printf_filtered ("no symbol at %s:0x%08x\n", sect->name, address);
printf_filtered ("no symbol at %s:0x%s\n", sect->name, paddr (address));
else
printf_filtered ("no symbol at 0x%08x\n", address);
printf_filtered ("no symbol at 0x%s\n", paddr (address));
return;
}

View File

@ -353,8 +353,7 @@ static int
upgrade_type PARAMS ((int, struct type **, int, union aux_ext *, int, char *));
static void
parse_partial_symbols PARAMS ((struct objfile *,
struct section_offsets *));
parse_partial_symbols PARAMS ((struct objfile *));
static FDR
* get_rfd PARAMS ((int, int));
@ -407,7 +406,7 @@ static int
compare_blocks PARAMS ((const void *, const void *));
static struct partial_symtab *
new_psymtab PARAMS ((char *, struct objfile *, struct section_offsets *));
new_psymtab PARAMS ((char *, struct objfile *));
static void
psymtab_to_symtab_1 PARAMS ((struct partial_symtab *, char *));
@ -520,11 +519,10 @@ fdr_name (f)
different sections are relocated via the SECTION_OFFSETS. */
void
mdebug_build_psymtabs (objfile, swap, info, section_offsets)
mdebug_build_psymtabs (objfile, swap, info)
struct objfile *objfile;
const struct ecoff_debug_swap *swap;
struct ecoff_debug_info *info;
struct section_offsets *section_offsets;
{
cur_bfd = objfile->obfd;
debug_swap = swap;
@ -548,7 +546,7 @@ mdebug_build_psymtabs (objfile, swap, info, section_offsets)
(*swap->swap_fdr_in) (objfile->obfd, fdr_src, fdr_ptr);
}
parse_partial_symbols (objfile, section_offsets);
parse_partial_symbols (objfile);
#if 0
/* Check to make sure file was compiled with -g. If not, warn the
@ -2274,9 +2272,8 @@ parse_lines (fh, pr, lt, maxlines, pst, lowest_pdr_addr)
into a partial_symtab. */
static void
parse_partial_symbols (objfile, section_offsets)
parse_partial_symbols (objfile)
struct objfile *objfile;
struct section_offsets *section_offsets;
{
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
const bfd_size_type external_rfd_size = debug_swap->external_rfd_size;
@ -2363,7 +2360,7 @@ parse_partial_symbols (objfile, section_offsets)
old_chain = make_cleanup (free, fdr_to_pst);
fdr_to_pst++;
{
struct partial_symtab *pst = new_psymtab ("", objfile, section_offsets);
struct partial_symtab *pst = new_psymtab ("", objfile);
fdr_to_pst[-1].pst = pst;
FDR_IDX (pst) = -1;
}
@ -2477,12 +2474,12 @@ parse_partial_symbols (objfile, section_offsets)
{
case stProc:
/* Beginnning of Procedure */
svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
break;
case stStaticProc:
/* Load time only static procs */
ms_type = mst_file_text;
svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
break;
case stGlobal:
/* External symbol */
@ -2495,12 +2492,12 @@ parse_partial_symbols (objfile, section_offsets)
else if (SC_IS_DATA (ext_in->asym.sc))
{
ms_type = mst_data;
svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
}
else if (SC_IS_BSS (ext_in->asym.sc))
{
ms_type = mst_bss;
svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
}
else
ms_type = mst_abs;
@ -2510,17 +2507,17 @@ parse_partial_symbols (objfile, section_offsets)
if (SC_IS_TEXT (ext_in->asym.sc))
{
ms_type = mst_file_text;
svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
}
else if (SC_IS_DATA (ext_in->asym.sc))
{
ms_type = mst_file_data;
svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
}
else if (SC_IS_BSS (ext_in->asym.sc))
{
ms_type = mst_file_bss;
svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
}
else
ms_type = mst_abs;
@ -2564,11 +2561,11 @@ parse_partial_symbols (objfile, section_offsets)
{
textlow = fh->adr;
if (relocatable || textlow != 0)
textlow += ANOFFSET (section_offsets, SECT_OFF_TEXT);
textlow += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
}
else
textlow = 0;
pst = start_psymtab_common (objfile, section_offsets,
pst = start_psymtab_common (objfile, objfile->section_offsets,
fdr_name (fh),
textlow,
objfile->global_psymbols.next,
@ -2652,7 +2649,7 @@ parse_partial_symbols (objfile, section_offsets)
CORE_ADDR procaddr;
long isym;
sh.value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
if (sh.st == stStaticProc)
{
namestring = debug_info->ss + fh->issBase + sh.iss;
@ -2703,7 +2700,7 @@ parse_partial_symbols (objfile, section_offsets)
case scPData:
case scXData:
namestring = debug_info->ss + fh->issBase + sh.iss;
sh.value += ANOFFSET (section_offsets, SECT_OFF_DATA);
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
prim_record_minimal_symbol_and_info (namestring,
sh.value,
mst_file_data,
@ -2717,7 +2714,7 @@ parse_partial_symbols (objfile, section_offsets)
/* FIXME! Shouldn't this use cases for bss,
then have the default be abs? */
namestring = debug_info->ss + fh->issBase + sh.iss;
sh.value += ANOFFSET (section_offsets, SECT_OFF_BSS);
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
prim_record_minimal_symbol_and_info (namestring,
sh.value,
mst_file_bss,
@ -2769,7 +2766,7 @@ parse_partial_symbols (objfile, section_offsets)
namestring = stabstring
#define CUR_SYMBOL_TYPE type_code
#define CUR_SYMBOL_VALUE sh.value
#define START_PSYMTAB(ofile,secoff,fname,low,symoff,global_syms,static_syms)\
#define START_PSYMTAB(ofile,fname,low,symoff,global_syms,static_syms)\
pst = save_pst
#define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set) (void)0
#define HANDLE_RBRAC(val) \
@ -2821,18 +2818,18 @@ parse_partial_symbols (objfile, section_offsets)
/* The value of a stEnd symbol is the displacement from the
corresponding start symbol value, do not relocate it. */
if (sh.st != stEnd)
sh.value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
break;
case scData:
case scSData:
case scRData:
case scPData:
case scXData:
sh.value += ANOFFSET (section_offsets, SECT_OFF_DATA);
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
break;
case scBss:
case scSBss:
sh.value += ANOFFSET (section_offsets, SECT_OFF_BSS);
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
break;
}
@ -3029,18 +3026,18 @@ parse_partial_symbols (objfile, section_offsets)
{
case scText:
case scRConst:
svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
break;
case scData:
case scSData:
case scRData:
case scPData:
case scXData:
svalue += ANOFFSET (section_offsets, SECT_OFF_DATA);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
break;
case scBss:
case scSBss:
svalue += ANOFFSET (section_offsets, SECT_OFF_BSS);
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
break;
}
@ -3564,7 +3561,7 @@ psymtab_to_symtab_1 (pst, filename)
(*swap_sym_in) (cur_bfd, sym_ptr, &sh);
c = parse_symbol (&sh,
debug_info->external_aux + fh->iauxBase,
sym_ptr, fh->fBigendian, pst->section_offsets);
sym_ptr, fh->fBigendian, pst->section_offsets);
sym_ptr += c * external_sym_size;
}
@ -4131,15 +4128,14 @@ new_symtab (name, maxsyms, maxlines, objfile)
/* Allocate a new partial_symtab NAME */
static struct partial_symtab *
new_psymtab (name, objfile, section_offsets)
new_psymtab (name, objfile)
char *name;
struct objfile *objfile;
struct section_offsets *section_offsets;
{
struct partial_symtab *psymtab;
psymtab = allocate_psymtab (name, objfile);
psymtab->section_offsets = section_offsets;
psymtab->section_offsets = objfile->section_offsets;
/* Keep a backpointer to the file's symbols */
@ -4288,11 +4284,10 @@ new_type (name)
it as normal. */
void
elfmdebug_build_psymtabs (objfile, swap, sec, section_offsets)
elfmdebug_build_psymtabs (objfile, swap, sec)
struct objfile *objfile;
const struct ecoff_debug_swap *swap;
asection *sec;
struct section_offsets *section_offsets;
{
bfd *abfd = objfile->obfd;
struct ecoff_debug_info *info;
@ -4305,7 +4300,7 @@ elfmdebug_build_psymtabs (objfile, swap, sec, section_offsets)
error ("Error reading ECOFF debugging information: %s",
bfd_errmsg (bfd_get_error ()));
mdebug_build_psymtabs (objfile, swap, info, section_offsets);
mdebug_build_psymtabs (objfile, swap, info);
}

View File

@ -87,8 +87,6 @@ static CORE_ADDR heuristic_proc_start PARAMS ((CORE_ADDR));
static CORE_ADDR read_next_frame_reg PARAMS ((struct frame_info *, int));
void mips_set_processor_type_command PARAMS ((char *, int));
int mips_set_processor_type PARAMS ((char *));
static void mips_show_processor_type_command PARAMS ((char *, int));
@ -247,9 +245,9 @@ mips_print_extra_frame_info (fi)
&& fi->extra_info
&& fi->extra_info->proc_desc
&& fi->extra_info->proc_desc->pdr.framereg < NUM_REGS)
printf_filtered (" frame pointer is at %s+%d\n",
printf_filtered (" frame pointer is at %s+%s\n",
REGISTER_NAME (fi->extra_info->proc_desc->pdr.framereg),
fi->extra_info->proc_desc->pdr.frameoffset);
paddr_d (fi->extra_info->proc_desc->pdr.frameoffset));
}
/* Convert between RAW and VIRTUAL registers. The RAW register size
@ -689,8 +687,8 @@ static void
print_unpack (char *comment,
struct upk_mips16 *u)
{
printf ("%s %04x ,f(%d) off(%08x) (x(%x) y(%x)\n",
comment, u->inst, u->fmt, u->offset, u->regx, u->regy);
printf ("%s %04x ,f(%d) off(%s) (x(%x) y(%x)\n",
comment, u->inst, u->fmt, paddr (u->offset), u->regx, u->regy);
}
/* The EXT-I, EXT-ri nad EXT-I8 instructions all have the same

View File

@ -104,7 +104,7 @@ mipscoff_symfile_read (objfile, mainline)
error ("Error reading symbol table: %s", bfd_errmsg (bfd_get_error ()));
mdebug_build_psymtabs (objfile, &ecoff_backend (abfd)->debug_swap,
&ecoff_data (abfd)->debug_info, objfile->section_offsets);
&ecoff_data (abfd)->debug_info);
/* Add alpha coff dynamic symbols. */

View File

@ -28,7 +28,7 @@
#include "xmodem.h"
#include "symtab.h"
#include "symfile.h" /* for generic_load */
#include "inferior.h" /* for write_pc() */
#define USE_GENERIC_LOAD

View File

@ -143,6 +143,8 @@ static DCACHE *remote_dcache;
static int first_time = 0; /* is this the first time we're executing after
gaving created the child proccess? */
#define TARGET_BUF_SIZE 2048
/* Convert a string into a printable representation, Return # byte in the
new string. */
@ -217,8 +219,7 @@ monitor_error (format, memaddr, len, string, final_char)
{
int real_len = (len == 0 && string != (char *) 0) ? strlen (string) : len;
char *safe_string = alloca ((real_len * 4) + 1);
char *p, *q;
int ch;
char *p;
int safe_len = monitor_printable_string (safe_string, string);
if (final_char)
@ -451,7 +452,6 @@ readchar (timeout)
if (c >= 0)
{
c &= 0x7f;
#if 0
/* This seems to interfere with proper function of the
input stream */
if (remote_debug > 0)
@ -462,7 +462,6 @@ readchar (timeout)
puts_debug ("read -->", buf, "<--");
}
#endif
}
/* Canonicialize \n\r combinations into one \r */
@ -634,8 +633,8 @@ monitor_expect_regexp (pat, buf, buflen)
mybuf = buf;
else
{
mybuf = alloca (1024);
buflen = 1024;
mybuf = alloca (TARGET_BUF_SIZE);
buflen = TARGET_BUF_SIZE;
}
p = mybuf;
@ -905,14 +904,35 @@ monitor_supply_register (regno, valstr)
int regno;
char *valstr;
{
unsigned int val;
ULONGEST val;
unsigned char regbuf[MAX_REGISTER_RAW_SIZE];
char *p;
val = strtoul (valstr, &p, 16);
p = valstr;
while (p && *p != '\0')
{
if (*p == '\r' || *p == '\n')
{
while (*p != '\0')
p++;
break;
}
if (isspace (*p))
{
p++;
continue;
}
if (!isxdigit (*p) && *p != 'x')
{
break;
}
val <<= 4;
val += fromhex (*p++);
}
RDEBUG (("Supplying Register %d %s\n", regno, valstr));
if (val == 0 && valstr == p)
if (*p != '\0')
error ("monitor_supply_register (%d): bad value from monitor: %s.",
regno, valstr);
@ -1098,7 +1118,7 @@ monitor_wait (pid, status)
struct target_waitstatus *status;
{
int old_timeout = timeout;
char buf[1024];
char buf[TARGET_BUF_SIZE];
int resp_len;
struct cleanup *old_chain;
@ -1282,7 +1302,7 @@ monitor_fetch_register (regno)
int
monitor_dump_reg_block (char *block_cmd)
{
char buf[1024];
char buf[TARGET_BUF_SIZE];
int resp_len;
monitor_printf (block_cmd);
resp_len = monitor_expect_prompt (buf, sizeof (buf));
@ -1297,7 +1317,7 @@ monitor_dump_reg_block (char *block_cmd)
static void
monitor_dump_regs ()
{
char buf[1024];
char buf[TARGET_BUF_SIZE];
int resp_len;
if (current_monitor->dumpregs)
(*(current_monitor->dumpregs)) (); /* call supplied function */
@ -1340,7 +1360,7 @@ monitor_store_register (regno)
int regno;
{
char *name;
unsigned int val;
ULONGEST val;
name = current_monitor->regnames[regno];
if (!name || (*name == '\0'))
@ -1350,7 +1370,7 @@ monitor_store_register (regno)
}
val = read_register (regno);
RDEBUG (("MON storeg %d %08x\n", regno, (unsigned int) val))
RDEBUG (("MON storeg %d %08lx\n", regno, (ULONGEST) val))
/* send the register deposit command */
@ -1366,7 +1386,7 @@ monitor_store_register (regno)
RDEBUG (("EXP setreg.term\n"))
monitor_expect (current_monitor->setreg.term, NULL, 0);
if (current_monitor->flags & MO_SETREG_INTERACTIVE)
monitor_printf ("%x\r", val);
monitor_printf ("%A\r", val);
monitor_expect_prompt (NULL, 0);
}
else
@ -2148,7 +2168,7 @@ monitor_remove_breakpoint (addr, shadow)
static int
monitor_wait_srec_ack ()
{
int i, ch;
int ch;
if (current_monitor->flags & MO_SREC_ACK_PLUS)
{

View File

@ -521,9 +521,8 @@ objfile_relocate (objfile, new_offsets)
struct objfile *objfile;
struct section_offsets *new_offsets;
{
struct section_offsets *delta = (struct section_offsets *)
alloca (sizeof (struct section_offsets)
+ objfile->num_sections * sizeof (delta->offsets));
struct section_offsets *delta =
(struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
{
int i;

View File

@ -289,7 +289,6 @@ ocd_open (name, from_tty, target_type, ops)
struct target_ops *ops;
{
unsigned char buf[10], *p;
int status;
int pktlen;
if (name == 0)
@ -1066,7 +1065,6 @@ ocd_get_packet (cmd, lenp, timeout)
{
int ch;
int len;
int i;
static unsigned char packet[512];
unsigned char *packet_ptr;
unsigned char checksum;
@ -1411,7 +1409,7 @@ bdm_update_flash_command (args, from_tty)
int from_tty;
{
int status, pktlen;
struct cleanup *old_chain;
struct cleanup *old_chain;
void (*store_registers_tmp) PARAMS ((int));
if (!ocd_desc)

View File

@ -127,7 +127,7 @@ static struct complaint lbrac_mismatch_complaint =
/* Local function prototypes */
static void
read_minimal_symbols PARAMS ((struct objfile *, struct section_offsets *));
read_minimal_symbols PARAMS ((struct objfile *));
static void
os9k_read_ofile_symtab PARAMS ((struct partial_symtab *));
@ -139,8 +139,7 @@ static void
os9k_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
static void
read_os9k_psymtab PARAMS ((struct section_offsets *, struct objfile *,
CORE_ADDR, int));
read_os9k_psymtab PARAMS ((struct objfile *, CORE_ADDR, int));
static int
fill_sym PARAMS ((FILE *, bfd *));
@ -162,7 +161,7 @@ os9k_process_one_symbol PARAMS ((int, int, CORE_ADDR, char *,
struct section_offsets *, struct objfile *));
static struct partial_symtab *
os9k_start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
os9k_start_psymtab PARAMS ((struct objfile *, char *,
CORE_ADDR, int, int, struct partial_symbol **,
struct partial_symbol **));
@ -171,8 +170,7 @@ static struct partial_symtab *
struct partial_symtab **, int));
static void
record_minimal_symbol PARAMS ((char *, CORE_ADDR, int, struct objfile *,
struct section_offsets *));
record_minimal_symbol PARAMS ((char *, CORE_ADDR, int, struct objfile *));
#define HANDLE_RBRAC(val) \
if ((val) > pst->texthigh) pst->texthigh = (val);
@ -198,12 +196,11 @@ record_minimal_symbol PARAMS ((char *, CORE_ADDR, int, struct objfile *,
#define N_ABS 6
static void
record_minimal_symbol (name, address, type, objfile, section_offsets)
record_minimal_symbol (name, address, type, objfile)
char *name;
CORE_ADDR address;
int type;
struct objfile *objfile;
struct section_offsets *section_offsets;
{
enum minimal_symbol_type ms_type;
@ -211,7 +208,7 @@ record_minimal_symbol (name, address, type, objfile, section_offsets)
{
case N_TEXT:
ms_type = mst_text;
address += ANOFFSET (section_offsets, SECT_OFF_TEXT);
address += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
break;
case N_DATA:
ms_type = mst_data;
@ -257,9 +254,8 @@ struct stbsymbol
#define STBSYMSIZE 10
static void
read_minimal_symbols (objfile, section_offsets)
read_minimal_symbols (objfile)
struct objfile *objfile;
struct section_offsets *section_offsets;
{
FILE *fp;
bfd *abfd;
@ -314,7 +310,7 @@ read_minimal_symbols (objfile, section_offsets)
break;
ch = getc (fp);
};
record_minimal_symbol (buf1, sym.value, sym.type & 7, objfile, section_offsets);
record_minimal_symbol (buf1, sym.value, sym.type & 7, objfile);
off += STBSYMSIZE;
};
install_minimal_symbols (objfile);
@ -326,8 +322,6 @@ read_minimal_symbols (objfile, section_offsets)
put all the relevant info into a "struct os9k_symfile_info",
hung off the objfile structure.
SECTION_OFFSETS contains offsets relative to which the symbols in the
various sections are (depending where the sections were actually loaded).
MAINLINE is true if we are reading the main symbol
table (as opposed to a shared lib or dynamically loaded file). */
@ -349,11 +343,11 @@ os9k_symfile_read (objfile, mainline)
back_to = make_cleanup (really_free_pendings, 0);
make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
read_minimal_symbols (objfile, objfile->section_offsets);
read_minimal_symbols (objfile);
/* Now that the symbol table data of the executable file are all in core,
process them and define symbols accordingly. */
read_os9k_psymtab (objfile->section_offsets, objfile,
read_os9k_psymtab (objfile,
DBX_TEXT_ADDR (objfile),
DBX_TEXT_SIZE (objfile));
@ -565,13 +559,10 @@ fill_sym (dbg_file, abfd)
/* Given pointers to an a.out symbol table in core containing dbx
style data, setup partial_symtab's describing each source file for
which debugging information is available.
SYMFILE_NAME is the name of the file we are reading from
and SECTION_OFFSETS is the set of offsets for the various sections
of the file (a set of zeros if the mainline program). */
SYMFILE_NAME is the name of the file we are reading from. */
static void
read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
struct section_offsets *section_offsets;
read_os9k_psymtab (objfile, text_addr, text_size)
struct objfile *objfile;
CORE_ADDR text_addr;
int text_size;
@ -617,7 +608,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
#ifdef END_OF_TEXT_DEFAULT
end_of_text_addr = END_OF_TEXT_DEFAULT;
#else
end_of_text_addr = text_addr + section_offsets->offsets[SECT_OFF_TEXT]
end_of_text_addr = text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)
+ text_size; /* Relocate */
#endif
@ -664,7 +655,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
continue;
case N_SYM_SE:
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
if (psymfile_depth == 1 && pst)
{
os9k_end_psymtab (pst, psymtab_include_list, includes_used,
@ -701,7 +692,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
valu = CUR_SYMBOL_VALUE;
if (valu)
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
past_first_source_file = 1;
p = strchr (namestring, ':');
@ -716,7 +707,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
if (psymfile_depth == 0)
{
if (!pst)
pst = os9k_start_psymtab (objfile, section_offsets,
pst = os9k_start_psymtab (objfile,
str, valu,
cursymoffset,
symnum - 1,
@ -893,7 +884,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
continue;
case 'f':
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
if (pst && pst->textlow == 0)
pst->textlow = CUR_SYMBOL_VALUE;
@ -904,7 +895,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
continue;
case 'F':
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
if (pst && pst->textlow == 0)
pst->textlow = CUR_SYMBOL_VALUE;
@ -942,7 +933,7 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
}
case N_SYM_RBRAC:
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
#ifdef HANDLE_RBRAC
HANDLE_RBRAC (CUR_SYMBOL_VALUE);
continue;
@ -992,10 +983,9 @@ read_os9k_psymtab (section_offsets, objfile, text_addr, text_size)
static struct partial_symtab *
os9k_start_psymtab (objfile, section_offsets,
os9k_start_psymtab (objfile,
filename, textlow, ldsymoff, ldsymcnt, global_syms, static_syms)
struct objfile *objfile;
struct section_offsets *section_offsets;
char *filename;
CORE_ADDR textlow;
int ldsymoff;
@ -1004,7 +994,7 @@ os9k_start_psymtab (objfile, section_offsets,
struct partial_symbol **static_syms;
{
struct partial_symtab *result =
start_psymtab_common (objfile, section_offsets,
start_psymtab_common (objfile, objfile->section_offsets,
filename, textlow, global_syms, static_syms);
result->read_symtab_private = (char *)
@ -1313,7 +1303,6 @@ os9k_read_ofile_symtab (pst)
int sym_offset; /* Offset to start of symbols to read */
CORE_ADDR text_offset; /* Start of text segment for symbols */
int text_size; /* Size of text segment for symbols */
struct section_offsets *section_offsets;
FILE *dbg_file;
objfile = pst->objfile;
@ -1321,7 +1310,6 @@ os9k_read_ofile_symtab (pst)
max_symnum = LDSYMCNT (pst);
text_offset = pst->textlow;
text_size = pst->texthigh - pst->textlow;
section_offsets = pst->section_offsets;
current_objfile = objfile;
subfile_stack = NULL;
@ -1386,7 +1374,7 @@ os9k_read_ofile_symtab (pst)
type = bufp->n_type;
os9k_process_one_symbol ((int) type, (int) bufp->n_desc,
(CORE_ADDR) bufp->n_value, bufp->n_strx, section_offsets, objfile);
(CORE_ADDR) bufp->n_value, bufp->n_strx, pst->section_offsets, objfile);
/* We skip checking for a new .o or -l file; that should never
happen in this routine. */

View File

@ -602,8 +602,6 @@ parse_nested_classes_for_hpacc (name, len, token, class_prefix, argptr)
struct symbol *sym_class = NULL;
struct symbol *sym_var = NULL;
struct type *t;
register int i;
int colons_found = 0;
int prefix_len = 0;
int done = 0;
char *q;

View File

@ -24,7 +24,6 @@
CUR_SYMBOL_TYPE --Type code of current symbol.
CUR_SYMBOL_VALUE --Value field of current symbol. May be adjusted here.
namestring - variable pointing to the name of the stab.
section_offsets - variable pointing to the section offsets.
pst - the partial symbol table being built.
psymtab_include_list, includes_used, includes_allocated - list of include
@ -266,7 +265,7 @@ switch (CUR_SYMBOL_TYPE)
immediately follow the first. */
if (!pst)
pst = START_PSYMTAB (objfile, objfile->section_offsets,
pst = START_PSYMTAB (objfile,
namestring, valu,
first_so_symnum * symbol_size,
objfile->global_psymbols.next,

View File

@ -27,8 +27,6 @@
#include "monitor.h"
#include "serial.h"
static void ppcbug_open PARAMS ((char *args, int from_tty));
static void
ppcbug_supply_register (regname, regnamelen, val, vallen)
char *regname;
@ -36,7 +34,7 @@ ppcbug_supply_register (regname, regnamelen, val, vallen)
char *val;
int vallen;
{
int regno = 0, base = 0;
int regno = 0;
if (regnamelen < 2 || regnamelen > 4)
return;

View File

@ -37,6 +37,8 @@
#include "serial.h"
#include "monitor.h"
#include "remote-utils.h"
#include "inferior.h"
#include "version.h"
extern int baud_rate;
@ -88,8 +90,6 @@ static int array_get_packet ();
static unsigned long ascii2hexword ();
static void hexword2ascii ();
extern char *version;
#define LOG_FILE "monitor.log"
#if defined (LOG_FILE)
FILE *log_file;
@ -625,7 +625,7 @@ array_open (args, name, from_tty)
log_file = fopen (LOG_FILE, "w");
if (log_file == NULL)
perror_with_name (LOG_FILE);
fprintf (log_file, "GDB %s (%s", version);
fprintf (log_file, "GDB %s (%s", version, host_name);
fprintf (log_file, " --target %s)\n", array_ops.to_shortname);
fprintf (log_file, "Remote target %s connected to %s\n\n", array_ops.to_shortname, dev_name);
#endif
@ -1025,7 +1025,7 @@ array_read_inferior_memory (memaddr, myaddr, len)
/* Fetch the bytes */
debuglogs (3, "read %d bytes from inferior address %x", len_this_pass,
startaddr);
sprintf (buf, "m%08x,%04x", startaddr, len_this_pass);
sprintf (buf, "m%08lx,%04x", startaddr, len_this_pass);
make_gdb_packet (packet, buf);
if (array_send_packet (packet) == 0)
{
@ -1112,7 +1112,7 @@ array_insert_breakpoint (addr, shadow)
{
breakaddr[i] = addr;
if (sr_get_debug () > 4)
printf ("Breakpoint at %x\n", addr);
printf ("Breakpoint at %s\n", paddr_nz (addr));
array_read_inferior_memory (bp_addr, shadow, bp_size);
printf_monitor ("b 0x%x\n", addr);
expect_prompt (1);
@ -1147,7 +1147,8 @@ array_remove_breakpoint (addr, shadow)
return 0;
}
}
fprintf (stderr, "Can't find breakpoint associated with 0x%x\n", addr);
fprintf (stderr, "Can't find breakpoint associated with 0x%s\n",
paddr_nz (addr));
return 1;
}

View File

@ -41,7 +41,6 @@
#define S_IROTH S_IREAD
#endif
extern void mips_set_processor_type_command PARAMS ((char *, int));
/* Breakpoint types. Values 0, 1, and 2 must agree with the watch
@ -394,7 +393,7 @@ static int interrupt_count;
static int mips_wait_flag = 0;
/* If non-zero, monitor supports breakpoint commands. */
static monitor_supports_breakpoints = 0;
static int monitor_supports_breakpoints = 0;
/* Data cache header. */
@ -2545,7 +2544,7 @@ remote_mips_remove_watchpoint (addr, len, type)
}
int
remote_mips_stopped_by_watchpoint ()
remote_mips_stopped_by_watchpoint (void)
{
return hit_watchpoint;
}
@ -2864,7 +2863,7 @@ send_srec (srec, len, addr)
case 0x6: /* ACK */
return;
case 0x15: /* NACK */
fprintf_unfiltered (gdb_stderr, "Download got a NACK at byte %d! Retrying.\n", addr);
fprintf_unfiltered (gdb_stderr, "Download got a NACK at byte %s! Retrying.\n", paddr_u (addr));
continue;
default:
error ("Download got unexpected ack char: 0x%x, retrying.\n", ch);
@ -2910,9 +2909,10 @@ mips_load_srec (args)
{
unsigned int numbytes;
/* FIXME! vma too small?? */
printf_filtered ("%s\t: 0x%4x .. 0x%4x ", s->name, s->vma,
s->vma + s->_raw_size);
/* FIXME! vma too small????? */
printf_filtered ("%s\t: 0x%4lx .. 0x%4lx ", s->name,
(long) s->vma,
(long) (s->vma + s->_raw_size));
gdb_flush (gdb_stdout);
for (i = 0; i < s->_raw_size; i += numbytes)

View File

@ -512,12 +512,8 @@ rombug_wait (pid, status)
{
if (obj_sec->objfile != symfile_objfile)
new_symfile_objfile (obj_sec->objfile, 1, 0);
offs = ((struct section_offsets *)
alloca (sizeof (struct section_offsets)
+ (symfile_objfile->num_sections * sizeof (offs->offsets))));
memcpy (offs, symfile_objfile->section_offsets,
(sizeof (struct section_offsets) +
(symfile_objfile->num_sections * sizeof (offs->offsets))));
offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
ANOFFSET (offs, SECT_OFF_DATA) = addr;
ANOFFSET (offs, SECT_OFF_BSS) = addr;

View File

@ -373,7 +373,7 @@ arm_rdi_create_inferior (exec_file, args, env)
/* Set up memory limit */
top_of_memory = strtoul (*env + sizeof ("MEMSIZE=") - 1,
&end_of_num, 0);
printf_filtered ("Setting top-of-memory to 0x%x\n",
printf_filtered ("Setting top-of-memory to 0x%lx\n",
top_of_memory);
rslt = angel_RDI_info (RDIInfo_SetTopMem, &top_of_memory, &arg2);

View File

@ -498,7 +498,6 @@ sds_fetch_registers (regno)
{
unsigned char buf[PBUFSIZ];
int i, retlen;
char *p;
char regs[REGISTER_BYTES];
/* Unimplemented registers read as all bits zero. */
@ -780,8 +779,6 @@ putmessage (buf, len)
unsigned char csum = 0;
char buf2[PBUFSIZ], buf3[PBUFSIZ];
unsigned char header[3];
int ch;
int tcount = 0;
char *p;
/* Copy the packet into buffer BUF2, encapsulating it
@ -831,8 +828,6 @@ putmessage (buf, len)
while (1)
{
int started_error_output = 0;
if (remote_debug)
{
*p = '\0';
@ -846,9 +841,7 @@ putmessage (buf, len)
perror_with_name ("putmessage: write failed");
return 1;
}
}
/* Come here after finding the start of the frame. Collect the rest

View File

@ -131,7 +131,7 @@ dump_mem (buf, len)
{
long l[2];
memcpy (l, buf, len);
printf_filtered ("\t0x%x", l[0]);
printf_filtered ("\t0x%lx", l[0]);
printf_filtered (len == 8 ? " 0x%x\n" : "\n", l[1]);
}
else
@ -290,6 +290,10 @@ gdb_os_error (host_callback * p, const char *format,...)
}
}
#ifndef REGISTER_SIM_REGNO
#define REGISTER_SIM_REGNO(N) (N)
#endif
static void
gdbsim_fetch_register (regno)
int regno;
@ -300,19 +304,28 @@ gdbsim_fetch_register (regno)
for (regno = 0; regno < NUM_REGS; regno++)
gdbsim_fetch_register (regno);
}
else if (REGISTER_NAME (regno) != NULL && *REGISTER_NAME (regno) != '\0')
else if (REGISTER_NAME (regno) != NULL
&& *REGISTER_NAME (regno) != '\0')
{
char buf[MAX_REGISTER_RAW_SIZE];
int nr_bytes = sim_fetch_register (gdbsim_desc, regno, buf, REGISTER_RAW_SIZE (regno));
int nr_bytes;
if (REGISTER_SIM_REGNO (regno) >= 0)
nr_bytes = sim_fetch_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
buf, REGISTER_RAW_SIZE (regno));
else
nr_bytes = 0;
if (nr_bytes == 0)
/* register not applicable, supply zero's */
memset (buf, 0, MAX_REGISTER_RAW_SIZE);
else if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno)
&& warn_user)
{
printf_unfiltered ("Size of register %s (%d) incorrect (%d instead of %d))",
REGISTER_NAME (regno), regno,
nr_bytes, REGISTER_RAW_SIZE (regno));
fprintf_unfiltered (gdb_stderr,
"Size of register %s (%d/%d) incorrect (%d instead of %d))",
REGISTER_NAME (regno),
regno, REGISTER_SIM_REGNO (regno),
nr_bytes, REGISTER_RAW_SIZE (regno));
warn_user = 0;
}
supply_register (regno, buf);
@ -335,12 +348,16 @@ gdbsim_store_register (regno)
for (regno = 0; regno < NUM_REGS; regno++)
gdbsim_store_register (regno);
}
else if (REGISTER_NAME (regno) != NULL && *REGISTER_NAME (regno) != '\0')
else if (REGISTER_NAME (regno) != NULL
&& *REGISTER_NAME (regno) != '\0'
&& REGISTER_SIM_REGNO (regno) >= 0)
{
char tmp[MAX_REGISTER_RAW_SIZE];
int nr_bytes;
read_register_gen (regno, tmp);
nr_bytes = sim_store_register (gdbsim_desc, regno, tmp, REGISTER_RAW_SIZE (regno));
nr_bytes = sim_store_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
tmp, REGISTER_RAW_SIZE (regno));
if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno))
internal_error ("Register size different to expected");
if (sr_get_debug ())
@ -743,8 +760,11 @@ gdbsim_xfer_inferior_memory (memaddr, myaddr, len, write, target)
if (sr_get_debug ())
{
printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x%x, memaddr 0x%x, len %d, write %d\n",
myaddr, memaddr, len, write);
/* FIXME: Send to something other than STDOUT? */
printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
gdb_print_host_address (myaddr, gdb_stdout);
printf_filtered (", memaddr 0x%s, len %d, write %d\n",
paddr_nz (memaddr), len, write);
if (sr_get_debug () && write)
dump_mem (myaddr, len);
}

View File

@ -708,12 +708,8 @@ vx_add_symbols (name, from_tty, text_addr, data_addr, bss_addr)
free_objfile it. */
objfile_to_front (objfile);
offs = (struct section_offsets *)
alloca (sizeof (struct section_offsets)
+ objfile->num_sections * sizeof (offs->offsets));
memcpy (offs, objfile->section_offsets,
sizeof (struct section_offsets)
+ objfile->num_sections * sizeof (offs->offsets));
offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
memcpy (offs, objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
ss.text_start = 0;
ss.data_start = 0;

View File

@ -1499,13 +1499,8 @@ get_offsets ()
if (symfile_objfile == NULL)
return;
offs = alloca (sizeof (struct section_offsets)
+ symfile_objfile->num_sections
* sizeof (offs->offsets));
memcpy (offs, symfile_objfile->section_offsets,
sizeof (struct section_offsets)
+ symfile_objfile->num_sections
* sizeof (offs->offsets));
offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
ANOFFSET (offs, SECT_OFF_TEXT) = text_addr;
@ -1592,8 +1587,10 @@ remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
sprintf_vma (tmp + strlen (tmp), bss_addr);
fprintf_filtered (gdb_stdlog, tmp);
fprintf_filtered (gdb_stdlog,
"Reloc offset: text = 0x%x data = 0x%x bss = 0x%x\n",
(long) *text_offs, (long) *data_offs, (long) *bss_offs);
"Reloc offset: text = 0x%s data = 0x%s bss = 0x%s\n",
paddr_nz (*text_offs),
paddr_nz (*data_offs),
paddr_nz (*bss_offs));
}
return 0;
@ -1619,15 +1616,8 @@ remote_cisco_objfile_relocate (text_off, data_off, bss_off)
broken for xcoff, dwarf, sdb-coff, etc. But there is no
simple canonical representation for this stuff. */
offs = ((struct section_offsets *)
alloca (sizeof (struct section_offsets)
+ (symfile_objfile->num_sections
* sizeof (offs->offsets))));
memcpy (offs, symfile_objfile->section_offsets,
(sizeof (struct section_offsets)
+ (symfile_objfile->num_sections
* sizeof (offs->offsets))));
offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
ANOFFSET (offs, SECT_OFF_TEXT) = text_off;
ANOFFSET (offs, SECT_OFF_DATA) = data_off;
@ -2389,7 +2379,7 @@ Packet: '%s'\n",
if (symfile_objfile == NULL)
{
warning ("Relocation packet recieved with no symbol file. \
warning ("Relocation packet received with no symbol file. \
Packet Dropped");
goto got_status;
}
@ -3453,7 +3443,7 @@ putpkt_binary (buf, cnt)
*p = '\0';
fprintf_unfiltered (gdb_stdlog, "Sending packet: ");
fputstrn_unfiltered (buf2, p - buf2, 0, gdb_stdlog);
fprintf_unfiltered (gdb_stdlog, "...", buf2);
fprintf_unfiltered (gdb_stdlog, "...");
gdb_flush (gdb_stdlog);
}
if (SERIAL_WRITE (remote_desc, buf2, p - buf2))
@ -3994,7 +3984,6 @@ remote_remove_breakpoint (addr, contents_cache)
CORE_ADDR addr;
char *contents_cache;
{
char buf[PBUFSIZ];
int bp_size;
if ((remote_protocol_Z.support == PACKET_ENABLE)
@ -4040,7 +4029,7 @@ remote_insert_watchpoint (addr, len, type)
p = strchr (buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
sprintf (p, ",%lx", len);
sprintf (p, ",%x", len);
putpkt (buf);
getpkt (buf, 0);
@ -4063,7 +4052,7 @@ remote_remove_watchpoint (addr, len, type)
p = strchr (buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
sprintf (p, ",%lx", len);
sprintf (p, ",%x", len);
putpkt (buf);
getpkt (buf, 0);
@ -4258,8 +4247,8 @@ compare_sections_command (args, from_tty)
for (target_crc = 0, tmp = &buf[1]; *tmp; tmp++)
target_crc = target_crc * 16 + fromhex (*tmp);
printf_filtered ("Section %s, range 0x%08x -- 0x%08x: ",
sectname, lma, lma + size);
printf_filtered ("Section %s, range 0x%s -- 0x%s: ",
sectname, paddr (lma), paddr (lma + size));
if (host_crc == target_crc)
printf_filtered ("matched.\n");
else
@ -4287,7 +4276,6 @@ remote_query (query_type, buf, outbuf, bufsiz)
int i;
char *buf2 = alloca (PBUFSIZ);
char *p2 = &buf2[0];
char *p = buf;
if (!bufsiz)
error ("null pointer to remote bufer size specified");
@ -4877,7 +4865,6 @@ readsocket ()
static int
readtty ()
{
int status;
int tty_bytecount;
/* First, read a buffer full from the terminal */

View File

@ -343,9 +343,7 @@ vmap_symtab (vp)
objfile = symfile_objfile;
}
new_offsets = alloca
(sizeof (struct section_offsets)
+ sizeof (new_offsets->offsets) * objfile->num_sections);
new_offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
for (i = 0; i < objfile->num_sections; ++i)
ANOFFSET (new_offsets, i) = ANOFFSET (objfile->section_offsets, i);

View File

@ -1281,7 +1281,6 @@ frame_get_saved_regs (fi, fdatap)
struct frame_info *fi;
struct rs6000_framedata *fdatap;
{
int ii;
CORE_ADDR frame_addr;
struct rs6000_framedata work_fdata;
@ -1806,8 +1805,6 @@ show_current_variant ()
static void
set_processor (char *arg, int from_tty)
{
int i;
if (!arg || arg[0] == '\0')
{
list_variants ();

View File

@ -145,7 +145,7 @@ scm_ipruk (hdr, ptr, stream)
if (SCM_CELLP (ptr))
fprintf_filtered (stream, " (0x%lx . 0x%lx) @",
(long) SCM_CAR (ptr), (long) SCM_CDR (ptr));
fprintf_filtered (stream, " 0x%x>", ptr);
fprintf_filtered (stream, " 0x%s>", paddr_nz (ptr));
}
void
@ -217,7 +217,7 @@ taloop:
(sizet) LENGTH (name),
port);
#endif
fprintf_filtered (stream, " #X%lX>", svalue);
fprintf_filtered (stream, " #X%s>", paddr_nz (svalue));
break;
}
case scm_tcs_cons_imcar:

View File

@ -274,7 +274,7 @@ pipe_readchar (scb, timeout)
else if (timeout == 0)
{
status == SERIAL_TIMEOUT;
status = SERIAL_TIMEOUT;
break;
}
}

View File

@ -281,7 +281,7 @@ tcp_readchar (scb, timeout)
else if (timeout == 0)
{
status == SERIAL_TIMEOUT;
status = SERIAL_TIMEOUT;
break;
}
}

View File

@ -199,7 +199,7 @@ static int hex (char);
static char *mem2hex (char *, char *, int);
static char *hex2mem (char *, char *, int);
static int hexToInt (char **, int *);
static unsigned char *getpacket (unsigned char *);
static unsigned char *getpacket (void);
static void putpacket (char *);
static void handle_buserror (void);
static int computeSignal (int exceptionVector);
@ -277,8 +277,8 @@ int registers[NUMREGBYTES / 4];
stepData instrBuffer;
char stepped;
static const char hexchars[] = "0123456789abcdef";
char remcomInBuffer[BUFMAX];
char remcomOutBuffer[BUFMAX];
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
char highhex(int x)
{
@ -383,9 +383,9 @@ hexToInt (char **ptr, int *intValue)
/* scan for the sequence $<data>#<checksum> */
char *
getpacket (buffer)
char *buffer;
getpacket ()
{
unsigned char *buffer = &remcomInBuffer[0];
unsigned char checksum;
unsigned char xmitcsum;
int count;
@ -689,7 +689,7 @@ gdb_handle_exception (int exceptionVector)
while (1)
{
remcomOutBuffer[0] = 0;
ptr = getpacket (remcomInBuffer);
ptr = getpacket ();
switch (*ptr++)
{

View File

@ -640,67 +640,67 @@ sh_show_regs (args, from_tty)
if (cpu == bfd_mach_sh4)
cpu = bfd_mach_sh3;
printf_filtered ("PC=%08x SR=%08x PR=%08x MACH=%08x MACHL=%08x\n",
read_register (PC_REGNUM),
read_register (SR_REGNUM),
read_register (PR_REGNUM),
read_register (MACH_REGNUM),
read_register (MACL_REGNUM));
printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
paddr (read_register (PC_REGNUM)),
(long) read_register (SR_REGNUM),
(long) read_register (PR_REGNUM),
(long) read_register (MACH_REGNUM),
(long) read_register (MACL_REGNUM));
printf_filtered ("GBR=%08x VBR=%08x",
read_register (GBR_REGNUM),
read_register (VBR_REGNUM));
printf_filtered ("GBR=%08lx VBR=%08lx",
(long) read_register (GBR_REGNUM),
(long) read_register (VBR_REGNUM));
if (cpu == bfd_mach_sh3 || cpu == bfd_mach_sh3e)
{
printf_filtered (" SSR=%08x SPC=%08x",
read_register (SSR_REGNUM),
read_register (SPC_REGNUM));
printf_filtered (" SSR=%08lx SPC=%08lx",
(long) read_register (SSR_REGNUM),
(long) read_register (SPC_REGNUM));
if (cpu == bfd_mach_sh3e)
{
printf_filtered (" FPUL=%08x FPSCR=%08x",
read_register (FPUL_REGNUM),
read_register (FPSCR_REGNUM));
printf_filtered (" FPUL=%08lx FPSCR=%08lx",
(long) read_register (FPUL_REGNUM),
(long) read_register (FPSCR_REGNUM));
}
}
printf_filtered ("\nR0-R7 %08x %08x %08x %08x %08x %08x %08x %08x\n",
read_register (0),
read_register (1),
read_register (2),
read_register (3),
read_register (4),
read_register (5),
read_register (6),
read_register (7));
printf_filtered ("R8-R15 %08x %08x %08x %08x %08x %08x %08x %08x\n",
read_register (8),
read_register (9),
read_register (10),
read_register (11),
read_register (12),
read_register (13),
read_register (14),
read_register (15));
printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (0),
(long) read_register (1),
(long) read_register (2),
(long) read_register (3),
(long) read_register (4),
(long) read_register (5),
(long) read_register (6),
(long) read_register (7));
printf_filtered ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (8),
(long) read_register (9),
(long) read_register (10),
(long) read_register (11),
(long) read_register (12),
(long) read_register (13),
(long) read_register (14),
(long) read_register (15));
if (cpu == bfd_mach_sh3e)
{
printf_filtered ("FP0-FP7 %08x %08x %08x %08x %08x %08x %08x %08x\n",
read_register (FP0_REGNUM + 0),
read_register (FP0_REGNUM + 1),
read_register (FP0_REGNUM + 2),
read_register (FP0_REGNUM + 3),
read_register (FP0_REGNUM + 4),
read_register (FP0_REGNUM + 5),
read_register (FP0_REGNUM + 6),
read_register (FP0_REGNUM + 7));
printf_filtered ("FP8-FP15 %08x %08x %08x %08x %08x %08x %08x %08x\n",
read_register (FP0_REGNUM + 8),
read_register (FP0_REGNUM + 9),
read_register (FP0_REGNUM + 10),
read_register (FP0_REGNUM + 11),
read_register (FP0_REGNUM + 12),
read_register (FP0_REGNUM + 13),
read_register (FP0_REGNUM + 14),
read_register (FP0_REGNUM + 15));
printf_filtered ("FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (FP0_REGNUM + 0),
(long) read_register (FP0_REGNUM + 1),
(long) read_register (FP0_REGNUM + 2),
(long) read_register (FP0_REGNUM + 3),
(long) read_register (FP0_REGNUM + 4),
(long) read_register (FP0_REGNUM + 5),
(long) read_register (FP0_REGNUM + 6),
(long) read_register (FP0_REGNUM + 7));
printf_filtered ("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (FP0_REGNUM + 8),
(long) read_register (FP0_REGNUM + 9),
(long) read_register (FP0_REGNUM + 10),
(long) read_register (FP0_REGNUM + 11),
(long) read_register (FP0_REGNUM + 12),
(long) read_register (FP0_REGNUM + 13),
(long) read_register (FP0_REGNUM + 14),
(long) read_register (FP0_REGNUM + 15));
}
}

View File

@ -119,12 +119,16 @@ static void sol_core_close PARAMS ((int quitting));
static void init_sol_thread_ops PARAMS ((void));
static void init_sol_core_ops PARAMS ((void));
#define THREAD_FLAG 0x80000000
#define is_thread(ARG) (((ARG) & THREAD_FLAG) != 0)
#define is_lwp(ARG) (((ARG) & THREAD_FLAG) == 0)
#define GET_LWP(LWP_ID) (TIDGET(LWP_ID))
#define GET_THREAD(THREAD_ID) (((THREAD_ID) >> 16) & 0x7fff)
#define BUILD_LWP(LWP_ID, PID) ((LWP_ID) << 16 | (PID))
/* Default definitions: These must be defined in tm.h
if they are to be shared with a process module such as procfs. */
#define THREAD_FLAG 0x80000000
#define is_thread(ARG) (((ARG) & THREAD_FLAG) != 0)
#define is_lwp(ARG) (((ARG) & THREAD_FLAG) == 0)
#define GET_LWP(PID) TIDGET (PID)
#define GET_THREAD(PID) (((PID) >> 16) & 0x7fff)
#define BUILD_LWP(TID, PID) ((TID) << 16 | (PID))
#define BUILD_THREAD(THREAD_ID, PID) (THREAD_FLAG | BUILD_LWP (THREAD_ID, PID))
/* Pointers to routines from lithread_db resolved by dlopen() */
@ -492,6 +496,7 @@ sol_thread_detach (args, from_tty)
char *args;
int from_tty;
{
inferior_pid = PIDGET (main_ph.pid);
unpush_target (&sol_thread_ops);
procfs_ops.to_detach (args, from_tty);
}
@ -987,30 +992,40 @@ typedef size_t gdb_ps_size_t;
by the time we call anything in thread_db, these routines need to do
nothing. */
/* Process stop */
ps_err_e
ps_pstop (gdb_ps_prochandle_t ph)
{
return PS_OK;
}
/* Process continue */
ps_err_e
ps_pcontinue (gdb_ps_prochandle_t ph)
{
return PS_OK;
}
/* LWP stop */
ps_err_e
ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid)
{
return PS_OK;
}
/* LWP continue */
ps_err_e
ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid)
{
return PS_OK;
}
/* Looks up the symbol LD_SYMBOL_NAME in the debugger's symbol table. */
ps_err_e
ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name,
const char *ld_symbol_name, paddr_t * ld_symbol_addr)
@ -1071,6 +1086,8 @@ rw_common (int dowrite, const struct ps_prochandle *ph, paddr_t addr,
return PS_OK;
}
/* Copies SIZE bytes from target process .data segment to debugger memory. */
ps_err_e
ps_pdread (gdb_ps_prochandle_t ph, paddr_t addr,
gdb_ps_read_buf_t buf, gdb_ps_size_t size)
@ -1078,6 +1095,8 @@ ps_pdread (gdb_ps_prochandle_t ph, paddr_t addr,
return rw_common (0, ph, addr, buf, size);
}
/* Copies SIZE bytes from debugger memory .data segment to target process. */
ps_err_e
ps_pdwrite (gdb_ps_prochandle_t ph, paddr_t addr,
gdb_ps_write_buf_t buf, gdb_ps_size_t size)
@ -1085,6 +1104,8 @@ ps_pdwrite (gdb_ps_prochandle_t ph, paddr_t addr,
return rw_common (1, ph, addr, (char *) buf, size);
}
/* Copies SIZE bytes from target process .text segment to debugger memory. */
ps_err_e
ps_ptread (gdb_ps_prochandle_t ph, paddr_t addr,
gdb_ps_read_buf_t buf, gdb_ps_size_t size)
@ -1092,6 +1113,8 @@ ps_ptread (gdb_ps_prochandle_t ph, paddr_t addr,
return rw_common (0, ph, addr, buf, size);
}
/* Copies SIZE bytes from debugger memory .text segment to target process. */
ps_err_e
ps_ptwrite (gdb_ps_prochandle_t ph, paddr_t addr,
gdb_ps_write_buf_t buf, gdb_ps_size_t size)
@ -1099,7 +1122,7 @@ ps_ptwrite (gdb_ps_prochandle_t ph, paddr_t addr,
return rw_common (1, ph, addr, (char *) buf, size);
}
/* Get integer regs */
/* Get integer regs for LWP */
ps_err_e
ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
@ -1122,7 +1145,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
return PS_OK;
}
/* Set integer regs */
/* Set integer regs for LWP */
ps_err_e
ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
@ -1145,6 +1168,8 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
return PS_OK;
}
/* Log a message (sends to gdb_stderr). */
void
ps_plog (const char *fmt,...)
{
@ -1229,7 +1254,7 @@ ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
return PS_OK;
}
/* Get floating-point regs. */
/* Get floating-point regs for LWP */
ps_err_e
ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
@ -1252,7 +1277,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
return PS_OK;
}
/* Set floating-point regs. */
/* Set floating-point regs for LWP */
ps_err_e
ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
@ -1286,6 +1311,8 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
static int nldt_allocated = 0;
static struct ssd *ldt_bufp = NULL;
/* Reads the local descriptor table of a LWP. */
ps_err_e
ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid,
struct ssd *pldt)
@ -1391,7 +1418,7 @@ sol_find_new_threads_callback (th, ignored)
return 0;
}
void
static void
sol_find_new_threads ()
{
/* don't do anything if init failed to resolve the libthread_db library */

View File

@ -52,13 +52,13 @@ static void
som_symtab_read PARAMS ((bfd *, struct objfile *,
struct section_offsets *));
static struct section_offsets *
static void
som_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
/* FIXME: These should really be in a common header somewhere */
extern void
hpread_build_psymtabs PARAMS ((struct objfile *, struct section_offsets *, int));
hpread_build_psymtabs PARAMS ((struct objfile *, int));
extern void
hpread_symfile_finish PARAMS ((struct objfile *));
@ -398,7 +398,7 @@ som_symfile_read (objfile, mainline)
This builds the psymtab. This used to be done via a scan of
the DNTT, but is now done via the PXDB-built quick-lookup tables
together with a scan of the GNTT. See hp-psymtab-read.c. */
hpread_build_psymtabs (objfile, objfile->section_offsets, mainline);
hpread_build_psymtabs (objfile, mainline);
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile.
@ -459,27 +459,24 @@ som_symfile_init (objfile)
Plain and simple for now. */
static struct section_offsets *
static void
som_symfile_offsets (objfile, addr)
struct objfile *objfile;
CORE_ADDR addr;
{
struct section_offsets *section_offsets;
int i;
objfile->num_sections = SECT_OFF_MAX;
section_offsets = (struct section_offsets *)
objfile->section_offsets = (struct section_offsets *)
obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
/* First see if we're a shared library. If so, get the section
offsets from the library, else get them from addr. */
if (!som_solib_section_offsets (objfile, section_offsets))
if (!som_solib_section_offsets (objfile, objfile->section_offsets))
{
for (i = 0; i < SECT_OFF_MAX; i++)
ANOFFSET (section_offsets, i) = addr;
ANOFFSET (objfile->section_offsets, i) = addr;
}
return section_offsets;
}
/* Read in and initialize the SOM import list which is present

View File

@ -1311,19 +1311,12 @@ list_command (arg, from_tty)
error ("No default source file yet. Do \"help list\".");
else if (no_end)
{
if (lines_to_list % 2 == 0)
print_source_lines (sal.symtab,
max (sal.line - (lines_to_list / 2), 1),
sal.line + (lines_to_list / 2), 0);
else
/* If lines_to_list is odd, then we round down in
* one of the lines_to_list/2 computations, round up in
* the other, so the total window size around the specified
* line comes out right.
*/
print_source_lines (sal.symtab,
max (sal.line - (lines_to_list / 2), 1),
sal.line + ((1 + lines_to_list) / 2), 0);
int first_line = sal.line - lines_to_list / 2;
if (first_line < 1) first_line = 1;
print_source_lines (sal.symtab, first_line, first_line + lines_to_list,
0);
}
else
print_source_lines (sal.symtab, sal.line,

View File

@ -62,9 +62,6 @@
*
* ? What was the last sigval ? SNN (signal NN)
*
* bBB..BB Set baud rate to BB..BB OK or BNN, then sets
* baud rate
*
* All commands and responses are sent with a packet which includes a
* checksum. A packet consists of
*
@ -284,12 +281,15 @@ hex(ch)
return -1;
}
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/* scan for the sequence $<data>#<checksum> */
unsigned char *
getpacket (buffer)
unsigned char *buffer;
getpacket ()
{
unsigned char *buffer = &remcomInBuffer[0];
unsigned char checksum;
unsigned char xmitcsum;
int count;
@ -382,9 +382,6 @@ putpacket(buffer)
while (getDebugChar() != '+');
}
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/* Indicate to caller of mem2hex or hex2mem that there has been an
error. */
static volatile int mem_err = 0;
@ -653,7 +650,7 @@ handle_exception (registers)
{
remcomOutBuffer[0] = 0;
ptr = getpacket(remcomInBuffer);
ptr = getpacket();
switch (*ptr++)
{
case '?':
@ -769,43 +766,6 @@ handle_exception (registers)
asm ("call 0
nop ");
break;
#if 0
Disabled until we can unscrew this properly
case 'b': /* bBB... Set baud rate to BB... */
{
int baudrate;
extern void set_timer_3();
if (!hexToInt(&ptr, &baudrate))
{
strcpy(remcomOutBuffer,"B01");
break;
}
/* Convert baud rate to uart clock divider */
switch (baudrate)
{
case 38400:
baudrate = 16;
break;
case 19200:
baudrate = 33;
break;
case 9600:
baudrate = 65;
break;
default:
strcpy(remcomOutBuffer,"B02");
goto x1;
}
putpacket("OK"); /* Ack before changing speed */
set_timer_3(baudrate); /* Set it */
}
x1: break;
#endif
} /* switch */
/* reply to the request */

View File

@ -64,9 +64,6 @@
*
* ? What was the last sigval ? SNN (signal NN)
*
* bBB..BB Set baud rate to BB..BB OK or BNN, then sets
* baud rate
*
* All commands and responses are sent with a packet which includes a
* checksum. A packet consists of
*
@ -380,12 +377,15 @@ hex(ch)
return -1;
}
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/* scan for the sequence $<data>#<checksum> */
unsigned char *
getpacket (buffer)
unsigned char *buffer;
getpacket ()
{
unsigned char *buffer = &remcomInBuffer[0];
unsigned char checksum;
unsigned char xmitcsum;
int count;
@ -478,9 +478,6 @@ putpacket(buffer)
while (getDebugChar() != '+');
}
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/* Indicate to caller of mem2hex or hex2mem that there has been an
error. */
static volatile int mem_err = 0;
@ -796,7 +793,7 @@ handle_exception (registers)
{
remcomOutBuffer[0] = 0;
ptr = getpacket(remcomInBuffer);
ptr = getpacket();
switch (*ptr++)
{
case '?':
@ -936,43 +933,6 @@ handle_exception (registers)
asm ("call 0
nop ");
break;
#if 0
Disabled until we can unscrew this properly
case 'b': /* bBB... Set baud rate to BB... */
{
int baudrate;
extern void set_timer_3();
if (!hexToInt(&ptr, &baudrate))
{
strcpy(remcomOutBuffer,"B01");
break;
}
/* Convert baud rate to uart clock divider */
switch (baudrate)
{
case 38400:
baudrate = 16;
break;
case 19200:
baudrate = 33;
break;
case 9600:
baudrate = 65;
break;
default:
strcpy(remcomOutBuffer,"B02");
goto x1;
}
putpacket("OK"); /* Ack before changing speed */
set_timer_3(baudrate); /* Set it */
}
x1: break;
#endif
} /* switch */
/* reply to the request */

View File

@ -65,9 +65,6 @@
*
* ? What was the last sigval ? SNN (signal NN)
*
* bBB..BB Set baud rate to BB..BB OK or BNN, then sets
* baud rate
*
* All commands and responses are sent with a packet which includes a
* checksum. A packet consists of
*
@ -450,12 +447,15 @@ hex(ch)
return -1;
}
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/* scan for the sequence $<data>#<checksum> */
unsigned char *
getpacket (buffer)
unsigned char *buffer;
getpacket ()
{
unsigned char *buffer = &remcomInBuffer[0];
unsigned char checksum;
unsigned char xmitcsum;
int count;
@ -548,9 +548,6 @@ putpacket(buffer)
while (getDebugChar() != '+');
}
static char remcomInBuffer[BUFMAX];
static char remcomOutBuffer[BUFMAX];
/* Indicate to caller of mem2hex or hex2mem that there has been an
error. */
static volatile int mem_err = 0;
@ -881,7 +878,7 @@ handle_exception (registers)
{
remcomOutBuffer[0] = 0;
ptr = getpacket(remcomInBuffer);
ptr = getpacket();
switch (*ptr++)
{
case '?':
@ -1039,43 +1036,6 @@ handle_exception (registers)
asm ("call 0
nop ");
break;
#if 0
Disabled until we can unscrew this properly
case 'b': /* bBB... Set baud rate to BB... */
{
int baudrate;
extern void set_timer_3();
if (!hexToInt(&ptr, &baudrate))
{
strcpy(remcomOutBuffer,"B01");
break;
}
/* Convert baud rate to uart clock divider */
switch (baudrate)
{
case 38400:
baudrate = 16;
break;
case 19200:
baudrate = 33;
break;
case 9600:
baudrate = 65;
break;
default:
strcpy(remcomOutBuffer,"B02");
goto x1;
}
putpacket("OK"); /* Ack before changing speed */
set_timer_3(baudrate); /* Set it */
}
x1: break;
#endif
} /* switch */
/* reply to the request */

View File

@ -187,11 +187,6 @@ struct stab_section_list
/* Functions exported by dbxread.c. These are not in stabsread.c because
they are only used by some stabs readers. */
extern struct partial_symtab *
start_psymtab PARAMS ((struct objfile *, struct section_offsets *, char *,
CORE_ADDR, int, struct partial_symbol **,
struct partial_symbol **));
extern struct partial_symtab *
end_psymtab PARAMS ((struct partial_symtab * pst,
char **include_list,

View File

@ -457,23 +457,20 @@ find_lowest_section (abfd, sect, obj)
don't need to do anything special. It allocates a section_offsets table
for the objectfile OBJFILE and stuffs ADDR into all of the offsets. */
struct section_offsets *
void
default_symfile_offsets (objfile, addr)
struct objfile *objfile;
CORE_ADDR addr;
{
struct section_offsets *section_offsets;
int i;
objfile->num_sections = SECT_OFF_MAX;
section_offsets = (struct section_offsets *)
objfile->section_offsets = (struct section_offsets *)
obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
memset (section_offsets, 0, SIZEOF_SECTION_OFFSETS);
memset (objfile->section_offsets, 0, SIZEOF_SECTION_OFFSETS);
for (i = 0; i < SECT_OFF_MAX; i++)
ANOFFSET (section_offsets, i) = addr;
return section_offsets;
ANOFFSET (objfile->section_offsets, i) = addr;
}
@ -563,8 +560,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
(*objfile->sf->sym_init) (objfile);
clear_complaints (1, verbo);
section_offsets = (*objfile->sf->sym_offsets) (objfile, addr);
objfile->section_offsets = section_offsets;
(*objfile->sf->sym_offsets) (objfile, addr);
#ifndef IBM6000_TARGET
/* This is a SVR4/SunOS specific hack, I think. In any event, it
@ -1193,7 +1189,7 @@ generic_load (filename, from_tty)
{
unsigned long entry;
entry = bfd_get_start_address (loadfile_bfd);
printf_filtered ("Start address 0x%lx , load size %d\n", entry, data_count);
printf_filtered ("Start address 0x%lx , load size %ld\n", entry, data_count);
/* We were doing this in remote-mips.c, I suspect it is right
for other targets too. */
write_pc (entry);
@ -1219,10 +1215,10 @@ report_transfer_performance (data_count, start_time, end_time)
{
printf_filtered ("Transfer rate: ");
if (end_time != start_time)
printf_filtered ("%d bits/sec",
printf_filtered ("%ld bits/sec",
(data_count * 8) / (end_time - start_time));
else
printf_filtered ("%d bits in <1 sec", (data_count * 8));
printf_filtered ("%ld bits in <1 sec", (data_count * 8));
printf_filtered (".\n");
}
@ -1379,7 +1375,6 @@ reread_symbols ()
struct cleanup *old_cleanups;
struct section_offsets *offsets;
int num_offsets;
int section_offsets_size;
char *obfd_filename;
printf_filtered ("`%s' has changed; re-reading symbols.\n",
@ -1418,11 +1413,8 @@ reread_symbols ()
/* Save the offsets, we will nuke them with the rest of the
psymbol_obstack. */
num_offsets = objfile->num_sections;
section_offsets_size =
sizeof (struct section_offsets)
+ sizeof (objfile->section_offsets->offsets) * num_offsets;
offsets = (struct section_offsets *) alloca (section_offsets_size);
memcpy (offsets, objfile->section_offsets, section_offsets_size);
offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
memcpy (offsets, objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
/* Nuke all the state that we will re-read. Much of the following
code which sets things to NULL really is necessary to tell
@ -1479,8 +1471,8 @@ reread_symbols ()
/* We use the same section offsets as from last time. I'm not
sure whether that is always correct for shared libraries. */
objfile->section_offsets = (struct section_offsets *)
obstack_alloc (&objfile->psymbol_obstack, section_offsets_size);
memcpy (objfile->section_offsets, offsets, section_offsets_size);
obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
memcpy (objfile->section_offsets, offsets, SIZEOF_SECTION_OFFSETS);
objfile->num_sections = num_offsets;
/* What the hell is sym_new_init for, anyway? The concept of
@ -2037,10 +2029,7 @@ again2:
/* Allocate and partially fill a partial symtab. It will be
completely filled at the end of the symbol list.
SYMFILE_NAME is the name of the symbol-file we are reading from, and ADDR
is the address relative to which its symbols are (incremental) or 0
(normal). */
FILENAME is the name of the symbol-file we are reading from. */
struct partial_symtab *
start_psymtab_common (objfile, section_offsets,

Some files were not shown because too many files have changed in this diff Show More