hp merge changes -- too numerous to mention here; see ChangeLog and

ChangeLog-gdbtk for details.
This commit is contained in:
David Taylor 1998-12-28 23:06:13 +00:00
parent d6fdf61c78
commit 4ef1f46773
68 changed files with 7667 additions and 859 deletions

View file

@ -1,3 +1,859 @@
Mon Dec 28 17:43:36 1998 David Taylor <taylor@texas.cygnus.com>
The following changes were made by Jim Blandy <jimb@cygnus.com>,
Edith Epstein <eepstein@cygnus.com>, Elena Zannoni
<ezannoni@cygnus.com> Stan Shebs <shebs@cygnus.com>, and David
Taylor <taylor@cygnus.com>, as part of the project to merge in
changes originally made by HP; HP did not create ChangeLog
entries.
* c-lang.h(cp_print_value_fields): update prototype; fixed
prototype decl for c_val_print funct -- it needed an
embedded_offset param; fixed prototype of cp_print_value_fields.
include value.h.
(C_LANG_H): define.
* c-valprint.c (c_val_print): added new parameter embedded_offset.
Add embedded_offset to valaddr in function calls. fix calls to
val_print, and cp_print_value_fields. Attempt to determine the
real type of the object to be printed. fixed call to
cp_print_value_fields. process TYPE_CODE_METHOD as well. moved
call to check_typedef out of conditional. added embedded offset
param to val_print call
(c_value_print): add new parameter to call to val_print. handle
pointer to class case. ensure that const char *, const unsigned
char * come out without the type but the volatile variants and the
signed variants don't.
* ch-lang.h: HP merge, 4/15/98 snapshot
Added a parameter to the chill_val_print funct decl
* ch-valprint.c: HP merge, 4/15/98 snapshot
The various print routines have an additional
parameter. Currently, the new parameter is only
used when printing C++ expressions. So, in
ch-valprint.c, the new parameter is always 0.
Changes in calls to : val_print, chill_val_print, c_val_print
Affected functions : chill_val_print_array_elements,
chill_val_print, chill_print_value_fields,
chill_value_print
* cp-valprint.c added vtable pointers names for aCC (HP) compiler.
(cp_print_class_method): print message for HP/aCC case.
(cp_print_class_member): add comments.
(cp_print_value): adjust address computations for virtual base
classes. added new parameter 'offset'. Find correct offset for
base class in HP/aCC case. Change call to cp_print_value_fields
to have extra par.
(cp_print_value_fields): do not print also if the only field is
the vtable pointer. Print out vtable ptr, for HP/aCC compiled
case. do not print leading '=' in case of anonymous union, or
struct. added new parameter 'offset'. Do not print the vtable
pointer as a member, in the HP aCC case. Changed calls to
val_print to have extra parameter.
(cp_print_hpacc_virtual_table_entries): new function. Print vtable
entries, in HP/aCC compiled case.
(cp_print_static_field): change call to cp_print_value_fields, and
val_print.
* d30v-tdep.c:
(d30v_print_register) : added embedded_offset param to val_print
call
* defs.h: additional include files included when TUI is defined.
(gdb_file_isatty): new function decl.
(GDB_FILE): if TUI is defined, define a structure rather
than making this an alias for FILE.
(gdb_stdout, gdb_stderr): if TUI is defined, then define these
as pointers to variables of type GDB_FILE rather than making them
be aliases for stdout and stderr.
(TUIDO): add definition conditionalized on definition
(or lack thereof) of TUI.
(command_class): add two additional values.
(precision_type): new enum.
(gdb_fclose): add declaration.
(store_address): change prototype to match function.
(tui_version, xdb_commands, dbx_commands): add decl's.
(gdb_file_deallocate): new function declaration
(pa_do_strcat_registers_info): new function declaration.
(streamtype): new enumerated type to distinguish between output to
a FILE and output to a buffer.
(tui_stream): new struct type, named GDB_FILE. Contains,
streamtype, FILE, buffer, and bufferlength fields.
(gdb_stdout): of type GDB_FILE, will pass this around gdb rather
than stdout.
(gdb_stderr): of type GDB_FILE, will pass this around gdb rather
than stderr.
(fputs_unfiltered_hook): change stream parameter from FILE to
GDB_FILE
(flush_hook): change stream parameter from FILE to GDB_FILE
(gdb_fclose): Fix declaration for gdb_fclose; parameter is now of
type GDB_FILE **
(gdb_file_adjust_strbuf): new function declaration. function lives
in utils.c.
(gdb_file_init_astring): new function declaration. function lives
in utils.c
(gdb_file_get_strbuf): new function declaration. function lives in
utils.c
(source_full_path_of): declare.
* exec.c (_initialize_exec): make definition of file command be
dependent upon dbx_commands not being set.
(exec_file_attach): new function.
(exec_file_command): call it.
(exec_ops): added new fields to_has_syscall_event,
to_enable_exception_callback, to_get_current_exception_event
to_post_wait, to_post_startup_inferior
to_acknowledge_created_inferior, to_clone_and_follow_inferior,
to_post_follow_inferior_by_clone, to_create_catch_fork_hook,
to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
to_post_follow_vfork, to_pid_to_exec_file
* f-lang.h (f_print_type): change FILE to GDB_FILE in decl.
(f_val_print): ditto.
(f_val_print): added parameter to the funct decl.
* f-valprint.c (_initialize_f_valprint): if xdb_commands is set,
define lc command.
(f77_create_arrayprint_offset_tbl): change FILE to GDB_FILE.
(f77_print_array): ditto.
(f77_print_array_1): ditto.
(f_val_print): ditto.
(f_val_print): Added a parameter; this new parameter is currently
only non-zero when handling C++ expressions. In this file its
value is always 0. changed fflush to gdb_flush.
* gnu-nat.c:
(init_gnu_ops): added and initialized new target ops vector fields
to_require_attach, to_require_detach, to_post_wait,
to_post_startup_inferior, to_acknowledge_created_inferior,
to_clone_and_follow_inferior, to_create_catch_fork_hook,
to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
to_post_follow_vfork, to_pid_to_exec_file
(gnu_create_inferior): add param to fork_inferior call
* hppa-tdep.c (after_prologue): if f is NULL, don't dereference
it. if no debug info, return zero telling caller that we need to
find the end of the prologue via the hard way (instruction
examination).
(find_unwind_entry): avoid dereferencing a null
pointer.
(hppa_pid_to_exec_file): deleted -- no longer used.
(hppa_prepare_to_proceeed): add prototype.
(read_unwind_info): purecov comments, bug fixes.
(find_unwind_entry): purecov comments, bug fixes.
(find_stub_with_shl_get): purecov comments.
(frame_chain): additional parens.
(hppa_push_arguments): changes to commented out version of routine.
(hppa_fix_call_dummy): purecov comments, fix location of end.o.
(in_solib_call_trampoline): purecov comments.
(in_solib_return_trampoline): purecov comments.
(setup_d_pid_in_inferior): fix location of end.o.
(initialize_hp_cxx_exception_support): fix location of end.o.
(child_enable_exception_callback): purecov comments.
(pa_do_strcat_registers_info): Has a new parameter, precision,
which is passed into the call to pa_strcat_fp_reg to indicate
whether to display the floating point registers using
single or double preceision.
(pa_strcat_registers): Introduce local variable, precision, and
pass it into call to pa_strcat_fp_reg.
(pa_strcat_fp_reg): Modified function. New parameter, precision,
used by function to decide whether to use single or double
precision. Also added the code to put a double precision value
into a buffer.
(pa_do_strcat_registers_info): new routine. called by
tui/tuiRegs.c:_tuiRegisterFormat to place a register name
and value into a string buffer. Interface may change in
future. Checking this in so that we have something
functional for HP.
(pa_strcat_registers): new routine, called by
pa_do_strcat_registers_info. Does same thing as
pa_print_registers except it takes a stream parameter.
This routine should disappear in future. Checking in
so that we have something functional to give HP
(pa_strcat_fp_reg): new routine, called by
pa_do_strcat_registers_info and pa_strvat_registers
to place a floating point register name and value into
a buffer. This interface may change in future.
Checking in so that we have something functional to give HP.
(pa_print_fp_reg): change prototype to match def'n.
(pa_register_look_aside): fix comment immediately before function.
changes to better support stack unwinding, reading and writing
registers for HPUX. New includes : ptrace.h, bfd.h, dl.h.
(internalize_unwinds): initialize new fields in table.
(read_unwind_info): entries in the table are now more complex
structures. References of the form ...->table[index].stub_type are
now ...->table[index].stub_unwind.stub_type.
(find_proc_framesize) : added a check for pc == 0.
(rp_saved): entries in the table are now more complex
structures. References of the form ...->table[index].stub_type are
now ...->table[index].stub_unwind.stub_type.
(frameless_function_invocation): stub_type becomes
stub_unwind.stub_type
(saved_pc_after_call): stub_type becomes stub_unwind.stub_type
(hppa_frame_saved_pc): stub_type becomes stub_unwind.stub_type
(frame_chain_valid): stub_type becomes stub_unwind.stub_type
(hppa_call_dummy): stub_type becomes stub_unwind.stub_type
(pa_print_fp_reg): additional params to call val_print
(in_solib_call_trampoline): stub_type becomes
stub_unwind.stub_type
(in_solib_return_trampoline): stub_type becomes
stub_unwind.stub_typ
(skip_trampoline_code): additional code to handle external
dyncalls. Also stub_type becomes stub_unwind.stub_type
(hppa_pid_to_exec_file): new funct. FOr HPUX 10.0 and beyond there
is an explicit ptrace request for getting the pathname associated
with a process id (pid).
(hppa_pid_to_exec_file): remove unwanted param from call to
call_ptrace.
(args_for_find_stub): new structure.
(find_unwind_entry): deal with null input pc value.
(rp_saved): ditto.
For the import stub, return -24 always.
(hppa_frame_saved_pc): save old pc value, to detect we are in a loop.
(init_extra_frame_info): use TARGET_READ_FP.
(frame_chain): include thread support.
If the caller's pc is zero, we loose and return, just like stack bottom.
Disable warning about being unable to find unwind info.
(hppa_push_arguments): rewrite.
(hppa_value_returned_from_stack): new function. Handles returning a value
larger that 64 bits, stored on the stack.
(find_stub_with_shl_get): new function. To look up symbols in shlibs.
(cover_find_stub_with_shl_get): new function. Cover routine for
find_stub_with_shl_get to pass to catch_errors.
(hppa_fix_call_dummy): comment out old stub mechanism. Rewrite using dyncall.
(target_read_fp): new function.
(pa_do_registers_info): floating point registers start at FP4.
(pa_print_registers): use FP4_REGNUM instead of 72.
(skip_trampoline_code): do machine instruction matching for PA2.0.
(setup_d_pid_in_inferior): new function. Exception handling support.
(initialize_hp_cxx_exception_support): ditto.
(child_enable_exception_callback): ditto.
(child_get_current_exception_event): ditto.
* hpux-thread.c
(hpux_thread_ops): initializing new target ops vector fields.
to_require_attach, to_require_detach, to_post_wait,
to_post_startup_inferior, to_acknowledge_created_inferior,
to_clone_and_follow_inferior, to_create_catch_fork_hook,
to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
to_post_follow_vfork, to_pid_to_exec_file.
* infcmd.c
Include objfiles.h
(attach_command): new local variable, exec_file, added code to
determine exec_file from pid if exec_file is not already known,
call new target operation, target_post_attach -- a no-op unless
on HPUXHPPA
(detach_command): after detaching, do a SOLIB_RESTART
(objfiles.h): fix typo on include line.
(run_command): only call SOLIB_RESTART if it's defined.
(detach_command): ditto.
(run_command): If program has already been started, and decide
to restart it, the kill the target, fluch the caches,
call init_wait_for_inferior. Also purge old solib objfiles.
(run_stack_dummy): add calls to
disable_watchpoints_before_interactive_call_start and
enable_watchpoints_after_interactive_call_stops
(finish_command): alter code handling the evaluation and printing
of the target function's return value.
(attach_command): when given a pid, but no exec file, try to
determine the exec file from the process. If the process does not
record a full path name, try to qualify the filename against the
source path.
(_initialize_infcmd): add some verbiage about how to use the
attach command
(do_registers_info): changed calls to val_print
made the symfile.h include preceed the
objfiles.h include. The other ordering caused a
compile problem (incompletely defined types).
* inftarg.c (child_post_attach): Fix declaration, make static.
(proc_wait): Make globally visible.
(child_insert_fork_catchpoint, etc): Fix return type.
(child_detach_from_process): declare.
(child_attach_to_process): declare.
(child_stop): make static to match declaration.
(ptrace_him): change prototype back to return int.
(ptrace_me): Remove debug output, pass NULL to fork_inferior if
not HPUX.
(child_require_attach): new funct prototype and definition
(child_require_detach): new funct prototype and definition
(proc_wait): funct prototype and definition are enclosed by
proc_wait ifndef
(child_attach_to_process): new function, does most of the work
that child_attach used to do and some additional work to determine
whether gdb is already attached to the target how to react.
(child_attach): altered. It's now a wrapper for
child_attach_to_process.
(child_require_attach): new function, called if should attach even
when gdb is already attached to target.
(child_detach_from_process): new function, does most of the work
that child_detach used to do and some additional work to determine
whether gdb is currently attached to the target.
(child_detach): altered. It's now a wrapper for
child_detach_from_process.
(child_require_detach): new function, called if should try to
detach even when gdb is not attached to target.
(ptrace_him): calls a new function,
target_acknowledge_forked_child. Currently,
target_acknowledge_forked_child, is only defined to do something
for HPUX.
(child_create_inferior): changed call to fork_inferior.
(child_ops): added to_require_attach and to_require_detach fields
to the child_ops target ops vector.
Some hacks for ttrace work
(child_wait): Additional local variables, additional code in
while loop to check for : process exited, process forked,
process vforked, process execd
(child_thread_alive): John B. seems to think that the kill
call is inapproapriate for HPUX.
(child_attach_to_process): using strtol rather than atoi.
no longer check for case where there is no known exec file.
(child_post_attach): new function, a default, a no-op
(child_insert_fork_catchpoint): new function, a default, a no-op
(child_remove_fork_catchpoint): new function, a default, a no-op
(child_insert_vfork_catchpoint): new function, a default, a no-op
(child_remove_vfork_catchpoint): new function, a default, a no-op
(child_can_follow_vfork_prior_to_exec ):new function, a default,
a no-op
(child_insert_exec_catchpoint): new function, a default, a no-op
(child_remove_exec_catchpoint): new function, a default, a no-op
(child_has_execd): new function, a default, returns 0
(child_reported_exec_events_per_exec_call): new function, a
default, returns 1
(child_has_exited): new function, a default.
(child_core_file_to_sym_file): new function, a default, returns NULL.
(child_ops): initialize new target_ops vector fields to the
child* functions.
* jv-lang.h:
(java_val_print): added embedded_offset param to func decl.
* jv-valprint.c: changing calls to val_print to accomodate new param.
(java_value_print): add embedded_offset param to val_print call
(java_print_value_fields): add embedded_offset param to val_print
call
(java_val_print): add embedded_offset param. alter call to
c_val_print to accomodate embedded_offset param.
* language.c (lang_bool_type): return builtin_type_bool in c++
case.
(unk_lang_val_print): Added embedded_offset param to
prototype declaration and definition.
* language.h:
(LA_VAL_PRINT macro, la_val_print function decl): altered to
accomodate the new parameter to the various print functions.
* m2-lang.h:
(m2_val_print): added a parameter to the func decl.
* m2-valprint.c:
(m2_val_print): added a parameter.
This parameter is currently only used when
evaluating C++ expressions. So, it is
always 0 in this file.
* m3-nat.c:
(m3_create_inferior): add param to fork_inferior call
(m3_pid_to_exec_file): new function
(m3_ops): adding and initializing new target ops vector fields.
* mac-nat.c:
(init_child_ops): adding and initializing new target ops vector
fields to_require_attach, to_require_detach, to_post_wait,
to_post_startup_inferior, to_acknowledge_created_inferior,
to_clone_and_follow_inferior, to_create_catch_fork_hook,
to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
to_post_follow_vfork, to_pid_to_exec_file
* mips-tdep.c: chnages to accomodate additional parameter
to val_print.
(mips_print_register): alter calls to val_print
* monitor.c (monitor_write): change stderr to gdb_stderr.
(monitor_remove_breakpoint): ditto.
* monitor.c:
(init_base_monitor_ops): adding and initializing new target ops
vector fields to_require_attach, to_require_detach,
to_post_wait, to_post_startup_inferior,
to_acknowledge_created_inferior, to_clone_and_follow_inferior,
to_create_catch_fork_hook, to_create_catch_vfork_hook,
to_has_forked, to_has_vforked, to_post_follow_vfork,
to_pid_to_exec_file
* ppc-bdm.c:
(init_bdm_ppc_ops): adding and initializing new target ops vector
fields to_require_attach, to_require_detach, to_post_wait,
to_post_startup_inferior, to_acknowledge_created_inferior,
to_clone_and_follow_inferior, to_create_catch_fork_hook,
to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
to_post_follow_vfork, to_pid_to_exec_file
* printcmd.c
(do_examine): when saving a value_ptr, remove it from
the list of value_ptr's to be freed automatically; when discarding
a previously saved value_ptr, free it.
(print_formatted): update comments; add new comments.
(printf_command, print_insn): purecov comments.
(_initialize_printcmd): add assign as a command if dbx_commands is
set; create va as an alias for disassemble if xdb_commands is set.
(address_info): new cases LOC_INDIRECT and
LOC_THREAD_LOCAL_STATIC.
(display_command): if tui_version and exp starts with a '$', then
don't display it unless tui_vSetLayoutTo fails.
(disassemble_command): add tuiDo calls.
(print_scalar_formatted): for integers that are long long, check
the print format and print out in binary octal, decimal, or
hex. Call the new print_*_chars functions in valprint.c
(print_frame_args): Altered calls to val_print, to reflect
additional parameter to val_print (case LOC_BASEREG_ARG).
* procfs.c:
(procfs_init_inferior): return value is now a void.
(procfs_ops): adding and initializing new target_ops vector fields.
(procfs_create_inferior): fix call to fork_inferior -- need another
parameter.
* remote-adapt.c
(adapt_open): change stderr to gdb_stderr.
(adpat_insert_breakpoint): ditto.
(init_adapt_ops): adding and initializing new target_ops vector fields.
* remote-array.c
(array_wait): change fflush to gdb_flush and stdout to gdb_stdout.
(init_array_ops): adding new and initializing target_ops vector fields.
* remote-bug.c
(bug_load): change fflush to gdb_flush; stdout to gdb_stdout.
(bug_wait): change stderr to gdb_stderr.
(bug_insert_breakpoint): ditto.
(init_bug_ops): adding and initializing new target_ops vector fields.
* remote-e7000.c
(init_e7000_ops): adding and initializing new target_ops vector fields.
* remote-eb.c (init_eb_ops): ditto.
* remote-es.c (init_es1800_ops): ditto.
(init_es1800_child_ops): ditto.
* remote-es.c (init_es1800_ops): ditto.
(init_es1800_child_ops): ditto.
* remote-hms.c (init_hms_ops): ditto.
* remote-hms.c (init_hms_ops): ditto.
* remote-nindy.c (init_nindy_ops): ditto.
* remote-nrom.c (init_nrom_ops): ditto.
* remote-os9k.c (init_rombug_ops): ditto.
* remote-rdp.c (init_remote_rdp_ops): ditto.
* remote-sds.c (init_sds_ops): ditto.
* remote-sim.c (init_gdbsim_ops): ditto.
* remote-st.c (init_st2000_ops): ditto.
* remote-udi.c (init_udi_ops): ditto.
* remote-vx.c (init_vx_ops): ditto.
(init_vx_run_ops): ditto.
* remote-vx.c: (init_vx_ops): ditto.
(init_vx_run_ops): ditto.
* remote.c (init_remote_ops): ditto.
(init_extended_remote_ops): ditto.
* remote-mips.c (mips_getstring): change stderr to gdb_stderr.
(pmon_insert_breakpoint): ditto.
(pmon_remove_breakpoint): ditto.
(check_lsi_error): ditto.
(common_breakpoint): ditto.
(pmon_makeb64): ditto.
* remote-mips.c (mips_xfer_memory): change fflush to gdb_flush;
change stdout to gdb_stdout.
* remote-mm.c
(mm_open): change stderr to gdb_stderr.
(init_mm_ops): adding and initializing new target_ops vector fields.
(mm_load): fixed params in commented out call to symbol_file_add.
* remote-nindy.c (instream): change declaration to FILE.
* remote-udi.c:
(udi_load): fixed params in call to symbol_file_add
* remote-vx.c:
(vx_add_symbols): fixed params in call to symbol_file_add
* remote.c (init_remote_ops): cosmetic change to match expected
test output.
* rs6000-nat.c:
(add_vmap): added params to call to allocate_objfile.
* scm-lang.h : HP merge, 4/15/98 snapshot
Added parameter to the scm_val_print func decl
* scm-valprint.c
* scm-valprint.c (scm_scmval_print): cast svalue to (int); new
parameter. This parameter is currently only used when evaluating
C++ expressions. So, it is always 0 in this file.
(c_val_print): fixed prototype decl; it needed an embedded_offset
param.
* sol-thread.c:
(sol_core_ops): added and initialized new target_ops vector fields.
(sol_thread_ops): ditto.
* somsolib.c (DLD_FLAGS_MAPPRIVATE): new macro.
Define bit of __dld_flags in HP-UX a.out files.
(DLD_FLAGS_HOOKVALID): ditto.
(DLD_FLAGS_LISTVALID): ditto.
(DLD_FLAGS_BOR_ENABLE): ditto.
(som_solib_total_st_size): cumulative size in bytes of the
symbol tables of all shared objects on the so_list_head list.
(som_solib_st_size_threshhold_exceeded): threshold for adding symbols
for shlibs.
(som_solib_sizeof_symbol_table): new function. Computes size of
symbol table for a shlib.
(som_solib_load_symbols): new function. Load symbols from shlib.
(som_solib_add): detect if __dld_list is not valid.
Record main program's symbol table size.
Load symbols if called from command line.
Keep threshold into account when loading shlib symbols.
(som_solib_create_inferior_hook): use dld_flags macros.
(som_sharedlibrary_info_command): let user know if symbols were
not loaded.
(som_solib_restart): discard all the shlibs descriptors.
(_initialize_som_solib): chenge help message for auto-solib-add
command.
Set threshold for symbol table to 50 megabytes.
* somsolib.c (_initialize_som_solib): added call to som_solib_restart.
(som_solib_restart): new function
(som_solib_in_dynamic_linker): new function
(som_solib_desire_dynamic_linker_symbols): new function
(som_solib_unloaded_library_pathname): new function
(som_solib_loaded_library_pathname): new function
(som_solib_library_pathname): new function
(som_solib_have_unload_event): new function
(som_solib_have_load_event): new function
(som_solib_create_catch_unload_hook): new function
(som_solib_create_catch_load_hook): new function
(som_solib_create_inferior_hook): rewritten
dld_cache: new struct
addr_and_unwind_t: new struct
(find_unwind_entry) added prototype
* somsolib.c (som_solib_create_inferior_hook): introduce new local
msymbol2 and change some msymbol's to msymbol2's -- was clobbering
msymbol, passing a NULL to lookup_minimal_symbol_solib_trampoline,
and ultimately core dumping with a SEGV.
* somsolib.c:
Include assert.h
(som_solib_mapped_entry): additional comments for text_addr,
text_link_addr, text_end, and tsd_start_addr fields. Commenting
out 2 tsd fields, __data_start and __data_end.
(som_solib_add_solib_objfile): add params to calls to symbol_file_add.
Add some code for distinguishing between a shared library and other
objfiles. This appears to be a prelude to thread local storage.
(som_solib_load_symbols): changes to printf statement
enclosed by SOLIB_DEBUG ifdef.
(som_solib_add): change comment to correctly specify path
to end.o -- /opt/langtools/lib/end.o. changes to printf statement
enclosed by SOLIB_DEBUG ifdef.
Removed several SOLIB_DEBUG ifdefs and the associated printfs.
Add code to find the start address for the object file's thread
local storage
(som_solib_create_inferior_hook): Fix warning messages use correct
path to end.o -- /opt/langtools/lib/end.o. Change control flow.
No longer user early returns from function is cases of error.
(reset_inferior_pid): new function
(som_solib_remove_inferior_hook): new function
(so_lib_thread_start_addr): new function. used for tsd.
* somsolib.c: Removed references to ASSERT macro.
* somsolib.c: add debugging macro.
(struct som_solib_mapped_entry): add new field tsd_start_addr.
(struct so_list): added new field solib_addr.
(som_solib_add_solib_objfile): new function.
(som_solib_load_symbols): rewritten.
(som_solib_add): make sure we don't load the symbols in if the
threshold was exceeded.
(som_solib_get_solib_by_pc): new function. Return the address of
handle of the shared library.
(som_solib_restart): disable breakpoints at restart.
(_initialize_som_solib): set threshold to 100 megabytes.
* somsolib.c: add include of fcntl.h so that O_RDONLY is defined.
* sparcl-tdep.c:
(init_sparclite_ops): added and initialized new target_ops vector fields.
* target.c (cleanup_target): Changed casting of default functions
for to_has_forked, to_has_vforked, to_pid_to_exec_file to get rid
of warnings. Fixed PARAMS for to_has_syscall_event. Fixed the
return type on a few of the default function values.
(cleanup_target): changes in the de_fault macro, both to
accomodate the new target_ops vector fields and to use
more accurate default functions.
* target.c (debug_to_open): change stderr to gdb_stderr.
(debug_to_close): ditto.
(debug_to_attach): ditto.
(debug_to_post_attach): ditto.
(debug_to_require_attach): ditto.
(debug_to_detach): ditto.
(debug_to_require_detach): ditto.
(debug_to_resume): ditto.
(debug_to_wait): ditto.
(debug_to_post_wait): ditto.
(debug_to_fetch_registers): ditto.
(debug_to_store_registers): ditto.
(debug_to_prepare_to_store): ditto.
(debug_to_xfer_memory): ditto.
(debug_to_files_info): ditto.
(debug_to_insert_breakpoint): ditto.
(debug_to_remove_breakpoint): ditto.
(debug_to_terminal_init): ditto.
(debug_to_terminal_inferior): ditto.
(debug_to_terminal_ours_for_output): ditto.
(debug_to_terminal_ours): ditto.
(debug_to_terminal_info): ditto.
(debug_to_kill): ditto.
(debug_to_load): ditto.
(debug_to_lookup_symbol): ditto.
(debug_to_create_inferior): ditto.
(debug_to_post_startup_inferior): ditto.
(debug_to_acknowledge_created_inferior): ditto.
(debug_to_clone_and_follow_inferior): ditto.
(debug_to_post_follow_inferior_by_clone): ditto.
(debug_to_insert_fork_catchpoint): ditto.
(debug_to_remove_fork_catchpoint): ditto.
(debug_to_insert_vfork_catchpoint): ditto.
(debug_to_remove_vfork_catchpoint): ditto.
(debug_to_has_forked): ditto.
(debug_to_has_vforked): ditto.
(debug_to_can_follow_vfork_prior_to_exec): ditto.
(debug_to_post_follow_vfork): ditto.
(debug_to_insert_exec_catchpoint): ditto.
(debug_to_remove_exec_catchpoint): ditto.
(debug_to_has_execd): ditto.
(debug_to_reported_exec_events_per_exec_call): ditto.
(debug_to_has_syscall_event): ditto.
(debug_to_has_exited): ditto.
(debug_to_mourn_inferior): ditto.
(debug_to_can_run): ditto.
(debug_to_notice_signals): ditto.
(debug_to_thread_alive): ditto.
(debug_to_stop): ditto.
(debug_to_enable_exception_callback): ditto.
(debug_to_get_current_exception_event): ditto.
(debug_to_pid_to_exec_file): ditto.
(debug_to_core_file_to_sym_file): ditto.
* target.c:
(default_clone_and_follow_inferior): new function prototype
declaration and function definition.
(dummy_target): Add new target_ops vector fields and their
initializations. More target_ops vector changes for HPUX new
fields. New fields are to_post_wait, to_post_startup_inferior
to_acknowledge_created_inferior, to_clone_and_follow_inferior,
to_post_follow_inferior_by_clone, to_create_catch_fork_hook,
to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
to_post_follow_vfork, to_pid_to_exec_file.
(de_fault): add new HPUX specific target_ops operations to the
de_fault macro
(INHERIT): added new HPUX specific target_ops operations.
(debug_to_post_wait): new funct
(debug_to_post_startup_inferior): new funct
(debug_to_acknowledge_created_inferior): new funct
(debug_to_clone_and_follow_inferior): new funct
(debug_to_post_follow_inferior_by_clone): new funct
(debug_to_create_catch_fork_hook): new funct
(debug_to_create_catch_vfork_hook): new funct
(debug_to_has_forked): new funct
(debug_to_has_vforked): new funct
(debug_to_post_follow_vfork): new funct
(setup_target_debug): initialize new target_ops vector fields.
* target.c:
(nosupport_runtime): new function, used in cleanup_target
(update_current_target): Added new new target_ops vector fields to
the INHERIT macro definition.
(generic_mourn_inferior): the call to breakpoint_init_inferior now takes a
parameter
(normal_pid_to_str): Adding a \0 to the end of buf.
(debug_to_has_syscall_event): new func
(debug_to_enable_exception_callback): new func
(debug_to_get_current_exception_event): new func
(setup_target_debug): initialize the 3 new target_ops vector fields
* target.c:
(struct signals): fix message associated with SIGRETRACT.
* target.c:
(return_one): new function, used by the de_fault macro
(debug_to_post_attach): new function
(debug_to_wait): added new cases : TARGET_WAITKIND_FORKED,
TARGET_WAITKIND_VFORKED, TARGET_WAITKIND_EXECD.
(debug_to_insert_fork_catchpoint): new function
(debug_to_remove_fork_catchpoint): new function
(debug_to_insert_vfork_catchpoint): new function
(debug_to_remove_vfork_catchpoint): new function
(debug_to_can_follow_vfork_prior_to_exec): new function
(debug_to_insert_exec_catchpoint): new function
(debug_to_remove_exec_catchpoint): new function
(debug_to_core_file_to_sym_file): new function
(setup_target_debug): give new fields in current_target target_ops
vector values.
* target.h:
Include symtab.h
(target_waitkind): new enumerated values :
TARGET_WAITKIND_SYSCALL_ENTRY and TARGET_WAITKIND_SYSCALL_RETURN
(target_waitstatus): add a syscall_id field to structure
(child_has_syscall_event): new decl
(child_thread_alive): new decl
(target_ops): added 3 new fields: to_has_syscall_event,
to_enable_exception_callback, to_get_current_exception_event
(target_enable_exception_callback): new macro
(target_has_syscall_event): new macro
(target_get_current_exception_event): new macro
(TARGET_DISABLE_HW_WATCHPOINTS): new macro
(TARGET_ENABLE_HW_WATCHPOINTS): new macro
(PC_REQUIRES_RUN_BEFORE_USE): new macro
(target_tid_to_str): new macro
* target.h:
(target_waitkind): new entries in enumerated type :
TARGET_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED,
TARGET_WAITKIND_EXECD
(target_waitstatus): additional fields in struct to keep track
of child pid and pathname to execd file
(target_ops): add in the new target_ops function pointer fields.
New macros to go along with new target_ops fields.
New function decls : child_core_file_to_sym_file,
child_post_attach, child_insert_fork_catchpoint,
child_remove_fork_catchpoint, child_insert_vfork_catchpoint,
child_remove_vfork_catchpoint, child_can_follow_vfork_prior_to_exec,
child_insert_exec_catchpoint, child_remove_exec_catchpoint,
child_has_execd, child_has_exited
* target.h:
In target_waitstatus.value, change name of child_pid field to
related_pid.
(target_pid_or_tid_to_str): define default macro
Added missing #endif after PC_REQUIRES_RUN_BEFORE_USE definition
(ENSURE_VFORKING_PARENT_REMAINS_STOPPED): define default macro
(RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK): define default macro
* target.h: HP merge, 4/15/98 snapshot
There are new function declarations for to_require_attach
and to_require_detach. There are also new macros,
target_require_attach and target_require_detach. There are
also new function declarations for find_default_require_detach
and find_default_require_attach. All these changes are ifdef'ed
for HPUX_SNAP1.
* target.h: changes for HPUX specific target_ops vector fields
(target_ops): new fields
to_post_wait, to_post_startup_inferior
to_acknowledge_created_inferior, to_clone_and_follow_inferior,
to_post_follow_inferior_by_clone, to_create_catch_fork_hook,
to_create_catch_vfork_hook, to_has_forked, to_has_vforked,
to_post_follow_vfork, to_pid_to_exec_file
Function prototype definitions for new target_ops operations
New function definitions : child_pid_to_exec_file, child_post_wait,
child_post_startup_inferior, child_acknowledge_created_inferior,
child_clone_and_follow_inferior,
child_post_follow_inferior_by_clone, child_create_catch_fork_hook,
child_create_catch_vfork_hook, child_has_forked, child_has_vforked,
child_acknowledge_created_inferior, child_post_follow_vfork,
New macros : target_post_startup_inferior,
target_acknowledge_created_inferior,
target_clone_and_follow_inferior,
target_post_follow_inferior_by_clone,
target_create_catch_fork_hook,
target_create_catch_vfork_hook,
target_pid_to_exec_file
(find_default_clone_and_follow_inferior): new funct prototype
* target.h: remove HPUX_SNAP1 and HPUX_SNAP2 ifdefs
* txvu-tdep.c:
(txvu_print_register): added embedded_offset param to val_print
call.
* v850ice.c:
(init_850ice_ops): adding and initializing new target_ops vector
fields : to_post_attach, to_post_follow_inferior_by_clone,
to_insert_fork_catchpoint, to_remove_fork_catchpoint,
to_insert_vfork_catchpoint, to_remove_vfork_catchpoint,
to_can_follow_vfork_prior_to_exec, to_insert_exec_catchpoint,
to_remove_exec_catchpoint, to_has_execd,
to_reported_exec_events_per_exec_call, to_has_exited,
to_core_file_to_sym_file
* valprint.c (print_binary_chars): print out long long as
a binary number
(print_octal_chars): print out long long as an octal number
(print_decimal_chars): print out long long as a decimal number
* valprint.c (strcat_longest): define it (from Stan Shebs).
* valprint.c: HP merge, 4/15/98 snapshot
Added parameter to val_print. This is used for
evaluating C++ expressions.
* value.h (VALUE_POINTED_TO_OFFSET): new macro.
Add field pointed_to_offset to value structure.
Add prototypes for new functions in valops.c.
* value.h (write_register_pid): change prototype to match
function.
(val_print func decl): Additional parameter.
(VALUE_EMBEDDED_OFFSET): New macro.
(find_rt_vbase_offset): New func decl -- for C++ support.
* win32-nat.c (child_ops): Remove unneeded settings.
(handle_load_dll): added params to call to symbol_file_add.
(init_child_ops): adding new target_ops vector fields and removing
a few. initializing new target ops vector fields.
Wed Dec 23 15:03:42 1998 Per Bothner <bothner@cygnus.com>
* Makefile.in (READLINE_CFLAGS): Search $(READLINE_SRC)/.. rather

View file

@ -1,3 +1,26 @@
Mon Dec 28 17:44:36 1998 David Taylor <taylor@texas.cygnus.com>
The following changes were made by Jim Blandy <jimb@cygnus.com>,
Edith Epstein <eepstein@cygnus.com>, Elena Zannoni
<ezannoni@cygnus.com> Stan Shebs <shebs@cygnus.com>, and David
Taylor <taylor@cygnus.com>, as part of the project to merge in
changes originally made by HP; HP did not create ChangeLog
entries.
* gdbtk.c (gdbtk_init): change stderr to gdb_stderr.
* gdbtk-cmds.c
(get_pc_register): Use paddr_nz, not sprintf's %llx and
a cast to `long long'. Those aren't portable.
(gdb_eval): add embedded_offset param to val_print call
(get_register): add embedded_offset param to val_print call
* gdbtk-hooks.c
(tk_command_loop): change instream to a FILE.
(gdbtk_flush): change both the declaration and definition to
use GDB_FILE rather than FILE.
Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com>
* gdbtk-cmds.c (get_register): Call get_saved_register instead of

View file

@ -17,9 +17,12 @@ 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. */
#ifdef __STDC__ /* Forward decls for prototypes */
struct value;
#endif
#if !defined (C_LANG_H)
#define C_LANG_H 1
#include "value.h"
extern int
c_parse PARAMS ((void)); /* Defined in c-exp.y */
@ -31,7 +34,7 @@ extern void /* Defined in c-typeprint.c */
c_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
extern int
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
int, enum val_prettyprint));
extern int
@ -70,7 +73,7 @@ extern void
cp_print_class_method PARAMS ((char *, struct type *, GDB_FILE *));
extern void
cp_print_value_fields PARAMS ((struct type *, char *, CORE_ADDR,
cp_print_value_fields PARAMS ((struct type *, struct type *, char *, int, CORE_ADDR,
GDB_FILE *, int, int, enum val_prettyprint,
struct type**, int));
@ -79,3 +82,6 @@ cp_is_vtbl_ptr_type PARAMS ((struct type *));
extern int
cp_is_vtbl_member PARAMS ((struct type *));
#endif /* !defined (C_LANG_H) */

View file

@ -43,10 +43,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
The PRETTY parameter controls prettyprinting. */
int
c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, recurse,
pretty)
struct type *type;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
GDB_FILE *stream;
int format;
@ -65,9 +66,9 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
{
elttype = check_typedef (TYPE_TARGET_TYPE (type));
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
if (prettyprint_arrays)
@ -89,13 +90,13 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
/* Look for a NULL char. */
for (temp_len = 0;
valaddr[temp_len]
(valaddr + embedded_offset)[temp_len]
&& temp_len < len && temp_len < print_max;
temp_len++);
len = temp_len;
}
LA_PRINT_STRING (stream, valaddr, len, eltlen, 0);
LA_PRINT_STRING (stream, valaddr + embedded_offset, len, eltlen, 0);
i = len;
}
else
@ -112,7 +113,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
{
i = 0;
}
val_print_array_elements (type, valaddr, address, stream,
val_print_array_elements (type, valaddr + embedded_offset, address, stream,
format, deref_ref, recurse, pretty, i);
fprintf_filtered (stream, "}");
}
@ -125,7 +126,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
case TYPE_CODE_PTR:
if (format && format != 's')
{
print_scalar_formatted (valaddr, type, format, 0, stream);
print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
break;
}
if (vtblprint && cp_is_vtbl_ptr_type(type))
@ -133,24 +134,24 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if we ARE using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
print_address_demangle(extract_address (valaddr, TYPE_LENGTH (type)),
print_address_demangle(extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)),
stream, demangle);
break;
}
elttype = check_typedef (TYPE_TARGET_TYPE (type));
if (TYPE_CODE (elttype) == TYPE_CODE_METHOD)
{
cp_print_class_method (valaddr, type, stream);
cp_print_class_method (valaddr + embedded_offset, type, stream);
}
else if (TYPE_CODE (elttype) == TYPE_CODE_MEMBER)
{
cp_print_class_member (valaddr,
cp_print_class_member (valaddr + embedded_offset,
TYPE_DOMAIN_TYPE (TYPE_TARGET_TYPE (type)),
stream, "&");
}
else
{
addr = unpack_pointer (type, valaddr);
addr = unpack_pointer (type, valaddr + embedded_offset);
print_unpacked_pointer:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
@ -181,7 +182,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
else if (cp_is_vtbl_member(type))
{
/* print vtbl's nicely */
CORE_ADDR vt_address = unpack_pointer (type, valaddr);
CORE_ADDR vt_address = unpack_pointer (type, valaddr + embedded_offset);
struct minimal_symbol *msymbol =
lookup_minimal_symbol_by_pc (vt_address);
@ -214,7 +215,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
wtype = TYPE_TARGET_TYPE(type);
}
vt_val = value_at (wtype, vt_address, NULL);
val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val),
val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
VALUE_ADDRESS (vt_val), stream, format,
deref_ref, recurse + 1, pretty);
if (pretty)
@ -240,7 +241,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
elttype = check_typedef (TYPE_TARGET_TYPE (type));
if (TYPE_CODE (elttype) == TYPE_CODE_MEMBER)
{
cp_print_class_member (valaddr,
cp_print_class_member (valaddr + embedded_offset,
TYPE_DOMAIN_TYPE (elttype),
stream, "");
break;
@ -249,7 +250,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
{
fprintf_filtered (stream, "@");
print_address_numeric
(extract_address (valaddr,
(extract_address (valaddr + embedded_offset,
TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
if (deref_ref)
fputs_filtered (": ", stream);
@ -263,12 +264,17 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr),
valaddr + embedded_offset),
NULL);
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val),
VALUE_ADDRESS (deref_val), stream, format,
deref_ref, recurse + 1, pretty);
VALUE_CONTENTS (deref_val),
0,
VALUE_ADDRESS (deref_val),
stream,
format,
deref_ref,
recurse,
pretty);
}
else
fputs_filtered ("???", stream);
@ -289,23 +295,24 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
/* Print vtable entry - we only get here if NOT using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */
print_address_demangle (extract_address (
valaddr + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
valaddr + embedded_offset +
TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
stream, demangle);
}
else
cp_print_value_fields (type, valaddr, address, stream, format,
cp_print_value_fields (type, type, valaddr, embedded_offset, address, stream, format,
recurse, pretty, NULL, 0);
break;
case TYPE_CODE_ENUM:
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
break;
}
len = TYPE_NFIELDS (type);
val = unpack_long (type, valaddr);
val = unpack_long (type, valaddr + embedded_offset);
for (i = 0; i < len; i++)
{
QUIT;
@ -327,7 +334,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
case TYPE_CODE_FUNC:
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
break;
}
/* FIXME, we should consider, at least for ANSI C language, eliminating
@ -342,10 +349,10 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
case TYPE_CODE_BOOL:
format = format ? format : output_format;
if (format)
print_scalar_formatted (valaddr, type, format, 0, stream);
print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
else
{
val = unpack_long (type, valaddr);
val = unpack_long (type, valaddr + embedded_offset);
if (val == 0)
fputs_filtered ("false", stream);
else if (val == 1)
@ -369,11 +376,11 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
format = format ? format : output_format;
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
}
else
{
val_print_type_code_int (type, valaddr, stream);
val_print_type_code_int (type, valaddr + embedded_offset, stream);
/* C and C++ has no single byte int type, char is used instead.
Since we don't know whether the value is really intended to
be used as an integer or a character, print the character
@ -381,7 +388,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
if (TYPE_LENGTH (type) == 1)
{
fputs_filtered (" ", stream);
LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr),
LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset),
stream);
}
}
@ -391,28 +398,32 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
format = format ? format : output_format;
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
}
else
{
fprintf_filtered (stream, TYPE_UNSIGNED (type) ? "%u" : "%d",
unpack_long (type, valaddr));
unpack_long (type, valaddr + embedded_offset));
fputs_filtered (" ", stream);
LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr), stream);
LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset), stream);
}
break;
case TYPE_CODE_FLT:
if (format)
{
print_scalar_formatted (valaddr, type, format, 0, stream);
print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
}
else
{
print_floating (valaddr, type, stream);
print_floating (valaddr + embedded_offset, type, stream);
}
break;
case TYPE_CODE_METHOD:
cp_print_class_method (valaddr + embedded_offset, lookup_pointer_type (type), stream);
break;
case TYPE_CODE_VOID:
fprintf_filtered (stream, "void");
break;
@ -443,7 +454,9 @@ c_value_print (val, stream, format, pretty)
enum val_prettyprint pretty;
{
struct type *type = VALUE_TYPE (val);
struct type * real_type;
int full, top, using_enc;
/* If it is a pointer, indicate what it points to.
Print type also if it is a reference.
@ -455,6 +468,9 @@ c_value_print (val, stream, format, pretty)
{
/* Hack: remove (char *) for char strings. Their
type is indicated by the quoted string anyway. */
/* Hack^2: ensure that const char *, const unsigned char *
come out without the type but the volatile variants
and the signed variants don't. */
if (TYPE_CODE (type) == TYPE_CODE_PTR &&
TYPE_NAME (type) == NULL &&
TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL &&
@ -462,14 +478,61 @@ c_value_print (val, stream, format, pretty)
{
/* Print nothing */
}
else if (objectprint && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
{
/* Pointer to class, check real type of object */
fprintf_filtered (stream, "(");
type = value_rtti_target_type (val, &full, &top, &using_enc);
if (type)
{
/* RTTI entry found */
type = lookup_pointer_type (type);
type_print (type, "", stream, -1);
}
else
{
/* No RTTI fields, do whatever we can */
type = VALUE_ENCLOSING_TYPE (val);
type_print (type, "", stream, -1);
fprintf_filtered (stream, " ?");
}
fprintf_filtered (stream, ") ");
}
else
{
/* normal case */
fprintf_filtered (stream, "(");
type_print (type, "", stream, -1);
fprintf_filtered (stream, ") ");
}
}
return val_print (type, VALUE_CONTENTS (val),
VALUE_ADDRESS (val) + VALUE_OFFSET (val),
if (objectprint && (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_CLASS))
{
/* Attempt to determine real type of object */
real_type = value_rtti_type (val, &full, &top, &using_enc);
if (real_type)
{
/* We have RTTI information, so use it */
val = value_full_object (val, real_type, full, top, using_enc);
fprintf_filtered (stream, "(%s%s) ",
TYPE_NAME (real_type),
full ? "" : " [incomplete object]");
/* Print out object: enclosing type is same as real_type if full */
return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
}
else if (type != VALUE_ENCLOSING_TYPE (val))
{
/* No RTTI information, so let's do our best */
fprintf_filtered (stream, "(%s ?) ",
TYPE_NAME (VALUE_ENCLOSING_TYPE (val)));
return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
}
/* Otherwise, we end up at the return outside this "if" */
}
return val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val),
VALUE_ADDRESS (val),
stream, format, 1, 0, pretty);
}

View file

@ -31,7 +31,7 @@ extern void /* Defined in ch-typeprint.c */
chill_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
extern int
chill_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
chill_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
int, enum val_prettyprint));
extern int

View file

@ -161,7 +161,7 @@ chill_val_print_array_elements (type, valaddr, address, stream,
chill_print_type_scalar (index_type, low_bound + i + reps - 1,
stream);
fputs_filtered ("): ", stream);
val_print (elttype, valaddr + i * eltlen, 0, stream, format,
val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format,
deref_ref, recurse + 1, pretty);
i = rep1 - 1;
@ -170,7 +170,7 @@ chill_val_print_array_elements (type, valaddr, address, stream,
else
{
fputs_filtered ("): ", stream);
val_print (elttype, valaddr + i * eltlen, 0, stream, format,
val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format,
deref_ref, recurse + 1, pretty);
annotate_elt ();
things_printed++;
@ -197,10 +197,11 @@ chill_val_print_array_elements (type, valaddr, address, stream,
The PRETTY parameter controls prettyprinting. */
int
chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
pretty)
chill_val_print (type, valaddr, embedded_offset, address,
stream, format, deref_ref, recurse, pretty)
struct type *type;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
GDB_FILE *stream;
int format;
@ -466,6 +467,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
NULL);
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val),
0,
VALUE_ADDRESS (deref_val), stream, format,
deref_ref, recurse + 1, pretty);
}
@ -475,13 +477,13 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
break;
case TYPE_CODE_ENUM:
c_val_print (type, valaddr, address, stream, format,
c_val_print (type, valaddr, 0, address, stream, format,
deref_ref, recurse, pretty);
break;
case TYPE_CODE_RANGE:
if (TYPE_TARGET_TYPE (type))
chill_val_print (TYPE_TARGET_TYPE (type), valaddr, address, stream,
chill_val_print (TYPE_TARGET_TYPE (type), valaddr, 0, address, stream,
format, deref_ref, recurse, pretty);
break;
@ -493,7 +495,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
default:
/* Let's defer printing to the C printer, rather than
print an error message. FIXME! */
c_val_print (type, valaddr, address, stream, format,
c_val_print (type, valaddr, 0, address, stream, format,
deref_ref, recurse, pretty);
}
gdb_flush (stream);
@ -562,13 +564,13 @@ chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
chill_val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0,
chill_val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0,
stream, format, 0, recurse + 1, pretty);
}
else
{
chill_val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0,
0, stream, format, 0, recurse + 1, pretty);
}
}
@ -615,13 +617,13 @@ chill_value_print (val, stream, format, pretty)
fprintf_filtered (stream, ")");
}
fprintf_filtered (stream, "(");
i = val_print (type, valaddr, VALUE_ADDRESS (val),
i = val_print (type, valaddr, 0, VALUE_ADDRESS (val),
stream, format, 1, 0, pretty);
fprintf_filtered (stream, ")");
return i;
}
}
return (val_print (type, VALUE_CONTENTS (val),
return (val_print (type, VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
}

View file

@ -325,6 +325,37 @@ read_memory_unsigned_integer (memaddr, len)
read_memory (memaddr, buf, len);
return extract_unsigned_integer (buf, len);
}
void
read_memory_string (memaddr, buffer, max_len)
CORE_ADDR memaddr;
char * buffer;
int max_len;
{
register char * cp;
register int i;
int cnt;
cp = buffer;
while (1)
{
if (cp - buffer >= max_len)
{
buffer[max_len - 1] = '\0';
break;
}
cnt = max_len - (cp - buffer);
if (cnt > 8)
cnt = 8;
read_memory (memaddr + (int) (cp - buffer), cp, cnt);
for (i = 0; i < cnt && *cp; i++, cp++)
; /* null body */
if (i < cnt && !*cp)
break;
}
}
#if 0
/* Enable after 4.12. It is not tested. */

View file

@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "symtab.h"
@ -56,6 +57,8 @@ static void add_to_thread_list PARAMS ((bfd *, asection *, PTR));
static int ignore PARAMS ((CORE_ADDR, char *));
static char * core_file_to_sym_file PARAMS ((char *));
void _initialize_corelow PARAMS ((void));
/* Link a new core_fns into the global core_file_fns list. Called on gdb
@ -358,6 +361,69 @@ cant:
registers_fetched ();
}
static char *
core_file_to_sym_file (core)
char * core;
{
CONST char * failing_command;
char * p;
char * temp;
bfd * temp_bfd;
int scratch_chan;
if (! core)
error ("No core file specified.");
core = tilde_expand (core);
if (core[0] != '/')
{
temp = concat (current_directory, "/", core, NULL);
core = temp;
}
scratch_chan = open (core, write_files ? O_RDWR : O_RDONLY, 0);
if (scratch_chan < 0)
perror_with_name (core);
temp_bfd = bfd_fdopenr (core, gnutarget, scratch_chan);
if (temp_bfd == NULL)
perror_with_name (core);
if (!bfd_check_format (temp_bfd, bfd_core))
{
/* Do it after the err msg */
/* FIXME: should be checking for errors from bfd_close (for one thing,
on error it does not free all the storage associated with the
bfd). */
make_cleanup (bfd_close, temp_bfd);
error ("\"%s\" is not a core dump: %s",
core, bfd_errmsg (bfd_get_error ()));
}
/* Find the data section */
if (build_section_table (temp_bfd, &core_ops.to_sections,
&core_ops.to_sections_end))
error ("\"%s\": Can't find sections: %s",
bfd_get_filename (temp_bfd), bfd_errmsg (bfd_get_error ()));
failing_command = bfd_core_file_failing_command (temp_bfd);
bfd_close (temp_bfd);
/* If we found a filename, remember that it is probably saved
relative to the executable that created it. If working directory
isn't there now, we may not be able to find the executable. Rather
than trying to be sauve about finding it, just check if the file
exists where we are now. If not, then punt and tell our client
we couldn't find the sym file.
*/
p = (char *) failing_command;
if ((p != NULL) && (access (p, F_OK) != 0))
p = NULL;
return p;
}
static void
core_files_info (t)
struct target_ops *t;
@ -376,6 +442,21 @@ ignore (addr, contents)
return 0;
}
/* Okay, let's be honest: threads gleaned from a core file aren't
exactly lively, are they? On the other hand, if we don't claim
that each & every one is alive, then we don't get any of them
to appear in an "info thread" command, which is quite a useful
behaviour.
*/
static int
core_file_thread_alive (tid)
int tid;
{
return 1;
}
struct target_ops core_ops = {
"core", /* to_shortname */
"Local core dump file", /* to_longname */
@ -383,9 +464,13 @@ struct target_ops core_ops = {
core_open, /* to_open */
core_close, /* to_close */
find_default_attach, /* to_attach */
NULL, /* to_post_attach */
find_default_require_attach, /* to_require_attach */
core_detach, /* to_detach */
find_default_require_detach, /* to_require_detach */
0, /* to_resume */
0, /* to_wait */
NULL, /* to_post_wait */
get_core_registers, /* to_fetch_registers */
0, /* to_store_registers */
0, /* to_prepare_to_store */
@ -402,11 +487,33 @@ struct target_ops core_ops = {
0, /* to_load */
0, /* to_lookup_symbol */
find_default_create_inferior, /* to_create_inferior */
NULL, /* to_post_startup_inferior */
NULL, /* to_acknowledge_created_inferior */
find_default_clone_and_follow_inferior, /* to_clone_and_follow_inferior */
NULL, /* to_post_follow_inferior_by_clone */
NULL, /* to_insert_fork_catchpoint */
NULL, /* to_remove_fork_catchpoint */
NULL, /* to_insert_vfork_catchpoint */
NULL, /* to_remove_vfork_catchpoint */
NULL, /* to_has_forked */
NULL, /* to_has_vforked */
NULL, /* to_can_follow_vfork_prior_to_exec */
NULL, /* to_post_follow_vfork */
NULL, /* to_insert_exec_catchpoint */
NULL, /* to_remove_exec_catchpoint */
NULL, /* to_has_execd */
NULL, /* to_reported_exec_events_per_exec_call */
NULL, /* to_has_syscall_event */
NULL, /* to_has_exited */
0, /* to_mourn_inferior */
0, /* to_can_run */
0, /* to_notice_signals */
0, /* to_thread_alive */
core_file_thread_alive, /* to_thread_alive */
0, /* to_stop */
NULL, /* to_enable_exception_callback */
NULL, /* to_get_current_exception_event */
NULL, /* to_pid_to_exec_file */
core_file_to_sym_file, /* to_core_file_to_sym_file */
core_stratum, /* to_stratum */
0, /* to_next */
0, /* to_has_all_memory */

View file

@ -32,6 +32,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "c-lang.h"
#include "target.h"
/* Indication of presence of HP-compiled object files */
extern int hp_som_som_object_present; /* defined in symtab.c */
int vtblprint; /* Controls printing of vtbl's */
int objectprint; /* Controls looking up an object's derived type
using what we find in its vtables. */
@ -45,9 +49,14 @@ cp_print_static_field PARAMS ((struct type *, value_ptr, GDB_FILE *, int, int,
enum val_prettyprint));
static void
cp_print_value PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
cp_print_value PARAMS ((struct type *, struct type *, char *, int, CORE_ADDR, GDB_FILE *,
int, int, enum val_prettyprint, struct type **));
static void
cp_print_hpacc_virtual_table_entries PARAMS ((struct type *, int *, value_ptr, GDB_FILE *,
int, int, enum val_prettyprint));
void
cp_print_class_method (valaddr, type, stream)
char *valaddr;
@ -100,6 +109,12 @@ cp_print_class_method (valaddr, type, stream)
sym = find_pc_function (addr);
if (sym == 0)
{
/* 1997-08-01 Currently unsupported with HP aCC */
if (hp_som_som_object_present)
{
fputs_filtered ("?? <not supported with HP aCC>", stream);
return;
}
error ("invalid pointer to member function");
}
len = TYPE_NFN_FIELDS (domain);
@ -153,6 +168,13 @@ static const char vtbl_ptr_name_old[] =
const char vtbl_ptr_name[] =
{ '_','_','v','t','b','l','_','p','t','r','_','t','y','p','e', 0 };
/* HP aCC uses different names */
const char hpacc_vtbl_ptr_name[] =
{ '_', '_', 'v', 'f', 'p', 0 };
const char hpacc_vtbl_ptr_type_name[] =
{ '_', '_', 'v', 'f', 't', 'y', 'p', 0 };
/* Return truth value for assertion that TYPE is of the type
"pointer to virtual function". */
@ -198,14 +220,19 @@ cp_is_vtbl_member(type)
TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the
same meanings as in cp_print_value and c_val_print.
2nd argument REAL_TYPE is used to carry over the type of the derived
class across the recursion to base classes.
DONT_PRINT is an array of baseclass types that we
should not print, or zero if called from top level. */
void
cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
cp_print_value_fields (type, real_type, valaddr, offset, address, stream, format, recurse, pretty,
dont_print_vb, dont_print_statmem)
struct type *type;
struct type *real_type;
char *valaddr;
int offset;
CORE_ADDR address;
GDB_FILE *stream;
int format;
@ -217,6 +244,7 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
int i, len, n_baseclasses;
struct obstack tmp_obstack;
char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
int fields_seen = 0;
CHECK_TYPEDEF (type);
@ -224,18 +252,26 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
len = TYPE_NFIELDS (type);
n_baseclasses = TYPE_N_BASECLASSES (type);
/* Print out baseclasses such that we don't print
/* First, print out baseclasses such that we don't print
duplicates of virtual baseclasses. */
if (n_baseclasses > 0)
cp_print_value (type, valaddr, address, stream,
cp_print_value (type, real_type, valaddr, offset, address, stream,
format, recurse+1, pretty, dont_print_vb);
if (!len && n_baseclasses == 1)
/* Second, print out data fields */
/* If there are no data fields, or if the only field is the
* vtbl pointer, skip this part */
if ((len == n_baseclasses) ||
((len - n_baseclasses == 1) &&
TYPE_HAS_VTABLE(type) &&
STREQN(TYPE_FIELD_NAME (type, n_baseclasses), hpacc_vtbl_ptr_name, 5)) ||
!len)
fprintf_filtered (stream, "<No data fields>");
else
{
extern int inspect_it;
int fields_seen = 0;
if (dont_print_statmem == 0)
{
@ -251,6 +287,11 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
/* If requested, skip printing of static fields. */
if (!static_field_print && TYPE_FIELD_STATIC (type, i))
continue;
/* If a vtable pointer appears, we'll print it out later */
if (TYPE_HAS_VTABLE(type) && STREQN(TYPE_FIELD_NAME (type, i), hpacc_vtbl_ptr_name, 5))
continue;
if (fields_seen)
fprintf_filtered (stream, ", ");
else if (n_baseclasses > 0)
@ -302,7 +343,9 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
language_cplus,
DMGL_PARAMS | DMGL_ANSI);
annotate_field_name_end ();
fputs_filtered (" = ", stream);
/* do not print leading '=' in case of anonymous unions */
if (strcmp (TYPE_FIELD_NAME (type, i), ""))
fputs_filtered (" = ", stream);
annotate_field_value ();
}
@ -319,9 +362,9 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
else
{
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
unpack_field_as_long (type, valaddr + offset, i));
val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v), 0,
val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v), 0, 0,
stream, format, 0, recurse + 1, pretty);
}
}
@ -344,7 +387,7 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
else
{
val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
valaddr, offset + TYPE_FIELD_BITPOS (type, i) / 8,
address + TYPE_FIELD_BITPOS (type, i) / 8,
stream, format, 0, recurse + 1, pretty);
}
@ -365,7 +408,81 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
}
}
} /* if there are data fields */
/* Now print out the virtual table pointer if there is one */
if (TYPE_HAS_VTABLE(type) && STREQN(TYPE_FIELD_NAME (type, n_baseclasses), hpacc_vtbl_ptr_name, 5))
{
value_ptr v;
/* First get the virtual table pointer and print it out*/
#if 0
fputs_filtered ("__vfp = ", stream);
#endif
fputs_filtered (", Virtual table at ", stream);
/* pai: FIXME 32x64 problem? */
/* Not sure what the best notation is in the case where there is no
baseclass name. */
v = value_from_longest (lookup_pointer_type (builtin_type_unsigned_long),
* (unsigned long *) (valaddr + offset));
val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0,
stream, format, 0, recurse + 1, pretty);
fields_seen = 1;
if (vtblprint)
{
/* Print out function pointers in vtable. */
/* FIXME: then-clause is for non-RRBC layout of virtual
* table. The RRBC case in the else-clause is yet to be
* implemented. The if (1) below should be changed to a
* test for whether the executable we have was compiled
* with a version of HP aCC that doesn't have RRBC
* support. */
if (1)
{
/* no RRBC support; function pointers embedded directly in vtable */
int vfuncs = count_virtual_fns (real_type);
fputs_filtered (" {", stream);
/* FIXME : doesn't work at present */
#if 0
fprintf_filtered (stream, "%d entr%s: ", vfuncs, vfuncs == 1 ? "y" : "ies");
#else
fputs_filtered ("not implemented", stream);
#endif
/* recursive function that prints all virtual function entries */
#if 0
cp_print_hpacc_virtual_table_entries (real_type, &vfuncs, v, stream, format, recurse, pretty);
#endif
fputs_filtered ("}", stream);
} /* non-RRBC case */
else
{
/* FIXME -- seem comments above */
/* RRBC support present; function pointers are found
* by indirection through the class segment entries. */
} /* RRBC case */
} /* if vtblprint */
if (pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
}
} /* if vtable exists */
fprintf_filtered (stream, "}");
}
@ -373,10 +490,12 @@ cp_print_value_fields (type, valaddr, address, stream, format, recurse, pretty,
baseclasses. */
static void
cp_print_value (type, valaddr, address, stream, format, recurse, pretty,
cp_print_value (type, real_type, valaddr, offset, address, stream, format, recurse, pretty,
dont_print_vb)
struct type *type;
struct type *real_type;
char *valaddr;
int offset;
CORE_ADDR address;
GDB_FILE *stream;
int format;
@ -402,6 +521,7 @@ cp_print_value (type, valaddr, address, stream, format, recurse, pretty,
for (i = 0; i < n_baseclasses; i++)
{
int boffset;
int skip;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
char *basename = TYPE_NAME (baseclass);
char *base_valaddr;
@ -421,8 +541,41 @@ cp_print_value (type, valaddr, address, stream, format, recurse, pretty,
obstack_ptr_grow (&dont_print_vb_obstack, baseclass);
}
boffset = baseclass_offset (type, i , valaddr, address);
if (TYPE_HAS_VTABLE (type) && BASETYPE_VIA_VIRTUAL (type, i))
{
/* Assume HP/Taligent runtime convention */
find_rt_vbase_offset (type, TYPE_BASECLASS (type, i),
valaddr, offset, &boffset, &skip);
if (skip >= 0)
error ("Virtual base class offset not found from vtable while printing");
base_valaddr = valaddr;
}
else
{
boffset = baseclass_offset (type, i , valaddr + offset, address + offset);
skip = ((boffset == -1) || (boffset+offset) < 0 ) ? 1 : -1;
if (BASETYPE_VIA_VIRTUAL (type, i))
{
/* The virtual base class pointer might have been clobbered by the
user program. Make sure that it still points to a valid memory
location. */
if (boffset != -1 && ((boffset+offset) < 0 || (boffset+offset) >= TYPE_LENGTH (type)))
{
base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
if (target_read_memory (address + boffset, base_valaddr,
TYPE_LENGTH (baseclass)) != 0)
skip = 1;
}
else
base_valaddr = valaddr;
}
else
base_valaddr = valaddr;
}
/* now do the printing */
if (pretty)
{
fprintf_filtered (stream, "\n");
@ -434,24 +587,11 @@ cp_print_value (type, valaddr, address, stream, format, recurse, pretty,
fputs_filtered (basename ? basename : "", stream);
fputs_filtered ("> = ", stream);
/* The virtual base class pointer might have been clobbered by the
user program. Make sure that it still points to a valid memory
location. */
if (boffset != -1 && (boffset < 0 || boffset >= TYPE_LENGTH (type)))
{
base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
if (target_read_memory (address + boffset, base_valaddr,
TYPE_LENGTH (baseclass)) != 0)
boffset = -1;
}
else
base_valaddr = valaddr + boffset;
if (boffset == -1)
if (skip >= 1)
fprintf_filtered (stream, "<invalid address>");
else
cp_print_value_fields (baseclass, base_valaddr, address + boffset,
cp_print_value_fields (baseclass, real_type, base_valaddr, offset + boffset, address,
stream, format, recurse, pretty,
(struct type **) obstack_base (&dont_print_vb_obstack),
0);
@ -514,11 +654,11 @@ cp_print_static_field (type, val, stream, format, recurse, pretty)
sizeof (CORE_ADDR));
CHECK_TYPEDEF (type);
cp_print_value_fields (type, VALUE_CONTENTS (val), VALUE_ADDRESS (val),
cp_print_value_fields (type, type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
stream, format, recurse, pretty, NULL, 1);
return;
}
val_print (type, VALUE_CONTENTS (val), VALUE_ADDRESS (val),
val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
stream, format, 0, recurse, pretty);
}
@ -537,7 +677,16 @@ cp_print_class_member (valaddr, domain, stream, prefix)
int bits = 0;
register unsigned int i;
unsigned len = TYPE_NFIELDS (domain);
/* @@ Make VAL into bit offset */
/* Note: HP aCC generates offsets that are the real byte offsets added
to a constant bias 0x20000000 (1 << 29). This constant bias gets
shifted out in the code below -- joyous happenstance! */
/* Note: HP cfront uses a constant bias of 1; if we support this
compiler ever, we will have to adjust the computation below */
LONGEST val = unpack_long (builtin_type_int, valaddr) << 3;
for (i = TYPE_N_BASECLASSES (domain); i < len; i++)
{
@ -577,6 +726,72 @@ cp_print_class_member (valaddr, domain, stream, prefix)
fprintf_filtered (stream, "%d", val >> 3);
}
/* This function prints out virtual table entries for a class; it
* recurses on the base classes to find all virtual functions
* available in a class.
*
* pai/1997-05-21 Note: As the name suggests, it's currently
* implemented for HP aCC runtime only. g++ objects are handled
* differently and I have made no attempt to fold that logic in
* here. The runtime layout is different for the two cases. Also,
* this currently has only the code for non-RRBC layouts generated by
* the HP aCC compiler; RRBC code is stubbed out and will have to be
* added later. */
static void
cp_print_hpacc_virtual_table_entries (type, vfuncs, v, stream, format, recurse, pretty)
struct type * type;
int * vfuncs;
value_ptr v;
GDB_FILE *stream;
int format;
int recurse;
enum val_prettyprint pretty;
{
int fn, oi;
/* pai: FIXME this function doesn't work. It should handle a given
* virtual function only once (latest redefinition in class hierarchy)
*/
/* Recursion on other classes that can share the same vtable */
struct type * pbc = primary_base_class (type);
if (pbc)
cp_print_hpacc_virtual_table_entries (pbc, vfuncs, v, stream, format, recurse, pretty);
/* Now deal with vfuncs declared in this class */
for (fn = 0; fn < TYPE_NFN_FIELDS (type); fn++)
for (oi = 0; oi < TYPE_FN_FIELDLIST_LENGTH (type, fn); oi++)
if (TYPE_FN_FIELD_VIRTUAL_P (TYPE_FN_FIELDLIST1 (type, fn), oi))
{
char * vf_name;
/* virtual function offset */
int vx = TYPE_FN_FIELD_VOFFSET (TYPE_FN_FIELDLIST1 (type, fn), oi) - 1;
/* Get the address of the vfunction entry */
value_ptr vf = value_copy (v);
if (VALUE_LAZY (vf))
(void) value_fetch_lazy (vf);
vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx); /* adjust by offset */
vf = value_ind (vf); /* get the entry */
VALUE_TYPE (vf) = VALUE_TYPE (v); /* make it a pointer */
/* print out the entry */
val_print (VALUE_TYPE (vf), VALUE_CONTENTS (vf), 0, 0,
stream, format, 0, recurse + 1, pretty);
vf_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type, fn), oi),
DMGL_ARM); /* pai: (temp) FIXME Maybe this should be DMGL_ANSI */
fprintf_filtered (stream, " %s", vf_name);
if (--(*vfuncs) > 0)
fputs_filtered (", ", stream);
}
}
void
_initialize_cp_valprint ()
{

View file

@ -737,13 +737,13 @@ d30v_print_register (regnum, tabular)
read_relative_register_raw_bytes (regnum, regbuf);
val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0,
val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0, 0,
gdb_stdout, 'x', 1, 0, Val_pretty_default);
if (!tabular)
{
printf_filtered (" ");
val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0,
val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0, 0,
gdb_stdout, 'd', 1, 0, Val_pretty_default);
}
}

View file

@ -94,6 +94,12 @@ typedef bfd_vma CORE_ADDR;
/* Check if a character is one of the commonly used C++ marker characters. */
extern int is_cplus_marker PARAMS ((int));
/* enable xdb commands if set */
extern int xdb_commands;
/* enable dbx commands if set */
extern int dbx_commands;
extern int quit_flag;
extern int immediate_quit;
extern int sevenbit_strings;
@ -126,7 +132,7 @@ enum command_class
no_class = -1, class_run = 0, class_vars, class_stack,
class_files, class_support, class_info, class_breakpoint, class_trace,
class_alias, class_obscure, class_user, class_maintenance,
class_pseudo
class_pseudo, class_tui, class_xdb
};
/* Languages represented in the symbol table and elsewhere.

View file

@ -1,5 +1,5 @@
/* Work with executable files, for GDB.
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1997
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1997, 1998
Free Software Foundation, Inc.
This file is part of GDB.
@ -76,10 +76,11 @@ int write_files = 0;
/* Text start and end addresses (KLUDGE) if needed */
#ifdef NEED_TEXT_START_END
#ifndef NEED_TEXT_START_END
#define NEED_TEXT_START_END (0)
#endif
CORE_ADDR text_start = 0;
CORE_ADDR text_end = 0;
#endif
struct vmap *vmap;
@ -146,20 +147,29 @@ exec_close (quitting)
/* Process the first arg in ARGS as the new exec file.
Note that we have to explicitly ignore additional args, since we can
be called from file_command(), which also calls symbol_file_command()
which can take multiple args. */
This function is intended to be behave essentially the same
as exec_file_command, except that the latter will detect when
a target is being debugged, and will ask the user whether it
should be shut down first. (If the answer is "no", then the
new file is ignored.)
This file is used by exec_file_command, to do the work of opening
and processing the exec file after any prompting has happened.
And, it is used by child_attach, when the attach command was
given a pid but not a exec pathname, and the attach command could
figure out the pathname from the pid. (In this case, we shouldn't
ask the user whether the current target should be shut down --
we're supplying the exec pathname late for good reason.) */
void
exec_file_command (args, from_tty)
exec_file_attach (args, from_tty)
char *args;
int from_tty;
{
char **argv;
char *filename;
target_preopen (from_tty);
/* Remove any previous exec file. */
unpush_target (&exec_ops);
@ -177,7 +187,7 @@ exec_file_command (args, from_tty)
if (argv == NULL)
nomem (0);
make_cleanup (freeargv, (char *) argv);
make_cleanup ((make_cleanup_func) freeargv, (char *) argv);
for (; (*argv != NULL) && (**argv == '-'); argv++) {;}
if (*argv == NULL)
@ -248,38 +258,34 @@ exec_file_command (args, from_tty)
scratch_pathname, bfd_errmsg (bfd_get_error ()));
}
#ifdef NEED_TEXT_START_END
/* text_end is sometimes used for where to put call dummies. A
few ports use these for other purposes too. */
{
struct section_table *p;
/* Set text_start to the lowest address of the start of any
readonly code section and set text_end to the highest
address of the end of any readonly code section. */
/* FIXME: The comment above does not match the code. The code
checks for sections with are either code *or* readonly. */
text_start = ~(CORE_ADDR)0;
text_end = (CORE_ADDR)0;
for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++)
if (bfd_get_section_flags (p->bfd, p->the_bfd_section)
& (SEC_CODE | SEC_READONLY))
{
if (text_start > p->addr)
text_start = p->addr;
if (text_end < p->endaddr)
text_end = p->endaddr;
}
}
#endif
if (NEED_TEXT_START_END)
{
struct section_table *p;
/* Set text_start to the lowest address of the start of any
readonly code section and set text_end to the highest
address of the end of any readonly code section. */
/* FIXME: The comment above does not match the code. The
code checks for sections with are either code *or*
readonly. */
text_start = ~(CORE_ADDR)0;
text_end = (CORE_ADDR)0;
for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++)
if (bfd_get_section_flags (p->bfd, p->the_bfd_section)
& (SEC_CODE | SEC_READONLY))
{
if (text_start > p->addr)
text_start = p->addr;
if (text_end < p->endaddr)
text_end = p->endaddr;
}
}
validate_files ();
set_endian_from_file (exec_bfd);
set_architecture_from_file (exec_bfd);
set_gdbarch_from_file (exec_bfd);
push_target (&exec_ops);
@ -291,6 +297,25 @@ exec_file_command (args, from_tty)
printf_unfiltered ("No executable file now.\n");
}
/* Process the first arg in ARGS as the new exec file.
Note that we have to explicitly ignore additional args, since we can
be called from file_command(), which also calls symbol_file_command()
which can take multiple args. */
void
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);
}
/* Set both the exec file and the symbol file, in one command.
What a novelty. Why did GDB go through four major releases before this
command was added? */
@ -671,9 +696,13 @@ Specify the filename of the executable file.", /* to_doc */
exec_file_command, /* to_open */
exec_close, /* to_close */
find_default_attach, /* to_attach */
NULL, /* to_post_attach */
find_default_require_attach, /* to_require_attach */
0, /* to_detach */
find_default_require_detach, /* to_require_detach */
0, /* to_resume */
0, /* to_wait */
NULL, /* to_post_wait */
0, /* to_fetch_registers */
0, /* to_store_registers */
0, /* to_prepare_to_store */
@ -690,11 +719,33 @@ Specify the filename of the executable file.", /* to_doc */
0, /* to_load */
0, /* to_lookup_symbol */
find_default_create_inferior, /* to_create_inferior */
NULL, /* to_post_startup_inferior */
NULL, /* to_acknowledge_created_inferior */
find_default_clone_and_follow_inferior, /* to_clone_and_follow_inferior */
NULL, /* to_post_follow_inferior_by_clone */
NULL, /* to_insert_fork_catchpoint */
NULL, /* to_remove_fork_catchpoint */
NULL, /* to_insert_vfork_catchpoint */
NULL, /* to_remove_vfork_catchpoint */
NULL, /* to_has_forked */
NULL, /* to_has_vforked */
NULL, /* to_can_follow_vfork_prior_to_exec */
NULL, /* to_post_follow_vfork */
NULL, /* to_insert_exec_catchpoint */
NULL, /* to_remove_exec_catchpoint */
NULL, /* to_has_execd */
NULL, /* to_reported_exec_events_per_exec_call */
NULL, /* to_has_syscall_event */
NULL, /* to_has_exited */
0, /* to_mourn_inferior */
0, /* to_can_run */
0, /* to_notice_signals */
0, /* to_thread_alive */
0, /* to_stop */
NULL, /* to_enable_exception_callback */
NULL, /* to_get_current_exception_event */
NULL, /* to_pid_to_exec_file */
NULL, /* to_core_file_to_sym_file */
file_stratum, /* to_stratum */
0, /* to_next */
0, /* to_has_all_memory */
@ -712,14 +763,17 @@ _initialize_exec()
{
struct cmd_list_element *c;
c = add_cmd ("file", class_files, file_command,
"Use FILE as program to be debugged.\n\
if (!dbx_commands)
{
c = add_cmd ("file", class_files, file_command,
"Use FILE as program to be debugged.\n\
It is read for its symbols, for getting the contents of pure memory,\n\
and it is the program executed when you use the `run' command.\n\
If FILE cannot be found as specified, your execution directory path\n\
($PATH) is searched for a command of that name.\n\
No arg means to have no executable file and no symbols.", &cmdlist);
c->completer = filename_completer;
c->completer = filename_completer;
}
c = add_cmd ("exec-file", class_files, exec_file_command,
"Use FILE as program for getting contents of pure memory.\n\

View file

@ -23,9 +23,11 @@ extern int f_parse PARAMS ((void));
extern void f_error PARAMS ((char *)); /* Defined in f-exp.y */
extern void f_print_type PARAMS ((struct type *, char *, FILE *, int, int));
extern void f_print_type PARAMS ((struct type *, char *,
GDB_FILE *, int, int));
extern int f_val_print PARAMS ((struct type *, char *, CORE_ADDR, FILE *,
extern int f_val_print PARAMS ((struct type *, char *, int,
CORE_ADDR, GDB_FILE *,
int, int, int, enum val_prettyprint));
/* Language-specific data structures */

View file

@ -40,12 +40,13 @@ static int there_is_a_visible_common_named PARAMS ((char *));
static void info_common_command PARAMS ((char *, int));
static void list_all_visible_commons PARAMS ((char *));
static void f77_print_array PARAMS ((struct type *, char *, CORE_ADDR,
FILE *, int, int, int,
GDB_FILE *, int, int, int,
enum val_prettyprint));
static void f77_print_array_1 PARAMS ((int, int, struct type *, char *,
CORE_ADDR, FILE *, int, int, int,
CORE_ADDR, GDB_FILE *, int, int, int,
enum val_prettyprint));
static void f77_create_arrayprint_offset_tbl PARAMS ((struct type *, FILE *));
static void f77_create_arrayprint_offset_tbl PARAMS ((struct type *,
GDB_FILE *));
static void f77_get_dynamic_length_of_aggregate PARAMS ((struct type *));
int f77_array_offset_tbl[MAX_FORTRAN_DIMS+1][2];
@ -231,7 +232,7 @@ f77_get_dynamic_length_of_aggregate (type)
static void
f77_create_arrayprint_offset_tbl (type, stream)
struct type *type;
FILE *stream;
GDB_FILE *stream;
{
struct type *tmp_type;
int eltlen;
@ -285,7 +286,7 @@ f77_print_array_1 (nss, ndimensions, type, valaddr, address,
struct type *type;
char *valaddr;
CORE_ADDR address;
FILE *stream;
GDB_FILE *stream;
int format;
int deref_ref;
int recurse;
@ -311,6 +312,7 @@ f77_print_array_1 (nss, ndimensions, type, valaddr, address,
{
val_print (TYPE_TARGET_TYPE (type),
valaddr + i * F77_DIM_OFFSET (ndimensions),
0,
address + i * F77_DIM_OFFSET (ndimensions),
stream, format, deref_ref, recurse, pretty);
@ -332,7 +334,7 @@ f77_print_array (type, valaddr, address, stream, format, deref_ref, recurse,
struct type *type;
char *valaddr;
CORE_ADDR address;
FILE *stream;
GDB_FILE *stream;
int format;
int deref_ref;
int recurse;
@ -371,12 +373,13 @@ f77_print_array (type, valaddr, address, stream, format, deref_ref, recurse,
The PRETTY parameter controls prettyprinting. */
int
f_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
f_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref, recurse,
pretty)
struct type *type;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
FILE *stream;
GDB_FILE *stream;
int format;
int deref_ref;
int recurse;
@ -534,7 +537,7 @@ f_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
{
/* Bash the type code temporarily. */
TYPE_CODE (type) = TYPE_CODE_INT;
f_val_print (type, valaddr, address, stream, format,
f_val_print (type, valaddr, 0, address, stream, format,
deref_ref, recurse, pretty);
/* Restore the type code so later uses work as intended. */
TYPE_CODE (type) = TYPE_CODE_BOOL;
@ -568,7 +571,7 @@ f_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
default:
error ("Invalid F77 type code %d in symbol table.", TYPE_CODE (type));
}
fflush (stream);
gdb_flush (stream);
return 0;
}
@ -758,4 +761,7 @@ _initialize_f_valprint ()
{
add_info ("common", info_common_command,
"Print out the values contained in a Fortran COMMON block.");
if (xdb_commands)
add_com("lc", class_info, info_common_command,
"Print out the values contained in a Fortran COMMON block.");
}

View file

@ -647,7 +647,8 @@ gdb_eval (clientData, interp, objc, objv)
* the Tcl result.
*/
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
VALUE_EMBEDDED_OFFSET(val), VALUE_ADDRESS (val),
gdb_stdout, 0, 0, 0, 0);
do_cleanups (old_chain);
@ -1694,7 +1695,7 @@ get_register (regnum, fp)
}
}
else
val_print (REGISTER_VIRTUAL_TYPE (regnum), virtual_buffer, 0,
val_print (REGISTER_VIRTUAL_TYPE (regnum), virtual_buffer, 0, 0,
gdb_stdout, format, 1, 0, Val_pretty_default);
}
@ -3394,7 +3395,7 @@ get_frame_name (interp, list, fi)
print_address_numeric (fi->pc, 1, gdb_stdout);
printf_filtered (" in ");
}
printf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
fprintf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
DMGL_ANSI);
#endif
objv[0] = Tcl_NewStringObj (funname != NULL ? funname : "??", -1);

File diff suppressed because it is too large Load diff

View file

@ -29,9 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define FT_VOID 0
#define FT_BOOLEAN 1
#define FT_CHAR 2
#define FT_SIGNED_CHAR 3
#define FT_UNSIGNED_CHAR 4
#define FT_CHAR 2 /* we use this for not-unsigned C/C++ chars */
#define FT_SIGNED_CHAR 3 /* we use this for C++ signed chars */
#define FT_UNSIGNED_CHAR 4 /* we use this for C/C++ unsigned chars */
#define FT_SHORT 5
#define FT_SIGNED_SHORT 6
#define FT_UNSIGNED_SHORT 7
@ -55,8 +55,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define FT_FLOAT_DECIMAL 25
#define FT_BYTE 26
#define FT_UNSIGNED_BYTE 27
#define FT_TEMPLATE_ARG 28
#define FT_NUM_MEMBERS 28 /* Highest FT_* above, plus one. */
#define FT_NUM_MEMBERS 29 /* Highest FT_* above, plus one. */
/* Some macros for char-based bitfields. */
@ -122,7 +123,10 @@ enum type_code
/* Fortran */
TYPE_CODE_COMPLEX, /* Complex float */
TYPE_CODE_TYPEDEF
TYPE_CODE_TYPEDEF,
TYPE_CODE_TEMPLATE, /* C++ template */
TYPE_CODE_TEMPLATE_ARG /* C++ template arg */
};
/* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an
@ -136,10 +140,16 @@ enum type_code
/* Some bits for the type's flags word. */
/* Unsigned integer type. If this is not set for a TYPE_CODE_INT, the
type is signed. */
type is signed (unless TYPE_FLAG_NOSIGN (below) is set). */
#define TYPE_FLAG_UNSIGNED (1 << 0)
/* No sign for this type. In C++, "char", "signed char", and "unsigned
char" are distinct types; so we need an extra flag to indicate the
absence ofa sign! */
#define TYPE_FLAG_NOSIGN (1 << 1)
/* This appears in a type's flags word if it is a stub type (e.g., if
someone referenced a type that wasn't defined in a source file
via (struct sir_not_appearing_in_this_film *)). */
@ -154,11 +164,43 @@ enum type_code
#define TYPE_FLAG_TARGET_STUB (1 << 3)
/* Static type. If this is set, the corresponding type had
* a static modifier.
* Note: This may be unnecessary, since static data members
* are indicated by other means (bitpos == -1)
*/
#define TYPE_FLAG_STATIC (1 << 4)
/* Constant type. If this is set, the corresponding type has a
* const modifier.
*/
#define TYPE_FLAG_CONST (1 << 5)
/* Volatile type. If this is set, the corresponding type has a
* volatile modifier.
*/
#define TYPE_FLAG_VOLATILE (1 << 6)
/* This is a function type which appears to have a prototype. We need this
for function calls in order to tell us if it's necessary to coerce the args,
or to just do the standard conversions. */
or to just do the standard conversions. This is used with a short field. */
#define TYPE_FLAG_PROTOTYPED (1 << 7)
/* This flag is used to indicate that processing for this type
is incomplete.
(Mostly intended for HP platforms, where class methods, for
instance, can be encountered before their classes in the debug
info; the incomplete type has to be marked so that the class and
the method can be assigned correct types.) */
#define TYPE_FLAG_INCOMPLETE (1 << 8)
#define TYPE_FLAG_PROTOTYPED (1 << 4)
struct type
{
@ -245,9 +287,15 @@ struct type
struct type *reference_type;
/* C-v variant chain. This points to a type that
differs from this one only in a const or volatile
attribute (or both). The various c-v variants
are chained together in a ring. */
struct type *cv_type;
/* Flags about this type. */
short flags;
int flags;
/* Number of fields described for this type */
@ -382,8 +430,22 @@ struct cplus_struct_type
/* Number of methods described for this type, not including the
methods that it derives from. */
int nfn_fields_total;
short nfn_fields_total;
/* The "declared_type" field contains a code saying how the
user really declared this type, e.g., "class s", "union s",
"struct s".
The 3 above things come out from the C++ compiler looking like classes,
but we keep track of the real declaration so we can give
the correct information on "ptype". (Note: TEMPLATE may not
belong in this list...) */
#define DECLARED_TYPE_CLASS 0
#define DECLARED_TYPE_UNION 1
#define DECLARED_TYPE_STRUCT 2
#define DECLARED_TYPE_TEMPLATE 3
short declared_type; /* One of the above codes */
/* For derived classes, the number of base classes is given by n_baseclasses
and virtual_field_bits is a bit vector containing one bit per base class.
If the base class is virtual, the corresponding bit will be set.
@ -453,10 +515,21 @@ struct cplus_struct_type
char *physname;
/* The type of the method. */
/* The function type for the method.
(This comment used to say "The return value of the method",
but that's wrong. The function type
is expected here, i.e. something with TYPE_CODE_FUNC,
and *not* the return-value type). */
struct type *type;
/* The argument list. Only valid if is_stub is clear. Contains
the type of each argument, including `this', and ending with
a NULL pointer after the last argument. Should not contain
a `this' pointer for static member functions. */
struct type **args;
/* For virtual functions.
First baseclass that defines this virtual function. */
@ -473,8 +546,11 @@ struct cplus_struct_type
to reconstruct the rest of the fields). */
unsigned int is_stub : 1;
/* C++ method that is inlined */
unsigned int is_inlined : 1;
/* Unused. */
unsigned int dummy : 3;
unsigned int dummy : 2;
/* Index into that baseclass's virtual function table,
minus 2; else if static: VOFFSET_STATIC; else: 0. */
@ -487,6 +563,72 @@ struct cplus_struct_type
} *fn_fieldlists;
/* If this "struct type" describes a template, then it
* has arguments. "template_args" points to an array of
* template arg descriptors, of length "ntemplate_args".
* The only real information in each of these template arg descriptors
* is a name. "type" will typically just point to a "struct type" with
* the placeholder TYPE_CODE_TEMPLATE_ARG type.
*/
short ntemplate_args;
struct template_arg
{
char *name;
struct type *type;
} *template_args;
/* If this "struct type" describes a template, it has a list
* of instantiations. "instantiations" is a pointer to an array
* of type's, one representing each instantiation. There
* are "ninstantiations" elements in this array.
*/
short ninstantiations;
struct type **instantiations;
/* The following points to information relevant to the runtime model
* of the compiler.
* Currently being used only for HP's ANSI C++ compiler.
* (This type may have to be changed/enhanced for other compilers.)
*
* RUNTIME_PTR is NULL if there is no runtime information (currently
* this means the type was not compiled by HP aCC).
*
* Fields in structure pointed to:
* ->HAS_VTABLE : 0 => no virtual table, 1 => vtable present
*
* ->PRIMARY_BASE points to the first non-virtual base class that has
* a virtual table.
*
* ->VIRTUAL_BASE_LIST points to a list of struct type * pointers that
* point to the type information for all virtual bases among this type's
* ancestors.
*/
struct runtime_info {
short has_vtable;
struct type * primary_base;
struct type ** virtual_base_list;
} * runtime_ptr;
/* Pointer to information about enclosing scope, if this is a
* local type. If it is not a local type, this is NULL
*/
struct local_type_info {
char * file;
int line;
} * localtype_ptr;
};
/* Struct used in computing virtual base list */
struct vbase
{
struct type * vbasetype; /* pointer to virtual base */
struct vbase * next; /* next in chain */
};
/* Struct used for ranking a function for overload resolution */
struct badness_vector {
int length;
int * rank;
};
/* The default value of TYPE_CPLUS_SPECIFIC(T) points to the
@ -508,6 +650,7 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_TARGET_TYPE(thistype) (thistype)->target_type
#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
#define TYPE_CV_TYPE(thistype) (thistype)->cv_type
/* Note that if thistype is a TYPEDEF type, you have to call check_typedef.
But check_typedef does set the TYPE_LENGTH of the TYPEDEF type,
so you only have to call check_typedef once. Since allocate_value
@ -516,11 +659,17 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_OBJFILE(thistype) (thistype)->objfile
#define TYPE_FLAGS(thistype) (thistype)->flags
#define TYPE_UNSIGNED(thistype) ((thistype)->flags & TYPE_FLAG_UNSIGNED)
#define TYPE_NOSIGN(thistype) ((thistype)->flags & TYPE_FLAG_NOSIGN)
#define TYPE_CONST(thistype) ((thistype)->flags & TYPE_FLAG_CONST)
#define TYPE_VOLATILE(thistype) ((thistype)->flags & TYPE_FLAG_VOLATILE)
#define TYPE_INCOMPLETE(thistype) ((thistype)->flags & TYPE_FLAG_INCOMPLETE)
/* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you wan the real
type, you need to do TYPE_CODE (check_type (this_type)). */
#define TYPE_CODE(thistype) (thistype)->code
#define TYPE_NFIELDS(thistype) (thistype)->nfields
#define TYPE_FIELDS(thistype) (thistype)->fields
#define TYPE_TEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->template_args
#define TYPE_INSTANTIATIONS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->instantiations
#define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0)
#define TYPE_LOW_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 0)
@ -545,6 +694,9 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_FN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fields
#define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields
#define TYPE_NFN_FIELDS_TOTAL(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields_total
#define TYPE_NTEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->ntemplate_args
#define TYPE_NINSTANTIATIONS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->ninstantiations
#define TYPE_DECLARED_TYPE(thistype) TYPE_CPLUS_SPECIFIC(thistype)->declared_type
#define TYPE_TYPE_SPECIFIC(thistype) (thistype)->type_specific
#define TYPE_ARG_TYPES(thistype) (thistype)->type_specific.arg_types
#define TYPE_CPLUS_SPECIFIC(thistype) (thistype)->type_specific.cplus_stuff
@ -552,9 +704,12 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_N_BASECLASSES(thistype) TYPE_CPLUS_SPECIFIC(thistype)->n_baseclasses
#define TYPE_BASECLASS_NAME(thistype,index) (thistype)->fields[index].name
#define TYPE_BASECLASS_BITPOS(thistype,index) TYPE_FIELD_BITPOS(thistype,index)
#define BASETYPE_VIA_PUBLIC(thistype, index) (!TYPE_FIELD_PRIVATE(thistype, index))
#define BASETYPE_VIA_PUBLIC(thistype, index) \
((!TYPE_FIELD_PRIVATE(thistype, index)) && (!TYPE_FIELD_PROTECTED(thistype, index)))
#define BASETYPE_VIA_VIRTUAL(thistype, index) \
B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index))
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index)))
#define FIELD_TYPE(thisfld) ((thisfld).type)
#define FIELD_NAME(thisfld) ((thisfld).name)
@ -572,6 +727,8 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0)
#define TYPE_TEMPLATE_ARG(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->template_args[n]
#define TYPE_INSTANTIATION(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->instantiations[n]
#define TYPE_FIELD_PRIVATE_BITS(thistype) \
TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits
@ -599,7 +756,8 @@ allocate_cplus_struct_type PARAMS ((struct type *));
(TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits, (n)))
#define TYPE_FIELD_VIRTUAL(thistype, n) \
B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n))
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n)))
#define TYPE_FIELD_STATIC(thistype, n) ((thistype)->fields[n].bitsize < 0)
#define TYPE_FIELD_STATIC_HAS_ADDR(thistype, n) ((thistype)->fields[n].bitsize == -2)
@ -621,11 +779,29 @@ allocate_cplus_struct_type PARAMS ((struct type *));
#define TYPE_FN_FIELD_PRIVATE(thisfn, n) ((thisfn)[n].is_private)
#define TYPE_FN_FIELD_PROTECTED(thisfn, n) ((thisfn)[n].is_protected)
#define TYPE_FN_FIELD_STUB(thisfn, n) ((thisfn)[n].is_stub)
#define TYPE_FN_FIELD_INLINED(thisfn, n) ((thisfn)[n].is_inlined)
#define TYPE_FN_FIELD_FCONTEXT(thisfn, n) ((thisfn)[n].fcontext)
#define TYPE_FN_FIELD_VOFFSET(thisfn, n) ((thisfn)[n].voffset-2)
#define TYPE_FN_FIELD_VIRTUAL_P(thisfn, n) ((thisfn)[n].voffset > 1)
#define TYPE_FN_FIELD_STATIC_P(thisfn, n) ((thisfn)[n].voffset == VOFFSET_STATIC)
#define TYPE_RUNTIME_PTR(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->runtime_ptr)
#define TYPE_VTABLE(thistype) (TYPE_RUNTIME_PTR(thistype)->has_vtable)
#define TYPE_HAS_VTABLE(thistype) (TYPE_RUNTIME_PTR(thistype) && TYPE_VTABLE(thistype))
#define TYPE_PRIMARY_BASE(thistype) (TYPE_RUNTIME_PTR(thistype)->primary_base)
#define TYPE_VIRTUAL_BASE_LIST(thistype) (TYPE_RUNTIME_PTR(thistype)->virtual_base_list)
#define TYPE_LOCALTYPE_PTR(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr)
#define TYPE_LOCALTYPE_FILE(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr->file)
#define TYPE_LOCALTYPE_LINE(thistype) (TYPE_CPLUS_SPECIFIC(thistype)->localtype_ptr->line)
#define TYPE_IS_OPAQUE(thistype) (((TYPE_CODE (thistype) == TYPE_CODE_STRUCT) || \
(TYPE_CODE (thistype) == TYPE_CODE_UNION)) && \
(TYPE_NFIELDS (thistype) == 0) && \
(TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)))
/* Implicit sizes */
extern struct type *builtin_type_void;
extern struct type *builtin_type_char;
@ -643,6 +819,7 @@ extern struct type *builtin_type_long_double;
extern struct type *builtin_type_complex;
extern struct type *builtin_type_double_complex;
extern struct type *builtin_type_string;
extern struct type *builtin_type_bool;
/* Explicit sizes - see <intypes.h> for naming schema */
extern struct type *builtin_type_int8;
@ -699,6 +876,9 @@ extern struct type *builtin_type_f_complex_s16;
extern struct type *builtin_type_f_complex_s32;
extern struct type *builtin_type_f_void;
/* RTTI for C++ */
/* extern struct type *builtin_type_cxx_typeinfo; */
/* Maximum and minimum values of built-in types */
#define MAX_OF_TYPE(t) \
@ -735,6 +915,9 @@ lookup_reference_type PARAMS ((struct type *));
extern struct type *
make_reference_type PARAMS ((struct type *, struct type **));
extern struct type *
make_cv_type PARAMS ((int, int, struct type *, struct type **));
extern struct type *
lookup_member_type PARAMS ((struct type *, struct type *));
@ -818,6 +1001,112 @@ extern int get_destructor_fn_field PARAMS ((struct type *, int *, int *));
extern int get_discrete_bounds PARAMS ((struct type*, LONGEST*, LONGEST*));
extern int
get_discrete_bounds PARAMS ((struct type*, LONGEST*, LONGEST*));
extern int
is_ancestor PARAMS ((struct type *, struct type *));
extern int
has_vtable PARAMS ((struct type *));
extern struct type *
primary_base_class PARAMS ((struct type *));
extern struct type **
virtual_base_list PARAMS ((struct type *));
extern int
virtual_base_list_length PARAMS ((struct type *));
extern int
virtual_base_list_length_skip_primaries PARAMS ((struct type *));
extern int
virtual_base_index PARAMS ((struct type *, struct type *));
extern int
virtual_base_index_skip_primaries PARAMS ((struct type *, struct type *));
extern int
class_index_in_primary_list PARAMS ((struct type *));
extern int
count_virtual_fns PARAMS ((struct type*));
/* Constants for HP/Taligent ANSI C++ runtime model */
/* Where virtual function entries begin in the
* virtual table, in the non-RRBC vtable format.
* First 4 are the metavtable pointer, top offset,
* typeinfo pointer, and dup base info pointer */
#define HP_ACC_VFUNC_START 4
/* (Negative) Offset where virtual base offset entries begin
* in the virtual table. Skips over metavtable pointer and
* the self-offset entry.
* NOTE: NEGATE THIS BEFORE USING! The virtual base offsets
* appear before the address point of the vtable (the slot
* pointed to by the object's vtable pointer), i.e. at lower
* addresses than the vtable pointer. */
#define HP_ACC_VBASE_START 2
/* (Positive) Offset where the pointer to the typeinfo
* object is present in the virtual table */
#define HP_ACC_TYPEINFO_OFFSET 2
/* (Positive) Offset where the ``top offset'' entry of
* the virtual table is */
#define HP_ACC_TOP_OFFSET_OFFSET 1
/* Overload resolution */
#define LENGTH_MATCH(bv) ((bv)->rank[0])
/* Badness if parameter list length doesn't match arg list length */
#define LENGTH_MISMATCH_BADNESS 100
/* Dummy badness value for nonexistent parameter positions */
#define TOO_FEW_PARAMS_BADNESS 100
/* Badness if no conversion among types */
#define INCOMPATIBLE_TYPE_BADNESS 100
/* Badness of coercing large integer to smaller size */
#define INTEGER_COERCION_BADNESS 100
/* Badness of coercing large floating type to smaller size */
#define FLOAT_COERCION_BADNESS 100
/* Badness of integral promotion */
#define INTEGER_PROMOTION_BADNESS 1
/* Badness of floating promotion */
#define FLOAT_PROMOTION_BADNESS 1
/* Badness of integral conversion */
#define INTEGER_CONVERSION_BADNESS 2
/* Badness of floating conversion */
#define FLOAT_CONVERSION_BADNESS 2
/* Badness of integer<->floating conversions */
#define INT_FLOAT_CONVERSION_BADNESS 2
/* Badness of converting to a boolean */
#define BOOLEAN_CONVERSION_BADNESS 2
/* Badness of pointer conversion */
#define POINTER_CONVERSION_BADNESS 2
/* Badness of conversion of pointer to void pointer */
#define VOID_PTR_CONVERSION_BADNESS 2
/* Badness of convering derived to base class */
#define BASE_CONVERSION_BADNESS 2
/* Non-standard conversions allowed by the debugger */
/* Converting a pointer to an int is usually OK */
#define NS_POINTER_CONVERSION_BADNESS 10
extern int
compare_badness PARAMS ((struct badness_vector *, struct badness_vector *));
extern struct badness_vector *
rank_function PARAMS ((struct type **, int, struct type **, int));
extern int
rank_one_type PARAMS ((struct type *, struct type *));
#if MAINTENANCE_CMDS
extern void recursive_dump_type PARAMS ((struct type *, int));
#endif

View file

@ -2082,6 +2082,13 @@ gnu_stop ()
error ("to_stop target function not implemented");
}
static void
gnu_pid_to_exec_file ()
{
error ("to_pid_to_exec_file target function not implemented");
}
static int
gnu_thread_alive (int tid)
{
@ -2351,9 +2358,13 @@ init_gnu_ops(void)
gnu_ops.to_open = gnu_open; /* to_open */
gnu_ops.to_close = 0; /* to_close */
gnu_ops.to_attach = gnu_attach; /* to_attach */
gnu_ops.to_post_attach = NULL;
gnu_ops.to_require_attach = NULL; /* to_require_attach */
gnu_ops.to_detach = gnu_detach; /* to_detach */
gnu_ops.to_require_detach = NULL; /* to_require_detach */
gnu_ops.to_resume = gnu_resume; /* to_resume */
gnu_ops.to_wait = gnu_wait; /* to_wait */
gnu_ops.to_post_wait = NULL; /* to_post_wait */
gnu_ops.to_fetch_registers = gnu_fetch_registers; /* to_fetch_registers */
gnu_ops.to_store_registers = gnu_store_registers; /* to_store_registers */
gnu_ops.to_prepare_to_store = gnu_prepare_to_store; /* to_prepare_to_store */
@ -2370,11 +2381,30 @@ init_gnu_ops(void)
gnu_ops.to_load = 0; /* to_load */
gnu_ops.to_lookup_symbol = 0; /* to_lookup_symbol */
gnu_ops.to_create_inferior = gnu_create_inferior; /* to_create_inferior */
gnu_ops.to_mourn_inferior = gnu_mourn_inferior; /* to_mourn_inferior */
gnu_ops.to_post_startup_inferior = NULL; /* to_post_startup_inferior */
gnu_ops.to_acknowledge_created_inferior = NULL; /* to_acknowledge_created_inferior */
gnu_ops.to_clone_and_follow_inferior = NULL; /* to_clone_and_follow_inferior */
gnu_ops.to_post_follow_inferior_by_clone = NULL; /* to_post_follow_inferior_by_clone */
gnu_ops.to_insert_fork_catchpoint = NULL;
gnu_ops.to_remove_fork_catchpoint = NULL;
gnu_ops.to_insert_vfork_catchpoint = NULL;
gnu_ops.to_remove_vfork_catchpoint = NULL;
gnu_ops.to_has_forked = NULL; /* to_has_forked */
gnu_ops.to_has_vforked = NULL; /* to_has_vforked */
gnu_ops.to_can_follow_vfork_prior_to_exec = NULL;
gnu_ops.to_post_follow_vfork = NULL; /* to_post_follow_vfork */
gnu_ops.to_insert_exec_catchpoint = NULL;
gnu_ops.to_remove_exec_catchpoint = NULL;
gnu_ops.to_has_execd = NULL;
gnu_ops.to_reported_exec_events_per_exec_call = NULL;
gnu_ops.to_has_exited = NULL;
gnu_ops.to_mourn_inferior = gnu_mourn_inferior; /* to_mourn_inferior */
gnu_ops.to_can_run = gnu_can_run; /* to_can_run */
gnu_ops.to_notice_signals = 0; /* to_notice_signals */
gnu_ops.to_thread_alive = gnu_thread_alive;/* to_thread_alive */
gnu_ops.to_stop = gnu_stop; /* to_stop */
gnu_ops.to_pid_to_exec_file = gnu_pid_to_exec_file; /* to_pid_to_exec_file */
gnu_ops.to_core_file_to_sym_file = NULL;
gnu_ops.to_stratum = process_stratum; /* to_stratum */
gnu_ops.DONT_USE = 0; /* to_next */
gnu_ops.to_has_all_memory = 1; /* to_has_all_memory */

View file

@ -1887,7 +1887,7 @@ pa_print_fp_reg (i)
print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), gdb_stdout);
fputs_filtered ("(single precision) ", gdb_stdout);
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, gdb_stdout, 0,
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, gdb_stdout, 0,
1, 0, Val_pretty_default);
printf_filtered ("\n");
@ -1907,7 +1907,7 @@ pa_print_fp_reg (i)
print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), gdb_stdout);
fputs_filtered ("(double precision) ", gdb_stdout);
val_print (builtin_type_double, virtual_buffer, 0, gdb_stdout, 0,
val_print (builtin_type_double, virtual_buffer, 0, 0, gdb_stdout, 0,
1, 0, Val_pretty_default);
printf_filtered ("\n");
}

View file

@ -593,9 +593,13 @@ struct target_ops hpux_thread_ops = {
hpux_thread_open, /* to_open */
0, /* to_close */
hpux_thread_attach, /* to_attach */
NULL, /* to_post_attach */
NULL, /* to_require_attach */
hpux_thread_detach, /* to_detach */
NULL, /* to_require_detach */
hpux_thread_resume, /* to_resume */
hpux_thread_wait, /* to_wait */
NULL, /* to_post_wait */
hpux_thread_fetch_registers, /* to_fetch_registers */
hpux_thread_store_registers, /* to_store_registers */
hpux_thread_prepare_to_store, /* to_prepare_to_store */
@ -612,11 +616,33 @@ struct target_ops hpux_thread_ops = {
0, /* to_load */
0, /* to_lookup_symbol */
hpux_thread_create_inferior, /* to_create_inferior */
NULL, /* to_post_startup_inferior */
NULL, /* to_acknowledge_created_inferior */
NULL, /* to_clone_and_follow_inferior */
NULL, /* to_post_follow_inferior_by_clone */
NULL, /* to_insert_fork_catchpoint */
NULL, /* to_remove_fork_catchpoint */
NULL, /* to_insert_vfork_catchpoint */
NULL, /* to_remove_vfork_catchpoint */
NULL, /* to_has_forked */
NULL, /* to_has_vforked */
NULL, /* to_can_follow_vfork_prior_to_exec */
NULL, /* to_post_follow_fork */
hpux_thread_mourn_inferior, /* to_mourn_inferior */
NULL, /* to_insert_exec_catchpoint */
NULL, /* to_remove_exec_catchpoint */
NULL, /* to_has_execd */
NULL, /* to_reported_exec_events_per_exec_call */
NULL, /* to_has_syscall_event */
NULL, /* to_has_exited */
hpux_thread_can_run, /* to_can_run */
hpux_thread_notice_signals, /* to_notice_signals */
hpux_thread_alive, /* to_thread_alive */
hpux_thread_stop, /* to_stop */
NULL, /* to_enable_exception_callback */
NULL, /* to_get_current_exception_event */
NULL, /* to_pid_to_exec_file */
NULL, /* to_core_file_to_sym_file */
process_stratum, /* to_stratum */
0, /* to_next */
1, /* to_has_all_memory */

View file

@ -1,5 +1,6 @@
/* Memory-access and commands for "inferior" process, for GDB.
Copyright 1986, 1987, 1988, 1989, 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
Copyright 1986, 87, 88, 89, 91, 92, 95, 96, 1998
Free Software Foundation, Inc.
This file is part of GDB.
@ -19,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include <signal.h>
#include <sys/param.h>
#include "gdb_string.h"
#include "symtab.h"
#include "gdbtypes.h"
@ -31,8 +31,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcore.h"
#include "target.h"
#include "language.h"
#include "symfile.h"
static void continue_command PARAMS ((char *, int));
/* Functions exported for general use: */
void nofp_registers_info PARAMS ((char *, int));
void all_registers_info PARAMS ((char *, int));
void registers_info PARAMS ((char *, int));
/* Local functions: */
void continue_command PARAMS ((char *, int));
static void until_next_command PARAMS ((int));
@ -48,12 +59,6 @@ static void float_info PARAMS ((char *, int));
static void detach_command PARAMS ((char *, int));
static void nofp_registers_info PARAMS ((char *, int));
static void all_registers_info PARAMS ((char *, int));
static void registers_info PARAMS ((char *, int));
#if !defined (DO_REGISTERS_INFO)
static void do_registers_info PARAMS ((int, int));
#endif
@ -74,9 +79,9 @@ static void jump_command PARAMS ((char *, int));
static void step_1 PARAMS ((int, int, char *));
static void nexti_command PARAMS ((char *, int));
void nexti_command PARAMS ((char *, int));
static void stepi_command PARAMS ((char *, int));
void stepi_command PARAMS ((char *, int));
static void next_command PARAMS ((char *, int));
@ -84,6 +89,8 @@ static void step_command PARAMS ((char *, int));
static void run_command PARAMS ((char *, int));
void _initialize_infcmd PARAMS ((void));
#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
static void breakpoint_auto_delete_contents PARAMS ((PTR));
#endif
@ -206,6 +213,8 @@ Start it from the beginning? "))
exec_file = (char *) get_exec_file (0);
do_run_cleanups (NULL);
/* The exec file is re-read every time we do a generic_mourn_inferior, so
we just have to worry about the symbol file. */
reread_symbols ();
@ -241,7 +250,7 @@ Start it from the beginning? "))
environ_vector (inferior_environ));
}
static void
void
continue_command (proc_count_exp, from_tty)
char *proc_count_exp;
int from_tty;
@ -305,7 +314,7 @@ next_command (count_string, from_tty)
/* Likewise, but step only one instruction. */
/* ARGSUSED */
static void
void
stepi_command (count_string, from_tty)
char *count_string;
int from_tty;
@ -314,7 +323,7 @@ stepi_command (count_string, from_tty)
}
/* ARGSUSED */
static void
void
nexti_command (count_string, from_tty)
char *count_string;
int from_tty;
@ -338,7 +347,8 @@ step_1 (skip_subroutines, single_inst, count_string)
if (!single_inst || skip_subroutines) /* leave si command alone */
{
enable_longjmp_breakpoint();
cleanups = make_cleanup(disable_longjmp_breakpoint, 0);
cleanups = make_cleanup ((make_cleanup_func) disable_longjmp_breakpoint,
0);
}
for (; count > 0; count--)
@ -443,6 +453,21 @@ jump_command (arg, from_tty)
}
}
if (sfn != NULL)
{
fixup_symbol_section (sfn, 0);
if (section_is_overlay (SYMBOL_BFD_SECTION (sfn)) &&
!section_is_mapped (SYMBOL_BFD_SECTION (sfn)))
{
if (!query ("WARNING!!! Destination is in unmapped overlay! Jump anyway? "))
{
error ("Not confirmed.");
/* NOTREACHED */
}
}
}
addr = sal.pc;
if (from_tty)
@ -557,13 +582,13 @@ run_stack_dummy (addr, buffer)
struct breakpoint *bpt;
struct symtab_and_line sal;
INIT_SAL (&sal); /* initialize to zeroes */
#if CALL_DUMMY_LOCATION != AT_ENTRY_POINT
sal.pc = addr - CALL_DUMMY_START_OFFSET + CALL_DUMMY_BREAKPOINT_OFFSET;
#else
sal.pc = CALL_DUMMY_ADDRESS ();
#endif
sal.symtab = NULL;
sal.line = 0;
sal.section = find_pc_overlay (sal.pc);
/* Set up a FRAME for the dummy frame so we can pass it to
set_momentary_breakpoint. We need to give the breakpoint a
@ -705,7 +730,7 @@ finish_command (arg, from_tty)
breakpoint = set_momentary_breakpoint (sal, frame, bp_finish);
old_chain = make_cleanup(delete_breakpoint, breakpoint);
old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
/* Find the function we will return from. */
@ -947,10 +972,9 @@ path_command (dirname, from_tty)
path_info ((char *)NULL, from_tty);
}
/* The array of register names. */
char *reg_names[] = REGISTER_NAMES;
#ifdef REGISTER_NAMES
char *gdb_register_names[] = REGISTER_NAMES;
#endif
/* Print out the machine register regnum. If regnum is -1,
print all registers (fpregs == 1) or all non-float registers
(fpregs == 0).
@ -990,16 +1014,16 @@ do_registers_info (regnum, fpregs)
/* If the register name is empty, it is undefined for this
processor, so don't display anything. */
if (reg_names[i] == NULL || *(reg_names[i]) == '\0')
if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
continue;
fputs_filtered (reg_names[i], gdb_stdout);
print_spaces_filtered (15 - strlen (reg_names[i]), gdb_stdout);
fputs_filtered (REGISTER_NAME (i), gdb_stdout);
print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout);
/* Get the data in raw format. */
if (read_relative_register_raw_bytes (i, raw_buffer))
{
printf_filtered ("Invalid register contents\n");
printf_filtered ("*value not available*\n");
continue;
}
@ -1025,7 +1049,7 @@ do_registers_info (regnum, fpregs)
printf_filtered ("<invalid float>");
else
#endif
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0,
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
gdb_stdout, 0, 1, 0, Val_pretty_default);
printf_filtered ("\t(raw 0x");
@ -1052,10 +1076,10 @@ do_registers_info (regnum, fpregs)
/* Else print as integer in hex and in decimal. */
else
{
val_print (REGISTER_VIRTUAL_TYPE (i), raw_buffer, 0,
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
gdb_stdout, 'x', 1, 0, Val_pretty_default);
printf_filtered ("\t");
val_print (REGISTER_VIRTUAL_TYPE (i), raw_buffer, 0,
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
gdb_stdout, 0, 1, 0, Val_pretty_default);
}
@ -1070,7 +1094,9 @@ do_registers_info (regnum, fpregs)
}
#endif /* no DO_REGISTERS_INFO. */
static void
extern int target_map_name_to_register PARAMS ((char *, int));
void
registers_info (addr_exp, fpregs)
char *addr_exp;
int fpregs;
@ -1097,10 +1123,13 @@ registers_info (addr_exp, fpregs)
while (*end != '\0' && *end != ' ' && *end != '\t')
++end;
numregs = ARCH_NUM_REGS;
for (regnum = 0; regnum < numregs; regnum++)
if (!strncmp (addr_exp, reg_names[regnum], end - addr_exp)
&& strlen (reg_names[regnum]) == end - addr_exp)
goto found;
regnum = target_map_name_to_register (addr_exp, end - addr_exp);
if (regnum >= 0)
goto found;
regnum = numregs;
if (*addr_exp >= '0' && *addr_exp <= '9')
regnum = atoi (addr_exp); /* Take a number */
if (regnum >= numregs) /* Bad name, or bad number */
@ -1115,7 +1144,7 @@ found:
} while (*addr_exp != '\0');
}
static void
void
all_registers_info (addr_exp, from_tty)
char *addr_exp;
int from_tty;
@ -1123,13 +1152,14 @@ all_registers_info (addr_exp, from_tty)
registers_info (addr_exp, 1);
}
static void
void
nofp_registers_info (addr_exp, from_tty)
char *addr_exp;
int from_tty;
{
registers_info (addr_exp, 0);
}
/*
* TODO:
@ -1253,7 +1283,7 @@ _initialize_infcmd ()
add_show_from_set
(add_set_cmd ("args", class_run, var_string_noescape, (char *)&inferior_args,
"Set arguments to give program being debugged when it is started.\n\
"Set argument list to give program being debugged when it is started.\n\
Follow this command with any number of args, to be passed to the program.",
&setlist),
&showlist);

View file

@ -1,5 +1,6 @@
/* Target-vector operations for controlling Unix child processes, for GDB.
Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996
Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@ -16,16 +17,28 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "target.h"
#include "wait.h"
#include "gdbcore.h"
#include "command.h"
#include <signal.h>
#include <sys/types.h>
#include <fcntl.h>
#ifdef HAVE_WAIT_H
# include <wait.h>
#else
# ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
# endif
#endif
/* "wait.h" fills in the gaps left by <wait.h> */
#include "wait.h"
static void
child_prepare_to_store PARAMS ((void));
@ -48,7 +61,7 @@ child_attach PARAMS ((char *, int));
static void
ptrace_me PARAMS ((void));
static void
static int
ptrace_him PARAMS ((int));
static void child_create_inferior PARAMS ((char *, char *, char **));
@ -59,11 +72,35 @@ child_mourn_inferior PARAMS ((void));
static int
child_can_run PARAMS ((void));
static int
proc_wait PARAMS ((int, int*));
static void
child_stop PARAMS ((void));
#ifndef CHILD_THREAD_ALIVE
static int child_thread_alive PARAMS ((int));
#endif
extern char **environ;
/* Forward declaration */
extern struct target_ops child_ops;
int child_suppress_run = 0; /* Non-zero if inftarg should pretend not to
be a runnable target. Used by targets
that can sit atop inftarg, such as HPUX
thread support. */
static int
proc_wait (pid, status)
int pid;
int *status;
{
#ifndef __GO32__
return wait (status);
#endif
}
#ifndef CHILD_WAIT
/* Wait for child to do something. Return pid of child, or -1 in case
@ -78,18 +115,16 @@ child_wait (pid, ourstatus)
int status;
do {
if (attach_flag)
set_sigint_trap(); /* Causes SIGINT to be passed on to the
attached process. */
set_sigint_trap(); /* Causes SIGINT to be passed on to the
attached process. */
set_sigio_trap ();
pid = wait (&status);
pid = proc_wait (inferior_pid, &status);
save_errno = errno;
clear_sigio_trap ();
if (attach_flag)
clear_sigint_trap();
clear_sigint_trap();
if (pid == -1)
{
@ -108,6 +143,22 @@ child_wait (pid, ourstatus)
}
#endif /* CHILD_WAIT */
#ifndef CHILD_THREAD_ALIVE
/* Check to see if the given thread is alive.
FIXME: Is kill() ever the right way to do this? I doubt it, but
for now we're going to try and be compatable with the old thread
code. */
static int
child_thread_alive (pid)
int pid;
{
return (kill (pid, 0) != -1);
}
#endif
/* Attach to process PID, then initialize for debugging it. */
static void
@ -235,7 +286,7 @@ ptrace_me ()
/* Stub function which causes the GDB that runs it, to start ptrace-ing
the child process. */
static void
static int
ptrace_him (pid)
int pid;
{
@ -247,6 +298,8 @@ ptrace_him (pid)
/* One trap to exec the shell, one to exec the program being debugged. */
startup_inferior (2);
#endif
return pid;
}
/* Start an inferior Unix child process and sets inferior_pid to its pid.
@ -269,14 +322,36 @@ child_create_inferior (exec_file, allargs, env)
static void
child_mourn_inferior ()
{
/* FIXME: Should be in a header file */
extern void proc_remove_foreign PARAMS ((int));
unpush_target (&child_ops);
proc_remove_foreign (inferior_pid);
generic_mourn_inferior ();
}
static int
child_can_run ()
{
return(1);
/* This variable is controlled by modules that sit atop inftarg that may layer
their own process structure atop that provided here. hpux-thread.c does
this because of the Hpux user-mode level thread model. */
return !child_suppress_run;
}
/* Send a SIGINT to the process group. This acts just like the user typed a
^C on the controlling terminal.
XXX - This may not be correct for all systems. Some may want to use
killpg() instead of kill (-pgrp). */
static void
child_stop ()
{
extern pid_t inferior_process_group;
kill (-inferior_process_group, SIGINT);
}
struct target_ops child_ops = {
@ -286,9 +361,13 @@ struct target_ops child_ops = {
child_open, /* to_open */
0, /* to_close */
child_attach, /* to_attach */
NULL, /* to_post_attach */
NULL, /* to_require_attach */
child_detach, /* to_detach */
NULL, /* to_require_detach */
child_resume, /* to_resume */
child_wait, /* to_wait */
NULL, /* to_post_wait */
fetch_inferior_registers, /* to_fetch_registers */
store_inferior_registers, /* to_store_registers */
child_prepare_to_store, /* to_prepare_to_store */
@ -305,9 +384,33 @@ struct target_ops child_ops = {
0, /* to_load */
0, /* to_lookup_symbol */
child_create_inferior, /* to_create_inferior */
NULL, /* to_post_startup_inferior */
NULL, /* to_acknowledge_created_inferior */
NULL, /* to_clone_and_follow_inferior */
NULL, /* to_post_follow_inferior_by_clone */
NULL, /* to_insert_fork_catchpoint */
NULL, /* to_remove_fork_catchpoint */
NULL, /* to_insert_vfork_catchpoint */
NULL, /* to_remove_vfork_catchpoint */
NULL, /* to_has_forked */
NULL, /* to_has_vforked */
NULL, /* to_can_follow_vfork_prior_to_exec */
NULL, /* to_post_follow_vfork */
NULL, /* to_insert_exec_catchpoint */
NULL, /* to_remove_exec_catchpoint */
NULL, /* to_has_execd */
NULL, /* to_reported_exec_events_per_exec_call */
NULL, /* to_has_syscall_event */
NULL, /* to_has_exited */
child_mourn_inferior, /* to_mourn_inferior */
child_can_run, /* to_can_run */
0, /* to_notice_signals */
child_thread_alive, /* to_thread_alive */
child_stop, /* to_stop */
NULL, /* to_enable_exception_callback */
NULL, /* to_get_current_exception_event */
NULL, /* to_pid_to_exec_file */
NULL, /* to_core_file_to_sym_file */
process_stratum, /* to_stratum */
0, /* to_next */
1, /* to_has_all_memory */
@ -315,13 +418,30 @@ struct target_ops child_ops = {
1, /* to_has_stack */
1, /* to_has_registers */
1, /* to_has_execution */
0, /* sections */
0, /* sections_end */
0, /* to_sections */
0, /* to_sections_end */
OPS_MAGIC /* to_magic */
};
void
_initialize_inftarg ()
{
#ifdef HAVE_OPTIONAL_PROC_FS
char procname[32];
int fd;
/* If we have an optional /proc filesystem (e.g. under OSF/1),
don't add ptrace support if we can access the running GDB via /proc. */
#ifndef PROC_NAME_FMT
#define PROC_NAME_FMT "/proc/%05d"
#endif
sprintf (procname, PROC_NAME_FMT, getpid ());
if ((fd = open (procname, O_RDONLY)) >= 0)
{
close (fd);
return;
}
#endif
add_target (&child_ops);
}

View file

@ -41,7 +41,7 @@ extern struct type *java_void_type;
extern struct objfile *dynamics_objfile;
extern int
java_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
java_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
int, enum val_prettyprint));
extern int

View file

@ -136,8 +136,8 @@ java_value_print (val, stream, format, pretty)
fprintf_filtered (stream, "%d: ", i);
else
fprintf_filtered (stream, "%d..%d: ", i, i + reps - 1);
val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0,
stream, format, 2, 1, pretty);
val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0,
stream, format, 2, 1, pretty);
things_printed++;
i += reps;
}
@ -184,7 +184,7 @@ java_value_print (val, stream, format, pretty)
return 0;
}
return (val_print (type, VALUE_CONTENTS (val), address,
return (val_print (type, VALUE_CONTENTS (val), 0, address,
stream, format, 1, 0, pretty));
}
@ -343,7 +343,8 @@ java_print_value_fields (type, valaddr, address, stream,
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v), 0,
val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v),
0, 0,
stream, format, 0, recurse + 1, pretty);
}
}
@ -364,7 +365,7 @@ java_print_value_fields (type, valaddr, address, stream,
if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
v = value_addr (v);
val_print (VALUE_TYPE (v),
VALUE_CONTENTS (v), VALUE_ADDRESS (v),
VALUE_CONTENTS (v), 0, VALUE_ADDRESS (v),
stream, format, 0, recurse+1, pretty);
}
}
@ -372,6 +373,7 @@ java_print_value_fields (type, valaddr, address, stream,
{
val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
0,
address + TYPE_FIELD_BITPOS (type, i) / 8,
stream, format, 0, recurse + 1, pretty);
}
@ -402,10 +404,11 @@ java_print_value_fields (type, valaddr, address, stream,
The PRETTY parameter controls prettyprinting. */
int
java_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
pretty)
java_val_print (type, valaddr, embedded_offset, address, stream, format,
deref_ref, recurse, pretty)
struct type *type;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
GDB_FILE *stream;
int format;
@ -476,7 +479,7 @@ java_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
recurse, pretty);
break;
default:
return c_val_print (type, valaddr, address, stream, format,
return c_val_print (type, valaddr, 0, address, stream, format,
deref_ref, recurse, pretty);
}
return 0;

View file

@ -99,7 +99,7 @@ static void
unk_lang_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
static int
unk_lang_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
unk_lang_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
int, int, int, enum val_prettyprint));
static int
@ -834,7 +834,7 @@ lang_bool_type ()
if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
return type;
}
/* ... else fall through ... */
return builtin_type_bool;
default:
return builtin_type_int;
}
@ -1278,10 +1278,11 @@ unk_lang_print_type (type, varstring, stream, show, level)
}
static int
unk_lang_val_print (type, valaddr, address, stream, format, deref_ref,
unk_lang_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
recurse, pretty)
struct type *type;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
GDB_FILE *stream;
int format;

View file

@ -153,7 +153,7 @@ struct language_defn
/* Print a value using syntax appropriate for this language. */
int (*la_val_print) PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
int (*la_val_print) PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *,
int, int, int, enum val_prettyprint));
/* Print a top-level value using syntax appropriate for this language. */
@ -264,8 +264,8 @@ set_language PARAMS ((enum language));
#define LA_PRINT_TYPE(type,varstring,stream,show,level) \
(current_language->la_print_type(type,varstring,stream,show,level))
#define LA_VAL_PRINT(type,valaddr,addr,stream,fmt,deref,recurse,pretty) \
(current_language->la_val_print(type,valaddr,addr,stream,fmt,deref, \
#define LA_VAL_PRINT(type,valaddr,offset,addr,stream,fmt,deref,recurse,pretty) \
(current_language->la_val_print(type,valaddr,offset,addr,stream,fmt,deref, \
recurse,pretty))
#define LA_VALUE_PRINT(val,stream,fmt,pretty) \
(current_language->la_value_print(val,stream,fmt,pretty))

View file

@ -27,5 +27,5 @@ extern void /* Defined in m2-typeprint.c */
m2_print_type PARAMS ((struct type *, char *, GDB_FILE *, int, int));
extern int
m2_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
m2_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
int, enum val_prettyprint));

View file

@ -27,10 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* FIXME: For now, just explicitly declare c_val_print and use it instead */
int
m2_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
pretty)
m2_val_print (type, valaddr, embedded_offset, address,
stream, format, deref_ref, recurse, pretty)
struct type *type;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
GDB_FILE *stream;
int format;
@ -39,8 +40,8 @@ m2_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
enum val_prettyprint pretty;
{
extern int
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
int, enum val_prettyprint));
return (c_val_print (type, valaddr, address, stream, format, deref_ref,
c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR,
GDB_FILE *, int, int, int, enum val_prettyprint));
return (c_val_print (type, valaddr, 0, address, stream, format, deref_ref,
recurse, pretty));
}

View file

@ -4526,6 +4526,14 @@ m3_stop ()
error ("to_stop target function not implemented");
}
static char *
m3_pid_to_exec_file (pid)
int pid;
{
error ("to_pid_to_exec_file target function not implemented");
return NULL; /* To keep all compilers happy. */
}
struct target_ops m3_ops = {
"mach", /* to_shortname */
"Mach child process", /* to_longname */
@ -4533,9 +4541,13 @@ struct target_ops m3_ops = {
m3_open, /* to_open */
0, /* to_close */
m3_attach, /* to_attach */
NULL, /* to_post_attach */
NULL, /* to_require_attach */
m3_detach, /* to_detach */
NULL, /* to_require_detach */
m3_resume, /* to_resume */
mach_really_wait, /* to_wait */
NULL, /* to_post_wait */
fetch_inferior_registers, /* to_fetch_registers */
store_inferior_registers, /* to_store_registers */
m3_prepare_to_store, /* to_prepare_to_store */
@ -4551,13 +4563,31 @@ struct target_ops m3_ops = {
m3_kill_inferior, /* to_kill */
0, /* to_load */
0, /* to_lookup_symbol */
m3_create_inferior, /* to_create_inferior */
NULL, /* to_post_startup_inferior */
NULL, /* to_acknowledge_created_inferior */
NULL, /* to_clone_and_follow_inferior */
NULL, /* to_post_follow_inferior_by_clone */
NULL, /* to_insert_fork_catchpoint */
NULL, /* to_remove_fork_catchpoint */
NULL, /* to_insert_vfork_catchpoint */
NULL, /* to_remove_vfork_catchpoint */
NULL, /* to_has_forked */
NULL, /* to_has_vforked */
NULL, /* to_can_follow_vfork_prior_to_exec */
NULL, /* to_post_follow_vfork */
NULL, /* to_insert_exec_catchpoint */
NULL, /* to_remove_exec_catchpoint */
NULL, /* to_has_execd */
NULL, /* to_reported_exec_events_per_exec_call */
NULL, /* to_has_exited */
m3_mourn_inferior, /* to_mourn_inferior */
m3_can_run, /* to_can_run */
0, /* to_notice_signals */
0, /* to_thread_alive */
m3_stop, /* to_stop */
m3_pid_to_exec_file, /* to_pid_to_exec_file */
NULL, /* to_core_file_to_sym_file */
process_stratum, /* to_stratum */
0, /* to_next */
1, /* to_has_all_memory */

View file

@ -341,9 +341,13 @@ static void init_child_ops(void)
child_ops.to_open = child_open;
child_ops.to_close = child_close;
child_ops.to_attach = child_attach;
child_ops.to_post_attach = NULL;
child_ops.to_require_attach = NULL; /* to_require_attach */
child_ops.to_detach = child_detach;
child_ops.to_require_detach = NULL; /* to_require_detach */
child_ops.to_resume = child_resume;
child_ops.to_wait = child_wait;
child_ops.to_post_wait = NULL; /* to_post_wait */
child_ops.to_fetch_registers = child_fetch_inferior_registers;
child_ops.to_store_registers = child_store_inferior_registers;
child_ops.to_prepare_to_store = child_prepare_to_store;
@ -360,11 +364,30 @@ static void init_child_ops(void)
child_ops.to_load = 0;
child_ops.to_lookup_symbol = 0;
child_ops.to_create_inferior = child_create_inferior;
child_ops.to_post_startup_inferior = NULL; /* to_post_startup_inferior */
child_ops.to_acknowledge_created_inferior = NULL; /* to_acknowledge_created_inferior */
child_ops.to_clone_and_follow_inferior = NULL; /* to_clone_and_follow_inferior */
child_ops.to_post_follow_inferior_by_clone = NULL; /* to_post_follow_inferior_by_clone */
child_ops.to_insert_fork_catchpoint = NULL;
child_ops.to_remove_fork_catchpoint = NULL;
child_ops.to_insert_vfork_catchpoint = NULL;
child_ops.to_remove_vfork_catchpoint = NULL;
child_ops.to_has_forked = NULL; /* to_has_forked */
child_ops.to_has_vforked = NULL; /* to_has_vforked */
child_ops.to_can_follow_vfork_prior_to_exec = NULL;
child_ops.to_post_follow_vfork = NULL; /* to_post_follow_vfork */
child_ops.to_insert_exec_catchpoint = NULL;
child_ops.to_remove_exec_catchpoint = NULL;
child_ops.to_has_execd = NULL;
child_ops.to_reported_exec_events_per_exec_call = NULL;
child_ops.to_has_exited = NULL;
child_ops.to_mourn_inferior = child_mourn_inferior;
child_ops.to_can_run = child_can_run;
child_ops.to_notice_signals = 0;
child_ops.to_thread_alive = 0;
child_ops.to_stop = child_stop;
child_ops.to_pid_to_exec_file = NULL; /* to_pid_to_exec_file */
child_ops.to_core_file_to_sym_file = NULL;
child_ops.to_stratum = process_stratum;
child_ops.DONT_USE = 0;
child_ops.to_has_all_memory = 1;

View file

@ -54,11 +54,17 @@ int display_time;
int display_space;
/* Whether xdb commands will be handled */
int xdb_commands = 0;
/* Whether dbx commands will be handled */
int dbx_commands = 0;
static void print_gdb_help PARAMS ((GDB_FILE *));
extern void gdb_init PARAMS ((char *));
#ifdef __CYGWIN__
#include <windows.h> /* for MAX_PATH */
#include <sys/cygwin.h> /* for cygwin_conv_to_posix_path */
#include <sys/cygwin.h> /* for cygwin32_conv_to_posix_path */
#endif
int
@ -405,7 +411,7 @@ main (argc, argv)
if (tmp != NULL)
{
homedir = (char *) alloca (MAX_PATH+1);
cygwin_conv_to_posix_path (tmp, homedir);
cygwin32_conv_to_posix_path (tmp, homedir);
}
else
homedir = NULL;

View file

@ -51,12 +51,11 @@ enum mips_fpu_type
MIPS_FPU_NONE /* No floating point. */
};
static int mips_fpu_type_auto = 1;
#ifdef MIPS_DEFAULT_FPU_TYPE
static enum mips_fpu_type mips_fpu_type = MIPS_DEFAULT_FPU_TYPE;
#else
static enum mips_fpu_type mips_fpu = MIPS_FPU_DOUBLE;
#ifndef MIPS_DEFAULT_FPU_TYPE
#define MIPS_DEFAULT_FPU_TYPE MIPS_FPU_DOUBLE
#endif
static int mips_fpu_type_auto = 1;
static enum mips_fpu_type mips_fpu_type = MIPS_DEFAULT_FPU_TYPE;
#define MIPS_FPU_TYPE mips_fpu_type
/* start-sanitize-carp start-sanitize-vr4xxx */
@ -2214,7 +2213,7 @@ mips_print_register (regnum, all)
REGISTER_CONVERT_TO_TYPE (regnum, builtin_type_double, dbuffer);
printf_filtered ("(d%d: ", regnum-FP0_REGNUM);
val_print (builtin_type_double, dbuffer, 0,
val_print (builtin_type_double, dbuffer, 0, 0,
gdb_stdout, 0, 1, 0, Val_pretty_default);
printf_filtered ("); ");
}
@ -2236,14 +2235,14 @@ mips_print_register (regnum, all)
int offset = 4 * (TARGET_BYTE_ORDER == BIG_ENDIAN);
printf_filtered (" (float) ");
val_print (builtin_type_float, raw_buffer + offset, 0,
val_print (builtin_type_float, raw_buffer + offset, 0, 0,
gdb_stdout, 0, 1, 0, Val_pretty_default);
printf_filtered (", (double) ");
val_print (builtin_type_double, raw_buffer, 0,
val_print (builtin_type_double, raw_buffer, 0, 0,
gdb_stdout, 0, 1, 0, Val_pretty_default);
}
else
val_print (REGISTER_VIRTUAL_TYPE (regnum), raw_buffer, 0,
val_print (REGISTER_VIRTUAL_TYPE (regnum), raw_buffer, 0, 0,
gdb_stdout, 0, 1, 0, Val_pretty_default);
/* Else print as integer in hex. */
else

View file

@ -327,14 +327,13 @@ monitor_printf_noecho (va_alist)
if (remote_debug > 0)
puts_debug ("sent -->", sndbuf, "<--");
#endif
#if EXTRA_RDEBUG
if (remote_debug)
if (EXTRA_RDEBUG
&& remote_debug)
{
char *safe_string = (char *) alloca ((strlen (sndbuf) * 4) + 1);
monitor_printable_string (safe_string, sndbuf);
printf ("sent[%s]\n", safe_string);
}
#endif
monitor_write (sndbuf, len);
}
@ -372,14 +371,13 @@ monitor_printf (va_alist)
if (remote_debug > 0)
puts_debug ("sent -->", sndbuf, "<--");
#endif
#if EXTRA_RDEBUG
if (remote_debug)
if (EXTRA_RDEBUG
&& remote_debug)
{
char *safe_string = (char *) alloca ((len * 4) + 1);
monitor_printable_string (safe_string, sndbuf);
printf ("sent[%s]\n", safe_string);
}
#endif
monitor_write (sndbuf, len);
@ -400,7 +398,8 @@ monitor_write (buf, buflen)
int buflen;
{
if (SERIAL_WRITE(monitor_desc, buf, buflen))
fprintf_unfiltered (stderr, "SERIAL_WRITE failed: %s\n", safe_strerror (errno));
fprintf_unfiltered (gdb_stderr, "SERIAL_WRITE failed: %s\n",
safe_strerror (errno));
}
@ -525,14 +524,13 @@ monitor_expect (string, buf, buflen)
int c;
extern struct target_ops *targ_ops;
#if EXTRA_RDEBUG
if (remote_debug)
if (EXTRA_RDEBUG
&& remote_debug)
{
char *safe_string = (char *) alloca ((strlen (string) * 4) + 1);
monitor_printable_string (safe_string, string);
printf ("MON Expecting '%s'\n", safe_string);
}
#endif
immediate_quit = 1;
while (1)
@ -2048,7 +2046,8 @@ monitor_remove_breakpoint (addr, shadow)
return 0;
}
}
fprintf_unfiltered (stderr, "Can't find breakpoint associated with 0x%x\n", addr);
fprintf_unfiltered (gdb_stderr,
"Can't find breakpoint associated with 0x%x\n", addr);
return 1;
}
@ -2203,10 +2202,14 @@ static void init_base_monitor_ops(void)
monitor_ops.to_doc = NULL;
monitor_ops.to_open = NULL;
monitor_ops.to_close = monitor_close;
monitor_ops.to_attach = NULL;
monitor_ops.to_attach = NULL;
monitor_ops.to_post_attach = NULL;
monitor_ops.to_require_attach = NULL;
monitor_ops.to_detach = monitor_detach;
monitor_ops.to_require_detach = NULL;
monitor_ops.to_resume = monitor_resume;
monitor_ops.to_wait = monitor_wait;
monitor_ops.to_wait = monitor_wait;
monitor_ops.to_post_wait = NULL;
monitor_ops.to_fetch_registers = monitor_fetch_registers;
monitor_ops.to_store_registers = monitor_store_registers;
monitor_ops.to_prepare_to_store = monitor_prepare_to_store;
@ -2223,11 +2226,30 @@ static void init_base_monitor_ops(void)
monitor_ops.to_load = monitor_load;
monitor_ops.to_lookup_symbol = 0;
monitor_ops.to_create_inferior = monitor_create_inferior;
monitor_ops.to_post_startup_inferior = NULL;
monitor_ops.to_acknowledge_created_inferior = NULL;
monitor_ops.to_clone_and_follow_inferior = NULL;
monitor_ops.to_post_follow_inferior_by_clone = NULL;
monitor_ops.to_insert_fork_catchpoint = NULL;
monitor_ops.to_remove_fork_catchpoint = NULL;
monitor_ops.to_insert_vfork_catchpoint = NULL;
monitor_ops.to_remove_vfork_catchpoint = NULL;
monitor_ops.to_has_forked = NULL;
monitor_ops.to_has_vforked = NULL;
monitor_ops.to_can_follow_vfork_prior_to_exec = NULL;
monitor_ops.to_post_follow_vfork = NULL;
monitor_ops.to_insert_exec_catchpoint = NULL;
monitor_ops.to_remove_exec_catchpoint = NULL;
monitor_ops.to_has_execd = NULL;
monitor_ops.to_reported_exec_events_per_exec_call = NULL;
monitor_ops.to_has_exited = NULL;
monitor_ops.to_mourn_inferior = monitor_mourn_inferior;
monitor_ops.to_can_run = 0;
monitor_ops.to_notice_signals = 0;
monitor_ops.to_thread_alive = 0;
monitor_ops.to_stop = monitor_stop;
monitor_ops.to_stop = monitor_stop;
monitor_ops.to_pid_to_exec_file = NULL;
monitor_ops.to_core_file_to_sym_file = NULL;
monitor_ops.to_stratum = process_stratum;
monitor_ops.DONT_USE = 0;
monitor_ops.to_has_all_memory = 1;
@ -2265,3 +2287,5 @@ When enabled, a hashmark \'#\' is displayed.",
add_com ("monitor", class_obscure, monitor_command,
"Send a command to the debug monitor.");
}

View file

@ -388,7 +388,12 @@ struct objfile
To avoid this penalty for normal object files, we use this flag,
whose setting is determined upon symbol table read in. */
#define OBJF_REORDERED (2 << 1) /* Functions are reordered */
#define OBJF_REORDERED (1 << 2) /* Functions are reordered */
/* Distinguish between an objfile for a shared library and a
"vanilla" objfile. */
#define OBJF_SHARED (1 << 3) /* From a shared library */
/* The object file that the main symbol table was loaded from (e.g. the
argument to the "symbol-file" or "file" command). */

View file

@ -318,10 +318,14 @@ a wiggler, specify wiggler and then the port it is connected to\n\
(e.g. wiggler lpt1)." ; /* to_doc */
bdm_ppc_ops.to_open = bdm_ppc_open;
bdm_ppc_ops.to_close = ocd_close;
bdm_ppc_ops.to_attach = NULL;
bdm_ppc_ops.to_detach = ocd_detach;
bdm_ppc_ops.to_attach = NULL;
bdm_ppc_ops.to_post_attach = NULL;
bdm_ppc_ops.to_require_attach = NULL;
bdm_ppc_ops.to_detach = ocd_detach;
bdm_ppc_ops.to_require_detach = NULL;
bdm_ppc_ops.to_resume = ocd_resume;
bdm_ppc_ops.to_wait = bdm_ppc_wait;
bdm_ppc_ops.to_post_wait = NULL;
bdm_ppc_ops.to_fetch_registers = bdm_ppc_fetch_registers;
bdm_ppc_ops.to_store_registers = bdm_ppc_store_registers;
bdm_ppc_ops.to_prepare_to_store = ocd_prepare_to_store;
@ -338,11 +342,30 @@ a wiggler, specify wiggler and then the port it is connected to\n\
bdm_ppc_ops.to_load = ocd_load;
bdm_ppc_ops.to_lookup_symbol = NULL;
bdm_ppc_ops.to_create_inferior = ocd_create_inferior;
bdm_ppc_ops.to_post_startup_inferior = NULL;
bdm_ppc_ops.to_acknowledge_created_inferior = NULL;
bdm_ppc_ops.to_clone_and_follow_inferior = NULL;
bdm_ppc_ops.to_post_follow_inferior_by_clone = NULL;
bdm_ppc_ops.to_insert_fork_catchpoint = NULL;
bdm_ppc_ops.to_remove_fork_catchpoint = NULL;
bdm_ppc_ops.to_insert_vfork_catchpoint = NULL;
bdm_ppc_ops.to_remove_vfork_catchpoint = NULL;
bdm_ppc_ops.to_has_forked = NULL;
bdm_ppc_ops.to_has_vforked = NULL;
bdm_ppc_ops.to_can_follow_vfork_prior_to_exec = NULL;
bdm_ppc_ops.to_post_follow_vfork = NULL;
bdm_ppc_ops.to_insert_exec_catchpoint = NULL;
bdm_ppc_ops.to_remove_exec_catchpoint = NULL;
bdm_ppc_ops.to_has_execd = NULL;
bdm_ppc_ops.to_reported_exec_events_per_exec_call = NULL;
bdm_ppc_ops.to_has_exited = NULL;
bdm_ppc_ops.to_mourn_inferior = ocd_mourn;
bdm_ppc_ops.to_can_run = 0;
bdm_ppc_ops.to_notice_signals = 0;
bdm_ppc_ops.to_thread_alive = ocd_thread_alive;
bdm_ppc_ops.to_stop = ocd_stop;
bdm_ppc_ops.to_stop = ocd_stop;
bdm_ppc_ops.to_pid_to_exec_file = NULL;
bdm_ppc_ops.to_core_file_to_sym_file = NULL;
bdm_ppc_ops.to_stratum = process_stratum;
bdm_ppc_ops.DONT_USE = NULL;
bdm_ppc_ops.to_has_all_memory = 1;

View file

@ -534,7 +534,7 @@ static void procfs_attach PARAMS ((char *, int));
static void proc_set_exec_trap PARAMS ((void));
static int procfs_init_inferior PARAMS ((int));
static int procfs_init_inferior PARAMS ((int));
static struct procinfo *create_procinfo PARAMS ((int));
@ -2537,7 +2537,7 @@ NOTES
*/
static int
static int
procfs_init_inferior (pid)
int pid;
{
@ -2563,8 +2563,7 @@ procfs_init_inferior (pid)
/* One trap to exec the shell, one to exec the program being debugged. */
startup_inferior (2);
#endif
return pid;
return (pid);
}
/*
@ -5760,10 +5759,14 @@ struct target_ops procfs_ops = {
"Unix /proc child process (started by the \"run\" command).", /* to_doc */
procfs_open, /* to_open */
0, /* to_close */
procfs_attach, /* to_attach */
procfs_attach, /* to_attach */
NULL, /* to_post_attach */
procfs_attach, /* to_require_attach */
procfs_detach, /* to_detach */
procfs_resume, /* to_resume */
procfs_detach, /* to_require_detach */
procfs_resume, /* to_resume */
procfs_wait, /* to_wait */
NULL, /* to_post_wait */
procfs_fetch_registers, /* to_fetch_registers */
procfs_store_registers, /* to_store_registers */
procfs_prepare_to_store, /* to_prepare_to_store */
@ -5780,11 +5783,33 @@ struct target_ops procfs_ops = {
0, /* to_load */
0, /* to_lookup_symbol */
procfs_create_inferior, /* to_create_inferior */
NULL, /* to_post_startup_inferior */
NULL, /* to_acknowledge_created_inferior */
NULL, /* to_clone_and_follow_inferior */
NULL, /* to_post_follow_inferior_by_clone */
NULL, /* to_insert_fork_catchpoint */
NULL, /* to_remove_fork_catchpoint */
NULL, /* to_insert_vfork_catchpoint */
NULL, /* to_remove_vfork_catchpoint */
NULL, /* to_has_forked */
NULL, /* to_has_vforked */
NULL, /* to_can_follow_vfork_prior_to_exec */
NULL, /* to_post_follow_vfork */
NULL, /* to_insert_exec_catchpoint */
NULL, /* to_remove_exec_catchpoint */
NULL, /* to_has_execd */
NULL, /* to_reported_exec_events_per_exec_call */
NULL, /* to_has_syscall_event */
NULL, /* to_has_exited */
procfs_mourn_inferior, /* to_mourn_inferior */
procfs_can_run, /* to_can_run */
procfs_notice_signals, /* to_notice_signals */
procfs_thread_alive, /* to_thread_alive */
procfs_stop, /* to_stop */
NULL, /* to_enable_exception_callback */
NULL, /* to_get_current_exception_event */
NULL, /* to_pid_to_exec_file */
NULL, /* to_core_file_to_sym_file */
process_stratum, /* to_stratum */
0, /* to_next */
1, /* to_has_all_memory */

View file

@ -604,7 +604,7 @@ the baud rate, and the name of the program to run on the remote system.");
printf_filtered("Remote debugging using virtual addresses works only\n");
printf_filtered("\twhen virtual addresses map 1:1 to physical addresses.\n");
if (processor_type != a29k_freeze_mode) {
fprintf_filtered(stderr,
fprintf_filtered(gdb_stderr,
"Freeze-mode debugging not available, and can only be done on an A29050.\n");
}
}
@ -1238,7 +1238,7 @@ char *save; /* Throw away, let adapt save instructions */
expect_prompt ();
return(0); /* Success */
} else {
fprintf_filtered(stderr,
fprintf_filtered(gdb_stderr,
"Too many break points, break point not installed\n");
return(1); /* Failure */
}
@ -1372,9 +1372,13 @@ static void init_adapt_ops(void)
adapt_ops.to_open = adapt_open;
adapt_ops.to_close = adapt_close;
adapt_ops.to_attach = adapt_attach;
adapt_ops.to_post_attach = NULL;
adapt_ops.to_require_attach = NULL;
adapt_ops.to_detach = adapt_detach;
adapt_ops.to_require_detach = NULL;
adapt_ops.to_resume = adapt_resume;
adapt_ops.to_wait = adapt_wait;
adapt_ops.to_post_wait = NULL;
adapt_ops.to_fetch_registers = adapt_fetch_register;
adapt_ops.to_store_registers = adapt_store_register;
adapt_ops.to_prepare_to_store = adapt_prepare_to_store;
@ -1390,12 +1394,31 @@ static void init_adapt_ops(void)
adapt_ops.to_kill = adapt_kill;
adapt_ops.to_load = adapt_load;
adapt_ops.to_lookup_symbol = 0;
adapt_ops.to_create_inferior = adapt_create_inferior;
adapt_ops.to_create_inferior = adapt_create_inferior;
adapt_ops.to_post_startup_inferior = NULL;
adapt_ops.to_acknowledge_created_inferior = NULL;
adapt_ops.to_clone_and_follow_inferior = NULL;
adapt_ops.to_post_follow_inferior_by_clone = NULL;
adapt_ops.to_insert_fork_catchpoint = NULL;
adapt_ops.to_remove_fork_catchpoint = NULL;
adapt_ops.to_insert_vfork_catchpoint = NULL;
adapt_ops.to_remove_vfork_catchpoint = NULL;
adapt_ops.to_has_forked = NULL;
adapt_ops.to_has_vforked = NULL;
adapt_ops.to_can_follow_vfork_prior_to_exec = NULL;
adapt_ops.to_post_follow_vfork = NULL;
adapt_ops.to_insert_exec_catchpoint = NULL;
adapt_ops.to_remove_exec_catchpoint = NULL;
adapt_ops.to_has_execd = NULL;
adapt_ops.to_reported_exec_events_per_exec_call = NULL;
adapt_ops.to_has_exited = NULL;
adapt_ops.to_mourn_inferior = adapt_mourn;
adapt_ops.to_can_run = 0;
adapt_ops.to_notice_signals = 0;
adapt_ops.to_thread_alive = 0;
adapt_ops.to_stop = 0 ; /* process_stratum; */
adapt_ops.to_pid_to_exec_file = NULL;
adapt_ops.to_core_file_to_sym_file = NULL;
adapt_ops.to_stratum = 0;
adapt_ops.DONT_USE = 0 ;
adapt_ops.to_has_all_memory = 1;

View file

@ -133,10 +133,14 @@ static void init_array_ops(void)
Specify the serial device it is connected to (e.g. /dev/ttya)." ;
array_ops.to_open = array_open;
array_ops.to_close = array_close;
array_ops.to_attach = NULL;
array_ops.to_attach = NULL;
array_ops.to_post_attach = NULL;
array_ops.to_require_attach = NULL;
array_ops.to_detach = array_detach;
array_ops.to_require_detach = NULL;
array_ops.to_resume = array_resume;
array_ops.to_wait = array_wait;
array_ops.to_post_wait = NULL;
array_ops.to_fetch_registers = array_fetch_registers;
array_ops.to_store_registers = array_store_registers;
array_ops.to_prepare_to_store = array_prepare_to_store;
@ -153,11 +157,30 @@ Specify the serial device it is connected to (e.g. /dev/ttya)." ;
array_ops.to_load = 0;
array_ops.to_lookup_symbol = 0;
array_ops.to_create_inferior = array_create_inferior;
array_ops.to_post_startup_inferior = NULL;
array_ops.to_acknowledge_created_inferior = NULL;
array_ops.to_clone_and_follow_inferior = NULL;
array_ops.to_post_follow_inferior_by_clone = NULL;
array_ops.to_insert_fork_catchpoint = NULL;
array_ops.to_remove_fork_catchpoint = NULL;
array_ops.to_insert_vfork_catchpoint = NULL;
array_ops.to_remove_vfork_catchpoint = NULL;
array_ops.to_has_forked = NULL;
array_ops.to_has_vforked = NULL;
array_ops.to_can_follow_vfork_prior_to_exec = NULL;
array_ops.to_post_follow_vfork = NULL;
array_ops.to_insert_exec_catchpoint = NULL;
array_ops.to_remove_exec_catchpoint = NULL;
array_ops.to_has_execd = NULL;
array_ops.to_reported_exec_events_per_exec_call = NULL;
array_ops.to_has_exited = NULL;
array_ops.to_mourn_inferior = array_mourn_inferior;
array_ops.to_can_run = 0;
array_ops.to_notice_signals = 0;
array_ops.to_thread_alive = 0;
array_ops.to_stop = 0;
array_ops.to_stop = 0;
array_ops.to_pid_to_exec_file = NULL;
array_ops.to_core_file_to_sym_file = NULL;
array_ops.to_stratum = process_stratum;
array_ops.DONT_USE = 0;
array_ops.to_has_all_memory = 1;
@ -749,7 +772,7 @@ array_wait (pid, status)
i = 0;
}
fputc_unfiltered (c, gdb_stdout);
fflush (stdout);
gdb_flush (gdb_stdout);
}
c = SERIAL_READCHAR(tty_desc, timeout);
if (c > 0) {
@ -759,7 +782,7 @@ array_wait (pid, status)
break;
#if 0
fputc_unfiltered (c, gdb_stdout);
fflush (stdout);
gdb_flush (gdb_stdout);
#endif
}
}

View file

@ -148,7 +148,7 @@ bug_load (args, fromtty)
char *buffer = xmalloc (srec_frame);
printf_filtered ("%s\t: 0x%4x .. 0x%4x ", s->name, s->vma, s->vma + s->_raw_size);
fflush (stdout);
gdb_flush (gdb_stdout);
for (i = 0; i < s->_raw_size; i += srec_frame)
{
if (srec_frame > s->_raw_size - i)
@ -157,7 +157,7 @@ bug_load (args, fromtty)
bfd_get_section_contents (abfd, s, buffer, i, srec_frame);
bug_write_memory (s->vma + i, buffer, srec_frame);
printf_filtered ("*");
fflush (stdout);
gdb_flush (gdb_stdout);
}
printf_filtered ("\n");
free (buffer);
@ -335,7 +335,7 @@ bug_wait (pid, status)
case -1: /* trouble */
default:
fprintf_filtered (stderr,
fprintf_filtered (gdb_stderr,
"Trouble reading target during wait\n");
break;
}
@ -922,7 +922,7 @@ bug_insert_breakpoint (addr, save)
}
else
{
fprintf_filtered (stderr,
fprintf_filtered (gdb_stderr,
"Too many break points, break point not installed\n");
return(1);
}
@ -971,9 +971,13 @@ static void init_bug_ops(void)
bug_ops.to_open = bug_open;
bug_ops.to_close = gr_close;
bug_ops.to_attach = 0;
bug_ops.to_post_attach = NULL;
bug_ops.to_require_attach = NULL;
bug_ops.to_detach = gr_detach;
bug_ops.to_require_detach = NULL;
bug_ops.to_resume = bug_resume;
bug_ops.to_wait = bug_wait;
bug_ops.to_post_wait = NULL;
bug_ops.to_fetch_registers = bug_fetch_register;
bug_ops.to_store_registers = bug_store_register;
bug_ops.to_prepare_to_store = gr_prepare_to_store;
@ -990,11 +994,30 @@ static void init_bug_ops(void)
bug_ops.to_load = bug_load;
bug_ops.to_lookup_symbol = 0;
bug_ops.to_create_inferior = gr_create_inferior;
bug_ops.to_post_startup_inferior = NULL;
bug_ops.to_acknowledge_created_inferior = NULL;
bug_ops.to_clone_and_follow_inferior = NULL;
bug_ops.to_post_follow_inferior_by_clone = NULL;
bug_ops.to_insert_fork_catchpoint = NULL;
bug_ops.to_remove_fork_catchpoint = NULL;
bug_ops.to_insert_vfork_catchpoint = NULL;
bug_ops.to_remove_vfork_catchpoint = NULL;
bug_ops.to_has_forked = NULL;
bug_ops.to_has_vforked = NULL;
bug_ops.to_can_follow_vfork_prior_to_exec = NULL;
bug_ops.to_post_follow_vfork = NULL;
bug_ops.to_insert_exec_catchpoint = NULL;
bug_ops.to_remove_exec_catchpoint = NULL;
bug_ops.to_has_execd = NULL;
bug_ops.to_reported_exec_events_per_exec_call = NULL;
bug_ops.to_has_exited = NULL;
bug_ops.to_mourn_inferior = gr_mourn;
bug_ops.to_can_run = 0;
bug_ops.to_notice_signals = 0;
bug_ops.to_thread_alive = 0 ;
bug_ops.to_stop = 0;
bug_ops.to_pid_to_exec_file = NULL;
bug_ops.to_core_file_to_sym_file = NULL;
bug_ops.to_stratum = process_stratum ;
bug_ops.DONT_USE = 0;
bug_ops.to_has_all_memory = 1;

View file

@ -33,6 +33,7 @@
#include "defs.h"
#include "gdbcore.h"
#include "gdbarch.h"
#include "inferior.h"
#include "target.h"
#include "wait.h"
@ -2172,10 +2173,14 @@ target e7000 /dev/ttya 9600\n\
target e7000 foobar" ;
e7000_ops.to_open = e7000_open;
e7000_ops.to_close = e7000_close;
e7000_ops.to_attach = 0;
e7000_ops.to_detach = e7000_detach;
e7000_ops.to_attach = 0;
e7000_ops.to_post_attach = NULL;
e7000_ops.to_require_attach = NULL;
e7000_ops.to_detach = e7000_detach;
e7000_ops.to_require_detach = NULL;
e7000_ops.to_resume = e7000_resume;
e7000_ops.to_wait = e7000_wait;
e7000_ops.to_wait = e7000_wait;
e7000_ops.to_post_wait = NULL;
e7000_ops.to_fetch_registers = e7000_fetch_register;
e7000_ops.to_store_registers = e7000_store_register;
e7000_ops.to_prepare_to_store = e7000_prepare_to_store;
@ -2192,11 +2197,30 @@ target e7000 foobar" ;
e7000_ops.to_load = e7000_load;
e7000_ops.to_lookup_symbol = 0;
e7000_ops.to_create_inferior = e7000_create_inferior;
e7000_ops.to_post_startup_inferior = NULL;
e7000_ops.to_acknowledge_created_inferior = NULL;
e7000_ops.to_clone_and_follow_inferior = NULL;
e7000_ops.to_post_follow_inferior_by_clone = NULL;
e7000_ops.to_insert_fork_catchpoint = NULL;
e7000_ops.to_remove_fork_catchpoint = NULL;
e7000_ops.to_insert_vfork_catchpoint = NULL;
e7000_ops.to_remove_vfork_catchpoint = NULL;
e7000_ops.to_has_forked = NULL;
e7000_ops.to_has_vforked = NULL;
e7000_ops.to_can_follow_vfork_prior_to_exec = NULL;
e7000_ops.to_post_follow_vfork = NULL;
e7000_ops.to_insert_exec_catchpoint = NULL;
e7000_ops.to_remove_exec_catchpoint = NULL;
e7000_ops.to_has_execd = NULL;
e7000_ops.to_reported_exec_events_per_exec_call = NULL;
e7000_ops.to_has_exited = NULL;
e7000_ops.to_mourn_inferior = e7000_mourn_inferior;
e7000_ops.to_can_run = 0;
e7000_ops.to_notice_signals = 0;
e7000_ops.to_thread_alive = 0;
e7000_ops.to_stop = e7000_stop;
e7000_ops.to_stop = e7000_stop;
e7000_ops.to_pid_to_exec_file = NULL;
e7000_ops.to_core_file_to_sym_file = NULL;
e7000_ops.to_stratum = process_stratum;
e7000_ops.DONT_USE = 0;
e7000_ops.to_has_all_memory = 1;

View file

@ -987,9 +987,13 @@ target amd-eb /dev/ttya 9600 demo",
eb_ops.to_open = eb_open;
eb_ops.to_close = eb_close;
eb_ops.to_attach = 0;
eb_ops.to_post_attach = NULL;
eb_ops.to_require_attach = NULL;
eb_ops.to_detach = eb_detach;
eb_ops.to_require_detach = NULL;
eb_ops.to_resume = eb_resume;
eb_ops.to_wait = eb_wait;
eb_ops.to_post_wait = NULL;
eb_ops.to_fetch_registers = eb_fetch_register;
eb_ops.to_store_registers = eb_store_register;
eb_ops.to_prepare_to_store = eb_prepare_to_store;
@ -1006,11 +1010,30 @@ target amd-eb /dev/ttya 9600 demo",
eb_ops.to_load = generic_load; /* load */
eb_ops.to_lookup_symbol = 0; /* lookup_symbol */
eb_ops.to_create_inferior = eb_create_inferior;
eb_ops.to_post_startup_inferior = NULL;
eb_ops.to_acknowledge_created_inferior = NULL;
eb_ops.to_clone_and_follow_inferior = NULL;
eb_ops.to_post_follow_inferior_by_clone = NULL;
eb_ops.to_insert_fork_catchpoint = NULL;
eb_ops.to_remove_fork_catchpoint = NULL;
eb_ops.to_insert_vfork_catchpoint = NULL;
eb_ops.to_remove_vfork_catchpoint = NULL;
eb_ops.to_has_forked = NULL;
eb_ops.to_has_vforked = NULL;
eb_ops.to_can_follow_vfork_prior_to_exec = NULL;
eb_ops.to_post_follow_vfork = NULL;
eb_ops.to_insert_exec_catchpoint = NULL;
eb_ops.to_remove_exec_catchpoint = NULL;
eb_ops.to_has_execd = NULL;
eb_ops.to_reported_exec_events_per_exec_call = NULL;
eb_ops.to_has_exited = NULL;
eb_ops.to_mourn_inferior = eb_mourn_inferior;
eb_ops.to_can_run = 0; /* can_run */
eb_ops.to_notice_signals = 0; /* notice_signals */
eb_ops.to_thread_alive = 0; /* thread-alive */
eb_ops.to_stop = 0; /* to_stop */
eb_ops.to_pid_to_exec_file = NULL;
eb_ops.to_core_file_to_sym_file = NULL;
eb_ops.to_stratum = process_stratum;
eb_ops.DONT_USE = 0; /* next */
eb_ops.to_has_all_memory = 1;

View file

@ -2051,10 +2051,14 @@ static void init_es1800_ops(void)
Specify the serial device it is connected to (e.g. /dev/ttya)." ;
es1800_ops.to_open = es1800_open;
es1800_ops.to_close = es1800_close;
es1800_ops.to_attach = es1800_attach;
es1800_ops.to_attach = es1800_attach;
es1800_ops.to_post_attach = NULL;
es1800_ops.to_require_attach = NULL;
es1800_ops.to_detach = es1800_detach;
es1800_ops.to_require_detach = NULL;
es1800_ops.to_resume = es1800_resume;
es1800_ops.to_wait = NULL;
es1800_ops.to_wait = NULL;
es1800_ops.to_post_wait = NULL;
es1800_ops.to_fetch_registers = NULL;
es1800_ops.to_store_registers = NULL;
es1800_ops.to_prepare_to_store = es1800_prepare_to_store;
@ -2071,11 +2075,30 @@ Specify the serial device it is connected to (e.g. /dev/ttya)." ;
es1800_ops.to_load = es1800_load;
es1800_ops.to_lookup_symbol = NULL;
es1800_ops.to_create_inferior = es1800_create_inferior;
es1800_ops.to_post_startup_inferior = NULL;
es1800_ops.to_acknowledge_created_inferior = NULL;
es1800_ops.to_clone_and_follow_inferior = NULL;
es1800_ops.to_post_follow_inferior_by_clone = NULL;
es1800_ops.to_insert_fork_catchpoint = NULL;
es1800_ops.to_remove_fork_catchpoint = NULL;
es1800_ops.to_insert_vfork_catchpoint = NULL;
es1800_ops.to_remove_vfork_catchpoint = NULL;
es1800_ops.to_has_forked = NULL;
es1800_ops.to_has_vforked = NULL;
es1800_ops.to_can_follow_vfork_prior_to_exec = NULL;
es1800_ops.to_post_follow_vfork = NULL;
es1800_ops.to_insert_exec_catchpoint = NULL;
es1800_ops.to_remove_exec_catchpoint = NULL;
es1800_ops.to_has_execd = NULL;
es1800_ops.to_reported_exec_events_per_exec_call = NULL;
es1800_ops.to_has_exited = NULL;
es1800_ops.to_mourn_inferior = NULL;
es1800_ops.to_can_run = 0;
es1800_ops.to_notice_signals = 0;
es1800_ops.to_thread_alive = 0;
es1800_ops.to_stop = 0;
es1800_ops.to_stop = 0;
es1800_ops.to_pid_to_exec_file = NULL;
es1800_ops.to_core_file_to_sym_file = NULL;
es1800_ops.to_stratum = core_stratum;
es1800_ops.DONT_USE = 0;
es1800_ops.to_has_all_memory = 0;
@ -2093,47 +2116,70 @@ Specify the serial device it is connected to (e.g. /dev/ttya)." ;
struct target_ops es1800_child_ops ;
static void init_es1800_child_ops(void)
{
es1800_ops.to_shortname = "es1800_process";
es1800_ops.to_longname = "Remote serial target in ES1800-emulator protocol";
es1800_ops.to_doc = "Remote debugging on the es1800 emulator via a serial line.\n\
es1800_child_ops.to_shortname = "es1800_process";
es1800_child_ops.to_longname = "Remote serial target in ES1800-emulator protocol";
es1800_child_ops.to_doc = "Remote debugging on the es1800 emulator via a serial line.\n\
Specify the serial device it is connected to (e.g. /dev/ttya).";
es1800_ops.to_open = es1800_child_open;
es1800_ops.to_close = NULL;
es1800_ops.to_attach = es1800_attach;
es1800_ops.to_detach = es1800_child_detach;
es1800_ops.to_resume = es1800_resume;
es1800_ops.to_wait = es1800_wait;
es1800_ops.to_fetch_registers = es1800_fetch_register;
es1800_ops.to_store_registers = es1800_store_register;
es1800_ops.to_prepare_to_store = es1800_prepare_to_store;
es1800_ops.to_xfer_memory = es1800_xfer_inferior_memory;
es1800_ops.to_files_info = es1800_files_info;
es1800_ops.to_insert_breakpoint = es1800_insert_breakpoint;
es1800_ops.to_remove_breakpoint = es1800_remove_breakpoint;
es1800_ops.to_terminal_init = NULL;
es1800_ops.to_terminal_inferior = NULL;
es1800_ops.to_terminal_ours_for_output = NULL;
es1800_ops.to_terminal_ours = NULL;
es1800_ops.to_terminal_info = NULL;
es1800_ops.to_kill = es1800_kill;
es1800_ops.to_load = es1800_load;
es1800_ops.to_lookup_symbol = NULL;
es1800_ops.to_create_inferior = es1800_create_inferior;
es1800_ops.to_mourn_inferior = es1800_mourn_inferior;
es1800_ops.to_can_run = 0;
es1800_ops.to_notice_signals = 0;
es1800_ops.to_thread_alive = 0;
es1800_ops.to_stop = 0;
es1800_ops.to_stratum = process_stratum;
es1800_ops.DONT_USE = 0;
es1800_ops.to_has_all_memory = 1;
es1800_ops.to_has_memory = 1;
es1800_ops.to_has_stack = 1;
es1800_ops.to_has_registers = 1;
es1800_ops.to_has_execution = 1;
es1800_ops.to_sections = NULL;
es1800_ops.to_sections_end = NULL;
es1800_ops.to_magic = OPS_MAGIC;
es1800_child_ops.to_open = es1800_child_open;
es1800_child_ops.to_close = NULL;
es1800_child_ops.to_attach = es1800_attach;
es1800_child_ops.to_post_attach = NULL;
es1800_child_ops.to_require_attach = NULL;
es1800_child_ops.to_detach = es1800_child_detach;
es1800_child_ops.to_require_detach = NULL;
es1800_child_ops.to_resume = es1800_resume;
es1800_child_ops.to_wait = es1800_wait;
es1800_child_ops.to_post_wait = NULL;
es1800_child_ops.to_fetch_registers = es1800_fetch_register;
es1800_child_ops.to_store_registers = es1800_store_register;
es1800_child_ops.to_prepare_to_store = es1800_prepare_to_store;
es1800_child_ops.to_xfer_memory = es1800_xfer_inferior_memory;
es1800_child_ops.to_files_info = es1800_files_info;
es1800_child_ops.to_insert_breakpoint = es1800_insert_breakpoint;
es1800_child_ops.to_remove_breakpoint = es1800_remove_breakpoint;
es1800_child_ops.to_terminal_init = NULL;
es1800_child_ops.to_terminal_inferior = NULL;
es1800_child_ops.to_terminal_ours_for_output = NULL;
es1800_child_ops.to_terminal_ours = NULL;
es1800_child_ops.to_terminal_info = NULL;
es1800_child_ops.to_kill = es1800_kill;
es1800_child_ops.to_load = es1800_load;
es1800_child_ops.to_lookup_symbol = NULL;
es1800_child_ops.to_create_inferior = es1800_create_inferior;
es1800_child_ops.to_post_startup_inferior = NULL;
es1800_child_ops.to_acknowledge_created_inferior = NULL;
es1800_child_ops.to_clone_and_follow_inferior = NULL;
es1800_child_ops.to_post_follow_inferior_by_clone = NULL;
es1800_child_ops.to_insert_fork_catchpoint = NULL;
es1800_child_ops.to_remove_fork_catchpoint = NULL;
es1800_child_ops.to_insert_vfork_catchpoint = NULL;
es1800_child_ops.to_remove_vfork_catchpoint = NULL;
es1800_child_ops.to_has_forked = NULL;
es1800_child_ops.to_has_vforked = NULL;
es1800_child_ops.to_can_follow_vfork_prior_to_exec = NULL;
es1800_child_ops.to_post_follow_vfork = NULL;
es1800_child_ops.to_insert_exec_catchpoint = NULL;
es1800_child_ops.to_remove_exec_catchpoint = NULL;
es1800_child_ops.to_has_execd = NULL;
es1800_child_ops.to_reported_exec_events_per_exec_call = NULL;
es1800_child_ops.to_has_exited = NULL;
es1800_child_ops.to_mourn_inferior = es1800_mourn_inferior;
es1800_child_ops.to_can_run = 0;
es1800_child_ops.to_notice_signals = 0;
es1800_child_ops.to_thread_alive = 0;
es1800_child_ops.to_stop = 0;
es1800_child_ops.to_pid_to_exec_file = NULL;
es1800_child_ops.to_core_file_to_sym_file = NULL;
es1800_child_ops.to_stratum = process_stratum;
es1800_child_ops.DONT_USE = 0;
es1800_child_ops.to_has_all_memory = 1;
es1800_child_ops.to_has_memory = 1;
es1800_child_ops.to_has_stack = 1;
es1800_child_ops.to_has_registers = 1;
es1800_child_ops.to_has_execution = 1;
es1800_child_ops.to_sections = NULL;
es1800_child_ops.to_sections_end = NULL;
es1800_child_ops.to_magic = OPS_MAGIC;
}
void

View file

@ -157,7 +157,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
add_target (&hms_ops);
}
#if 0
/* This is kept here because we used to support the H8/500 in this module,
and I haven't done the H8/500 yet */
@ -1330,9 +1329,13 @@ by a serial line.";
hms_ops.to_open = hms_open;
hms_ops.to_close = hms_close;
hms_ops.to_attach = 0;
hms_ops.to_post_attach = NULL;
hms_ops.to_require_attach = NULL;
hms_ops.to_detach = hms_detach;
hms_ops.to_require_detach = NULL;
hms_ops.to_resume = hms_resume;
hms_ops.to_wait = hms_wait;
hms_ops.to_post_wait = NULL;
hms_ops.to_fetch_registers = hms_fetch_register;
hms_ops.to_store_registers = hms_store_register;
hms_ops.to_prepare_to_store = hms_prepare_to_store;
@ -1349,11 +1352,30 @@ by a serial line.";
hms_ops.to_load = generic_load;
hms_ops.to_lookup_symbol = 0;
hms_ops.to_create_inferior = hms_create_inferior;
hms_ops.to_post_startup_inferior = NULL;
hms_ops.to_acknowledge_created_inferior = NULL;
hms_ops.to_clone_and_follow_inferior = NULL;
hms_ops.to_post_follow_inferior_by_clone = NULL;
hms_ops.to_insert_fork_catchpoint = NULL;
hms_ops.to_remove_fork_catchpoint = NULL;
hms_ops.to_insert_vfork_catchpoint = NULL;
hms_ops.to_remove_vfork_catchpoint = NULL;
hms_ops.to_has_forked = NULL;
hms_ops.to_has_vforked = NULL;
hms_ops.to_can_follow_vfork_prior_to_exec = NULL;
hms_ops.to_post_follow_vfork = NULL;
hms_ops.to_insert_exec_catchpoint = NULL;
hms_ops.to_remove_exec_catchpoint = NULL;
hms_ops.to_has_execd = NULL;
hms_ops.to_reported_exec_events_per_exec_call = NULL;
hms_ops.to_has_exited = NULL;
hms_ops.to_mourn_inferior = hms_mourn;
hms_ops.to_can_run = 0;
hms_ops.to_notice_signals = 0;
hms_ops.to_thread_alive = 0;
hms_ops.to_stop = 0;
hms_ops.to_stop = 0;
hms_ops.to_pid_to_exec_file = NULL;
hms_ops.to_core_file_to_sym_file = NULL;
hms_ops.to_stratum = process_stratum;
hms_ops.DONT_USE = 0;
hms_ops.to_has_all_memory = 1;

View file

@ -638,7 +638,8 @@ mips_getstring (string, n)
c = SERIAL_READCHAR (mips_desc, 2);
if (c == SERIAL_TIMEOUT) {
fprintf_unfiltered (stderr, "Failed to read %d characters from target (TIMEOUT)\n", n);
fprintf_unfiltered (gdb_stderr,
"Failed to read %d characters from target (TIMEOUT)\n", n);
return 0;
}
@ -2163,7 +2164,7 @@ mips_xfer_memory (memaddr, myaddr, len, write, ignore)
if (i % 256 == 255)
{
printf_unfiltered ("*");
fflush (stdout);
gdb_flush (gdb_stdout);
}
if (status)
{
@ -2366,7 +2367,8 @@ pmon_insert_breakpoint (addr, contents_cache)
tbuff[2] = '\0'; /* terminate the string */
if (sscanf (tbuff, "%d", &bpnum) != 1)
{
fprintf_unfiltered (stderr, "Invalid decimal breakpoint number from target: %s\n", tbuff);
fprintf_unfiltered (gdb_stderr,
"Invalid decimal breakpoint number from target: %s\n", tbuff);
return 1;
}
@ -2384,19 +2386,21 @@ pmon_insert_breakpoint (addr, contents_cache)
if (sscanf (tbuff, "0x%08x", &bpaddr) != 1)
{
fprintf_unfiltered (stderr, "Invalid hex address from target: %s\n", tbuff);
fprintf_unfiltered (gdb_stderr,
"Invalid hex address from target: %s\n", tbuff);
return 1;
}
if (bpnum >= PMON_MAX_BP)
{
fprintf_unfiltered (stderr, "Error: Returned breakpoint number %d outside acceptable range (0..%d)\n",
fprintf_unfiltered (gdb_stderr,
"Error: Returned breakpoint number %d outside acceptable range (0..%d)\n",
bpnum, PMON_MAX_BP - 1);
return 1;
}
if (bpaddr != addr)
fprintf_unfiltered (stderr, "Warning: Breakpoint addresses do not match: 0x%x != 0x%x\n", addr, bpaddr);
fprintf_unfiltered (gdb_stderr, "Warning: Breakpoint addresses do not match: 0x%x != 0x%x\n", addr, bpaddr);
mips_pmon_bp_info[bpnum] = bpaddr;
@ -2427,7 +2431,7 @@ pmon_remove_breakpoint (addr, contents_cache)
if (bpnum >= PMON_MAX_BP)
{
fprintf_unfiltered (stderr,
fprintf_unfiltered (gdb_stderr,
"pmon_remove_breakpoint: Failed to find breakpoint at address 0x%s\n",
paddr_nz (addr));
return 1;
@ -2606,14 +2610,14 @@ check_lsi_error (addr, rerrflg)
if ((err->code & rerrflg) == err->code)
{
found = 1;
fprintf_unfiltered (stderr,
fprintf_unfiltered (gdb_stderr,
"common_breakpoint (0x%s): Warning: %s\n",
saddr,
err->string);
}
}
if (!found)
fprintf_unfiltered (stderr,
fprintf_unfiltered (gdb_stderr,
"common_breakpoint (0x%s): Unknown warning: 0x%x\n",
saddr,
rerrflg);
@ -2626,14 +2630,14 @@ check_lsi_error (addr, rerrflg)
{
if ((err->code & rerrflg) == err->code)
{
fprintf_unfiltered (stderr,
fprintf_unfiltered (gdb_stderr,
"common_breakpoint (0x%s): Error: %s\n",
saddr,
err->string);
return 1;
}
}
fprintf_unfiltered (stderr,
fprintf_unfiltered (gdb_stderr,
"common_breakpoint (0x%s): Unknown error: 0x%x\n",
saddr,
rerrflg);
@ -2830,7 +2834,8 @@ common_breakpoint (set, addr, len, type)
if (mips_monitor == MON_DDB)
rresponse = rerrflg;
if (rresponse != 22) /* invalid argument */
fprintf_unfiltered (stderr, "common_breakpoint (0x%s): Got error: 0x%x\n",
fprintf_unfiltered (gdb_stderr,
"common_breakpoint (0x%s): Got error: 0x%x\n",
paddr_nz (addr), rresponse);
return 1;
}
@ -3070,11 +3075,13 @@ pmon_makeb64 (v, p, n, chksum)
int count = (n / 6);
if ((n % 12) != 0) {
fprintf_unfiltered(stderr,"Fast encoding bitcount must be a multiple of 12bits: %dbit%s\n",n,(n == 1)?"":"s");
fprintf_unfiltered(gdb_stderr,
"Fast encoding bitcount must be a multiple of 12bits: %dbit%s\n",n,(n == 1)?"":"s");
return(0);
}
if (n > 36) {
fprintf_unfiltered(stderr,"Fast encoding cannot process more than 36bits at the moment: %dbits\n",n);
fprintf_unfiltered(gdb_stderr,
"Fast encoding cannot process more than 36bits at the moment: %dbits\n",n);
return(0);
}

View file

@ -345,7 +345,7 @@ erroid:
printf_filtered("\twhen virtual addresses map 1:1 to physical addresses.\n")
;
if (processor_type != a29k_freeze_mode) {
fprintf_filtered(stderr,
fprintf_filtered(gdb_stderr,
"Freeze-mode debugging not available, and can only be done on an A29050.\n");
}
@ -1015,7 +1015,7 @@ int from_tty;
/* You may need to do an init_target_mm() */
/* init_target_mm(?,?,?,?,?,?,?,?); */
immediate_quit--;
/* symbol_file_add (arg_string, from_tty, text_addr, 0, 0); */
/* symbol_file_add (arg_string, from_tty, text_addr, 0, 0, 0, 0); */
#endif
}
@ -1597,9 +1597,13 @@ static void init_mm_ops(void)
mm_ops.to_open = mm_open;
mm_ops.to_close = mm_close;
mm_ops.to_attach = mm_attach;
mm_ops.to_post_attach = NULL;
mm_ops.to_require_attach = NULL;
mm_ops.to_detach = mm_detach;
mm_ops.to_require_detach = NULL;
mm_ops.to_resume = mm_resume;
mm_ops.to_wait = mm_wait;
mm_ops.to_post_wait = NULL;
mm_ops.to_fetch_registers = mm_fetch_registers;
mm_ops.to_store_registers = mm_store_registers;
mm_ops.to_prepare_to_store = mm_prepare_to_store;
@ -1615,12 +1619,31 @@ static void init_mm_ops(void)
mm_ops.to_kill = mm_kill;
mm_ops.to_load = mm_load;
mm_ops.to_lookup_symbol = 0;
mm_ops.to_create_inferior = mm_create_inferior;
mm_ops.to_create_inferior = mm_create_inferior;
mm_ops.to_post_startup_inferior = NULL;
mm_ops.to_acknowledge_created_inferior = NULL;
mm_ops.to_clone_and_follow_inferior = NULL;
mm_ops.to_post_follow_inferior_by_clone = NULL;
mm_ops.to_insert_fork_catchpoint = NULL;
mm_ops.to_remove_fork_catchpoint = NULL;
mm_ops.to_insert_vfork_catchpoint = NULL;
mm_ops.to_remove_vfork_catchpoint = NULL;
mm_ops.to_has_forked = NULL;
mm_ops.to_has_vforked = NULL;
mm_ops.to_can_follow_vfork_prior_to_exec = NULL;
mm_ops.to_post_follow_vfork = NULL;
mm_ops.to_insert_exec_catchpoint = NULL;
mm_ops.to_remove_exec_catchpoint = NULL;
mm_ops.to_has_execd = NULL;
mm_ops.to_reported_exec_events_per_exec_call = NULL;
mm_ops.to_has_exited = NULL;
mm_ops.to_mourn_inferior = mm_mourn;
mm_ops.to_can_run = 0;
mm_ops.to_notice_signals = 0;
mm_ops.to_thread_alive = 0;
mm_ops.to_stop = 0;
mm_ops.to_pid_to_exec_file = NULL;
mm_ops.to_core_file_to_sym_file = NULL;
mm_ops.to_stratum = process_stratum;
mm_ops.DONT_USE = 0;
mm_ops.to_has_all_memory = 1;

View file

@ -128,7 +128,7 @@ extern char *mktemp();
extern void generic_mourn_inferior ();
extern struct target_ops nindy_ops;
extern GDB_FILE *instream;
extern FILE *instream;
extern char ninStopWhy ();
extern int ninMemGet ();
@ -779,9 +779,13 @@ specified when you started GDB." ;
nindy_ops.to_open = nindy_open;
nindy_ops.to_close = nindy_close;
nindy_ops.to_attach = 0;
nindy_ops.to_post_attach = NULL;
nindy_ops.to_require_attach = NULL;
nindy_ops.to_detach = nindy_detach;
nindy_ops.to_require_detach = NULL;
nindy_ops.to_resume = nindy_resume;
nindy_ops.to_wait = nindy_wait;
nindy_ops.to_post_wait = NULL;
nindy_ops.to_fetch_registers = nindy_fetch_registers;
nindy_ops.to_store_registers = nindy_store_registers;
nindy_ops.to_prepare_to_store = nindy_prepare_to_store;
@ -798,11 +802,30 @@ specified when you started GDB." ;
nindy_ops.to_load = nindy_load;
nindy_ops.to_lookup_symbol = 0; /* lookup_symbol */
nindy_ops.to_create_inferior = nindy_create_inferior;
nindy_ops.to_post_startup_inferior = NULL;
nindy_ops.to_acknowledge_created_inferior = NULL;
nindy_ops.to_clone_and_follow_inferior = NULL;
nindy_ops.to_post_follow_inferior_by_clone = NULL;
nindy_ops.to_insert_fork_catchpoint = NULL;
nindy_ops.to_remove_fork_catchpoint = NULL;
nindy_ops.to_insert_vfork_catchpoint = NULL;
nindy_ops.to_remove_vfork_catchpoint = NULL;
nindy_ops.to_has_forked = NULL;
nindy_ops.to_has_vforked = NULL;
nindy_ops.to_can_follow_vfork_prior_to_exec = NULL;
nindy_ops.to_post_follow_vfork = NULL;
nindy_ops.to_insert_exec_catchpoint = NULL;
nindy_ops.to_remove_exec_catchpoint = NULL;
nindy_ops.to_has_execd = NULL;
nindy_ops.to_reported_exec_events_per_exec_call = NULL;
nindy_ops.to_has_exited = NULL;
nindy_ops.to_mourn_inferior = nindy_mourn_inferior;
nindy_ops.to_can_run = 0; /* can_run */
nindy_ops.to_notice_signals = 0; /* notice_signals */
nindy_ops.to_thread_alive = 0; /* to_thread_alive */
nindy_ops.to_stop = 0; /* to_stop */
nindy_ops.to_pid_to_exec_file = NULL;
nindy_ops.to_core_file_to_sym_file = NULL;
nindy_ops.to_stratum = process_stratum;
nindy_ops.DONT_USE = 0; /* next */
nindy_ops.to_has_all_memory = 1;

View file

@ -276,10 +276,14 @@ static void init_nrom_ops(void)
nrom_ops.to_doc = "Remote debug using a NetROM over Ethernet";
nrom_ops.to_open = nrom_open;
nrom_ops.to_close = nrom_close;
nrom_ops.to_attach = NULL;
nrom_ops.to_detach = NULL;
nrom_ops.to_attach = NULL;
nrom_ops.to_post_attach = NULL;
nrom_ops.to_require_attach = NULL;
nrom_ops.to_detach = NULL;
nrom_ops.to_require_detach = NULL;
nrom_ops.to_resume = NULL;
nrom_ops.to_wait = NULL;
nrom_ops.to_wait = NULL;
nrom_ops.to_post_wait = NULL;
nrom_ops.to_fetch_registers = NULL;
nrom_ops.to_store_registers = NULL;
nrom_ops.to_prepare_to_store = NULL;
@ -295,12 +299,31 @@ static void init_nrom_ops(void)
nrom_ops.to_kill = nrom_kill;
nrom_ops.to_load = nrom_load;
nrom_ops.to_lookup_symbol = NULL;
nrom_ops.to_create_inferior = NULL;
nrom_ops.to_create_inferior = NULL;
nrom_ops.to_post_startup_inferior = NULL;
nrom_ops.to_acknowledge_created_inferior = NULL;
nrom_ops.to_clone_and_follow_inferior = NULL;
nrom_ops.to_post_follow_inferior_by_clone = NULL;
nrom_ops.to_insert_fork_catchpoint = NULL;
nrom_ops.to_remove_fork_catchpoint = NULL;
nrom_ops.to_insert_vfork_catchpoint = NULL;
nrom_ops.to_remove_vfork_catchpoint = NULL;
nrom_ops.to_has_forked = NULL;
nrom_ops.to_has_vforked = NULL;
nrom_ops.to_can_follow_vfork_prior_to_exec = NULL;
nrom_ops.to_post_follow_vfork = NULL;
nrom_ops.to_insert_exec_catchpoint = NULL;
nrom_ops.to_remove_exec_catchpoint = NULL;
nrom_ops.to_has_execd = NULL;
nrom_ops.to_reported_exec_events_per_exec_call = NULL;
nrom_ops.to_has_exited = NULL;
nrom_ops.to_mourn_inferior = nrom_mourn;
nrom_ops.to_can_run = NULL;
nrom_ops.to_notice_signals = 0;
nrom_ops.to_thread_alive = 0;
nrom_ops.to_stop = 0;
nrom_ops.to_pid_to_exec_file = NULL;
nrom_ops.to_core_file_to_sym_file = NULL;
nrom_ops.to_stratum = download_stratum;
nrom_ops.DONT_USE = NULL;
nrom_ops.to_has_all_memory = 1;

View file

@ -1155,9 +1155,13 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
rombug_ops.to_open = rombug_open;
rombug_ops.to_close = rombug_close;
rombug_ops.to_attach = 0;
rombug_ops.to_post_attach = NULL;
rombug_ops.to_require_attach = NULL;
rombug_ops.to_detach = rombug_detach;
rombug_ops.to_require_detach = NULL;
rombug_ops.to_resume = rombug_resume;
rombug_ops.to_wait = rombug_wait;
rombug_ops.to_post_wait = NULL;
rombug_ops.to_fetch_registers = rombug_fetch_register;
rombug_ops.to_store_registers = rombug_store_register;
rombug_ops.to_prepare_to_store = rombug_prepare_to_store;
@ -1174,11 +1178,30 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
rombug_ops.to_load = rombug_load; /* load */
rombug_ops.to_lookup_symbol = rombug_link; /* lookup_symbol */
rombug_ops.to_create_inferior = rombug_create_inferior;
rombug_ops.to_post_startup_inferior = NULL;
rombug_ops.to_acknowledge_created_inferior = NULL;
rombug_ops.to_clone_and_follow_inferior = NULL;
rombug_ops.to_post_follow_inferior_by_clone = NULL;
rombug_ops.to_insert_fork_catchpoint = NULL;
rombug_ops.to_remove_fork_catchpoint = NULL;
rombug_ops.to_insert_vfork_catchpoint = NULL;
rombug_ops.to_remove_vfork_catchpoint = NULL;
rombug_ops.to_has_forked = NULL;
rombug_ops.to_has_vforked = NULL;
rombug_ops.to_can_follow_vfork_prior_to_exec = NULL;
rombug_ops.to_post_follow_vfork = NULL;
rombug_ops.to_insert_exec_catchpoint = NULL;
rombug_ops.to_remove_exec_catchpoint = NULL;
rombug_ops.to_has_execd = NULL;
rombug_ops.to_reported_exec_events_per_exec_call = NULL;
rombug_ops.to_has_exited = NULL;
rombug_ops.to_mourn_inferior = rombug_mourn_inferior;
rombug_ops.to_can_run = 0; /* can_run */
rombug_ops.to_notice_signals = 0; /* notice_signals */
rombug_ops.to_thread_alive = 0;
rombug_ops.to_stop = 0; /* to_stop */
rombug_ops.to_pid_to_exec_file = NULL;
rombug_ops.to_core_file_to_sym_file = NULL;
rombug_ops.to_stratum = process_stratum;
rombug_ops.DONT_USE = 0; /* next */
rombug_ops.to_has_all_memory = 1;

View file

@ -1444,9 +1444,13 @@ static void init_remote_rdp_ops(void)
remote_rdp_ops.to_open = remote_rdp_open;
remote_rdp_ops.to_close = remote_rdp_close;
remote_rdp_ops.to_attach = remote_rdp_attach;
remote_rdp_ops.to_detach = NULL;
remote_rdp_ops.to_post_attach = NULL;
remote_rdp_ops.to_require_attach = NULL;
remote_rdp_ops.to_detach = NULL;
remote_rdp_ops.to_require_detach = NULL;
remote_rdp_ops.to_resume = remote_rdp_resume;
remote_rdp_ops.to_wait = remote_rdp_wait;
remote_rdp_ops.to_wait = remote_rdp_wait;
remote_rdp_ops.to_post_wait = NULL;
remote_rdp_ops.to_fetch_registers = remote_rdp_fetch_register;
remote_rdp_ops.to_store_registers = remote_rdp_store_register;
remote_rdp_ops.to_prepare_to_store = remote_rdp_prepare_to_store;
@ -1463,11 +1467,30 @@ static void init_remote_rdp_ops(void)
remote_rdp_ops.to_load = generic_load;
remote_rdp_ops.to_lookup_symbol = NULL;
remote_rdp_ops.to_create_inferior = remote_rdp_create_inferior;
remote_rdp_ops.to_post_startup_inferior = NULL;
remote_rdp_ops.to_acknowledge_created_inferior = NULL;
remote_rdp_ops.to_clone_and_follow_inferior = NULL;
remote_rdp_ops.to_post_follow_inferior_by_clone = NULL;
remote_rdp_ops.to_insert_fork_catchpoint = NULL;
remote_rdp_ops.to_remove_fork_catchpoint = NULL;
remote_rdp_ops.to_insert_vfork_catchpoint = NULL;
remote_rdp_ops.to_remove_vfork_catchpoint = NULL;
remote_rdp_ops.to_has_forked = NULL;
remote_rdp_ops.to_has_vforked = NULL;
remote_rdp_ops.to_can_follow_vfork_prior_to_exec = NULL;
remote_rdp_ops.to_post_follow_vfork = NULL;
remote_rdp_ops.to_insert_exec_catchpoint = NULL;
remote_rdp_ops.to_remove_exec_catchpoint = NULL;
remote_rdp_ops.to_has_execd = NULL;
remote_rdp_ops.to_reported_exec_events_per_exec_call = NULL;
remote_rdp_ops.to_has_exited = NULL;
remote_rdp_ops.to_mourn_inferior = generic_mourn_inferior;
remote_rdp_ops.to_can_run = remote_rdp_can_run;
remote_rdp_ops.to_notice_signals = 0;
remote_rdp_ops.to_thread_alive = 0;
remote_rdp_ops.to_stop = 0;
remote_rdp_ops.to_stop = 0;
remote_rdp_ops.to_pid_to_exec_file = NULL;
remote_rdp_ops.to_core_file_to_sym_file = NULL;
remote_rdp_ops.to_stratum = process_stratum;
remote_rdp_ops.DONT_USE = NULL;
remote_rdp_ops.to_has_all_memory = 1;

View file

@ -1132,10 +1132,14 @@ static void init_sds_ops(void)
Specify the serial device it is connected to (e.g. /dev/ttya).",
sds_ops.to_open = sds_open;
sds_ops.to_close = sds_close;
sds_ops.to_attach = NULL;
sds_ops.to_detach = sds_detach;
sds_ops.to_attach = NULL;
sds_ops.to_post_attach = NULL;
sds_ops.to_require_attach = NULL;
sds_ops.to_detach = sds_detach;
sds_ops.to_require_detach = NULL;
sds_ops.to_resume = sds_resume;
sds_ops.to_wait = sds_wait;
sds_ops.to_wait = sds_wait;
sds_ops.to_post_wait = NULL;
sds_ops.to_fetch_registers = sds_fetch_registers;
sds_ops.to_store_registers = sds_store_registers;
sds_ops.to_prepare_to_store = sds_prepare_to_store;
@ -1152,11 +1156,30 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
sds_ops.to_load = sds_load;
sds_ops.to_lookup_symbol = NULL;
sds_ops.to_create_inferior = sds_create_inferior;
sds_ops.to_post_startup_inferior = NULL;
sds_ops.to_acknowledge_created_inferior = NULL;
sds_ops.to_clone_and_follow_inferior = NULL;
sds_ops.to_post_follow_inferior_by_clone = NULL;
sds_ops.to_insert_fork_catchpoint = NULL;
sds_ops.to_remove_fork_catchpoint = NULL;
sds_ops.to_insert_vfork_catchpoint = NULL;
sds_ops.to_remove_vfork_catchpoint = NULL;
sds_ops.to_has_forked = NULL;
sds_ops.to_has_vforked = NULL;
sds_ops.to_can_follow_vfork_prior_to_exec = NULL;
sds_ops.to_post_follow_vfork = NULL;
sds_ops.to_insert_exec_catchpoint = NULL;
sds_ops.to_remove_exec_catchpoint = NULL;
sds_ops.to_has_execd = NULL;
sds_ops.to_reported_exec_events_per_exec_call = NULL;
sds_ops.to_has_exited = NULL;
sds_ops.to_mourn_inferior = sds_mourn;
sds_ops.to_can_run = 0;
sds_ops.to_notice_signals = 0;
sds_ops.to_thread_alive = 0;
sds_ops.to_stop = 0;
sds_ops.to_stop = 0;
sds_ops.to_pid_to_exec_file = NULL;
sds_ops.to_core_file_to_sym_file = NULL;
sds_ops.to_stratum = process_stratum;
sds_ops.DONT_USE = NULL;
sds_ops.to_has_all_memory = 1;

View file

@ -926,10 +926,14 @@ static void init_gdbsim_ops(void)
gdbsim_ops.to_doc = "Use the compiled-in simulator.";
gdbsim_ops.to_open = gdbsim_open;
gdbsim_ops.to_close = gdbsim_close;
gdbsim_ops.to_attach = NULL;
gdbsim_ops.to_detach = gdbsim_detach;
gdbsim_ops.to_attach = NULL;
gdbsim_ops.to_post_attach = NULL;
gdbsim_ops.to_require_attach = NULL;
gdbsim_ops.to_detach = gdbsim_detach;
gdbsim_ops.to_require_detach = NULL;
gdbsim_ops.to_resume = gdbsim_resume;
gdbsim_ops.to_wait = gdbsim_wait;
gdbsim_ops.to_wait = gdbsim_wait;
gdbsim_ops.to_post_wait = NULL;
gdbsim_ops.to_fetch_registers = gdbsim_fetch_register;
gdbsim_ops.to_store_registers = gdbsim_store_register;
gdbsim_ops.to_prepare_to_store = gdbsim_prepare_to_store;
@ -946,11 +950,30 @@ static void init_gdbsim_ops(void)
gdbsim_ops.to_load = gdbsim_load;
gdbsim_ops.to_lookup_symbol = NULL;
gdbsim_ops.to_create_inferior = gdbsim_create_inferior;
gdbsim_ops.to_post_startup_inferior = NULL;
gdbsim_ops.to_acknowledge_created_inferior = NULL;
gdbsim_ops.to_clone_and_follow_inferior = NULL;
gdbsim_ops.to_post_follow_inferior_by_clone = NULL;
gdbsim_ops.to_insert_fork_catchpoint = NULL;
gdbsim_ops.to_remove_fork_catchpoint = NULL;
gdbsim_ops.to_insert_vfork_catchpoint = NULL;
gdbsim_ops.to_remove_vfork_catchpoint = NULL;
gdbsim_ops.to_has_forked = NULL;
gdbsim_ops.to_has_vforked = NULL;
gdbsim_ops.to_can_follow_vfork_prior_to_exec = NULL;
gdbsim_ops.to_post_follow_vfork = NULL;
gdbsim_ops.to_insert_exec_catchpoint = NULL;
gdbsim_ops.to_remove_exec_catchpoint = NULL;
gdbsim_ops.to_has_execd = NULL;
gdbsim_ops.to_reported_exec_events_per_exec_call = NULL;
gdbsim_ops.to_has_exited = NULL;
gdbsim_ops.to_mourn_inferior = gdbsim_mourn_inferior;
gdbsim_ops.to_can_run = 0;
gdbsim_ops.to_notice_signals = 0;
gdbsim_ops.to_thread_alive = 0;
gdbsim_ops.to_stop = gdbsim_stop;
gdbsim_ops.to_stop = gdbsim_stop;
gdbsim_ops.to_pid_to_exec_file = NULL;
gdbsim_ops.to_core_file_to_sym_file = NULL;
gdbsim_ops.to_stratum = process_stratum;
gdbsim_ops.DONT_USE = NULL;
gdbsim_ops.to_has_all_memory = 1;
@ -971,7 +994,6 @@ void
_initialize_remote_sim ()
{
init_gdbsim_ops() ;
add_target (&gdbsim_ops);
add_com ("sim <command>", class_obscure, simulator_command,

View file

@ -806,9 +806,13 @@ the speed to connect at in bits per second." ;
st2000_ops.to_open = st2000_open;
st2000_ops.to_close = st2000_close;
st2000_ops.to_attach = 0;
st2000_run_ops.to_post_attach = NULL;
st2000_ops.to_require_attach = NULL;
st2000_ops.to_detach = st2000_detach;
st2000_ops.to_require_detach = NULL;
st2000_ops.to_resume = st2000_resume;
st2000_ops.to_wait = st2000_wait;
st2000_ops.to_post_wait = NULL;
st2000_ops.to_fetch_registers = st2000_fetch_register;
st2000_ops.to_store_registers = st2000_store_register;
st2000_ops.to_prepare_to_store = st2000_prepare_to_store;
@ -825,11 +829,30 @@ the speed to connect at in bits per second." ;
st2000_ops.to_load = 0; /* load */
st2000_ops.to_lookup_symbol = 0; /* lookup_symbol */
st2000_ops.to_create_inferior = st2000_create_inferior;
st2000_ops.to_post_startup_inferior = NULL;
st2000_ops.to_acknowledge_created_inferior = NULL;
st2000_ops.to_clone_and_follow_inferior = NULL;
st2000_ops.to_post_follow_inferior_by_clone = NULL;
st2000_run_ops.to_insert_fork_catchpoint = NULL;
st2000_run_ops.to_remove_fork_catchpoint = NULL;
st2000_run_ops.to_insert_vfork_catchpoint = NULL;
st2000_run_ops.to_remove_vfork_catchpoint = NULL;
st2000_ops.to_has_forked = NULL;
st2000_ops.to_has_vforked = NULL;
st2000_run_ops.to_can_follow_vfork_prior_to_exec = NULL;
st2000_ops.to_post_follow_vfork = NULL;
st2000_run_ops.to_insert_exec_catchpoint = NULL;
st2000_run_ops.to_remove_exec_catchpoint = NULL;
st2000_run_ops.to_has_execd = NULL;
st2000_run_ops.to_reported_exec_events_per_exec_call = NULL;
st2000_run_ops.to_has_exited = NULL;
st2000_ops.to_mourn_inferior = st2000_mourn_inferior;
st2000_ops.to_can_run = 0; /* can_run */
st2000_ops.to_notice_signals = 0; /* notice_signals */
st2000_ops.to_thread_alive = 0; /* thread alive */
st2000_ops.to_stop = 0; /* to_stop */
st2000_ops.to_pid_to_exec_file = NULL;
st2000_run_ops.to_core_file_to_sym_file = NULL;
st2000_ops.to_stratum = process_stratum;
st2000_ops.DONT_USE = 0; /* next */
st2000_ops.to_has_all_memory = 1;

View file

@ -1649,9 +1649,13 @@ To connect using a local connection to the \"tip.exe\" program which is\n\
udi_ops.to_open = udi_open;
udi_ops.to_close = udi_close;
udi_ops.to_attach = udi_attach;
udi_run_ops.to_post_attach = NULL;
udi_ops.to_require_attach = NULL;
udi_ops.to_detach = udi_detach;
udi_ops.to_require_detach = NULL;
udi_ops.to_resume = udi_resume;
udi_ops.to_wait = udi_wait;
udi_ops.to_post_wait = NULL;
udi_ops.to_fetch_registers = udi_fetch_registers;
udi_ops.to_store_registers = udi_store_registers;
udi_ops.to_prepare_to_store = udi_prepare_to_store;
@ -1668,11 +1672,30 @@ To connect using a local connection to the \"tip.exe\" program which is\n\
udi_ops.to_load = udi_load;
udi_ops.to_lookup_symbol = 0;
udi_ops.to_create_inferior = udi_create_inferior;
udi_ops.to_post_startup_inferior = NULL;
udi_ops.to_acknowledge_created_inferior = NULL;
udi_ops.to_clone_and_follow_inferior = NULL;
udi_ops.to_post_follow_inferior_by_clone = NULL;
udi_run_ops.to_insert_fork_catchpoint = NULL;
udi_run_ops.to_remove_fork_catchpoint = NULL;
udi_run_ops.to_insert_vfork_catchpoint = NULL;
udi_run_ops.to_remove_vfork_catchpoint = NULL;
udi_ops.to_has_forked = NULL;
udi_ops.to_has_vforked = NULL;
udi_run_ops.to_can_follow_vfork_prior_to_exec = NULL;
udi_ops.to_post_follow_vfork = NULL;
udi_run_ops.to_insert_exec_catchpoint = NULL;
udi_run_ops.to_remove_exec_catchpoint = NULL;
udi_run_ops.to_has_execd = NULL;
udi_run_ops.to_reported_exec_events_per_exec_call = NULL;
udi_run_ops.to_has_exited = NULL;
udi_ops.to_mourn_inferior = udi_mourn;
udi_ops.to_can_run = 0;
udi_ops.to_notice_signals = 0;
udi_ops.to_thread_alive = 0;
udi_ops.to_stop = 0;
udi_ops.to_stop = 0;
udi_ops.to_pid_to_exec_file = NULL;
udi_run_ops.to_core_file_to_sym_file = NULL;
udi_ops.to_stratum = process_stratum;
udi_ops.DONT_USE = 0;
udi_ops.to_has_all_memory = 1;

View file

@ -1405,9 +1405,13 @@ Specify the name of the machine to connect to.",
vx_ops.to_open = vx_open;
vx_ops.to_close = vx_close;
vx_ops.to_attach = vx_attach;
vx_ops.to_post_attach = NULL;
vx_ops.to_require_attach = NULL;
vx_ops.to_detach = 0; /* vx_detach, */
vx_ops.to_require_detach = NULL;
vx_ops.to_resume = 0;
vx_ops.to_wait = 0; /* resume, wait */
vx_ops.to_post_wait = NULL;
vx_ops.to_fetch_registers = 0;
vx_ops.to_store_registers = 0; /* read_reg, write_reg */
vx_ops.to_prepare_to_store = 0; /* prep_to_store, */
@ -1424,11 +1428,30 @@ Specify the name of the machine to connect to.",
vx_ops.to_load = vx_load_command;
vx_ops.to_lookup_symbol = vx_lookup_symbol;
vx_ops.to_create_inferior = vx_create_inferior;
vx_ops.to_post_startup_inferior = NULL;
vx_ops.to_acknowledge_created_inferior = NULL;
vx_ops.to_clone_and_follow_inferior = NULL;
vx_ops.to_post_follow_inferior_by_clone = NULL;
vx_ops.to_insert_fork_catchpoint = NULL;
vx_ops.to_remove_fork_catchpoint = NULL;
vx_ops.to_insert_vfork_catchpoint = NULL;
vx_ops.to_remove_vfork_catchpoint = NULL;
vx_ops.to_has_forked = NULL;
vx_ops.to_has_vforked = NULL;
vx_ops.to_can_follow_vfork_prior_to_exec = NULL;
vx_ops.to_post_follow_vfork = NULL;
vx_ops.to_insert_exec_catchpoint = NULL;
vx_ops.to_remove_exec_catchpoint = NULL;
vx_ops.to_has_execd = NULL;
vx_ops.to_reported_exec_events_per_exec_call = NULL;
vx_ops.to_has_exited = NULL;
vx_ops.to_mourn_inferior = 0; /* mourn_inferior */
vx_ops.to_can_run = 0; /* can_run */
vx_ops.to_notice_signals = 0; /* notice_signals */
vx_ops.to_thread_alive = 0; /* thread_alive */
vx_ops.to_stop = 0; /* to_stop */
vx_ops.to_pid_to_exec_file = NULL;
vx_ops.to_core_file_to_sym_file = NULL;
vx_ops.to_stratum = core_stratum;
vx_ops.DONT_USE = 0; /* next */
vx_ops.to_has_all_memory = 1;
@ -1453,9 +1476,13 @@ static void init_vx_run_ops(void)
vx_run_ops.to_open = vx_proc_open;
vx_run_ops.to_close = vx_proc_close;
vx_run_ops.to_attach = 0;
vx_run_ops.to_post_attach = NULL;
vx_run_ops.to_require_attach = NULL;
vx_run_ops.to_detach = vx_detach;
vx_run_ops.to_require_detach = NULL;
vx_run_ops.to_resume = vx_resume;
vx_run_ops.to_wait = vx_wait;
vx_run_ops.to_post_wait = NULL;
vx_run_ops.to_fetch_registers = vx_read_register;
vx_run_ops.to_store_registers = vx_write_register;
vx_run_ops.to_prepare_to_store = vx_prepare_to_store;
@ -1472,11 +1499,30 @@ static void init_vx_run_ops(void)
vx_run_ops.to_load = vx_load_command;
vx_run_ops.to_lookup_symbol = vx_lookup_symbol;
vx_run_ops.to_create_inferior = 0;
vx_run_ops.to_post_startup_inferior = NULL;
vx_run_ops.to_acknowledge_created_inferior = NULL;
vx_run_ops.to_clone_and_follow_inferior = NULL;
vx_run_ops.to_post_follow_inferior_by_clone = NULL;
vx_run_ops.to_insert_fork_catchpoint = NULL;
vx_run_ops.to_remove_fork_catchpoint = NULL;
vx_run_ops.to_insert_vfork_catchpoint = NULL;
vx_run_ops.to_remove_vfork_catchpoint = NULL;
vx_run_ops.to_has_forked = NULL;
vx_run_ops.to_has_vforked = NULL;
vx_run_ops.to_can_follow_vfork_prior_to_exec = NULL;
vx_run_ops.to_post_follow_fork = NULL;
vx_run_ops.to_insert_exec_catchpoint = NULL;
vx_run_ops.to_remove_exec_catchpoint = NULL;
vx_run_ops.to_has_execd = NULL;
vx_run_ops.to_reported_exec_events_per_exec_call = NULL;
vx_run_ops.to_has_exited = NULL;
vx_run_ops.to_mourn_inferior = vx_mourn_inferior ;
vx_run_ops.to_can_run = 0;
vx_run_ops.to_notice_signals = 0;
vx_run_ops.to_thread_alive = 0;
vx_run_ops.to_stop = 0;
vx_run_ops.to_stop = 0;
vx_run_ops.to_pid_to_exec_file = NULL;
vx_run_ops.to_core_file_to_sym_file = NULL;
vx_run_ops.to_stratum = process_stratum;
vx_run_ops.DONT_USE = 0;
vx_run_ops.to_has_all_memory = 0;

File diff suppressed because it is too large Load diff

View file

@ -427,7 +427,7 @@ add_vmap (ldi)
objname, bfd_errmsg (bfd_get_error ()));
/*NOTREACHED*/
}
obj = allocate_objfile (vp->bfd, 0);
obj = allocate_objfile (vp->bfd, 0, 0, 0);
vp->objfile = obj;
#ifndef SOLIB_SYMBOLS_MANUAL

View file

@ -29,7 +29,7 @@ struct value;
extern int scm_value_print PARAMS ((struct value *, GDB_FILE*,
int, enum val_prettyprint));
extern int scm_val_print PARAMS ((struct type*, char*, CORE_ADDR, GDB_FILE*,
extern int scm_val_print PARAMS ((struct type*, char*, int, CORE_ADDR, GDB_FILE*,
int, int, int, enum val_prettyprint));
extern LONGEST scm_get_field PARAMS ((LONGEST, int));

View file

@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* FIXME: Should be in a header file that we import. */
extern int
c_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
c_val_print PARAMS ((struct type *, char *, int, CORE_ADDR, GDB_FILE *, int, int,
int, enum val_prettyprint));
static void scm_ipruk PARAMS ((char *, LONGEST, GDB_FILE *));
@ -157,7 +157,7 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
enum val_prettyprint pretty;
{
taloop:
switch (7 & svalue)
switch (7 & (int) svalue)
{
case 2:
case 6:
@ -375,10 +375,11 @@ scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
}
int
scm_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
pretty)
scm_val_print (type, valaddr, embedded_offset, address,
stream, format, deref_ref, recurse, pretty)
struct type *type;
char *valaddr;
int embedded_offset;
CORE_ADDR address;
GDB_FILE *stream;
int format;
@ -404,7 +405,7 @@ scm_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
}
else
{
return c_val_print (type, valaddr, address, stream, format,
return c_val_print (type, valaddr, 0, address, stream, format,
deref_ref, recurse, pretty);
}
}
@ -416,6 +417,6 @@ scm_value_print (val, stream, format, pretty)
int format;
enum val_prettyprint pretty;
{
return (val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
return (val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
}

View file

@ -1512,9 +1512,13 @@ struct target_ops sol_thread_ops = {
sol_thread_open, /* to_open */
0, /* to_close */
sol_thread_attach, /* to_attach */
NULL, /* to_post_attach */
NULL, /* to_require_attach */
sol_thread_detach, /* to_detach */
NULL, /* to_require_detach */
sol_thread_resume, /* to_resume */
sol_thread_wait, /* to_wait */
NULL, /* to_post_wait */
sol_thread_fetch_registers, /* to_fetch_registers */
sol_thread_store_registers, /* to_store_registers */
sol_thread_prepare_to_store, /* to_prepare_to_store */
@ -1531,11 +1535,33 @@ struct target_ops sol_thread_ops = {
0, /* to_load */
0, /* to_lookup_symbol */
sol_thread_create_inferior, /* to_create_inferior */
NULL, /* to_post_startup_inferior */
NULL, /* to_acknowledge_created_inferior */
NULL, /* to_clone_and_follow_inferior */
NULL, /* to_post_follow_inferior_by_clone */
NULL, /* to_insert_fork_catchpoint */
NULL, /* to_remove_fork_catchpoint */
NULL, /* to_insert_vfork_catchpoint */
NULL, /* to_remove_vfork_catchpoint */
NULL, /* to_has_forked */
NULL, /* to_has_vforked */
NULL, /* to_can_follow_vfork_prior_to_exec */
NULL, /* to_post_follow_vfork */
NULL, /* to_insert_exec_catchpoint */
NULL, /* to_remove_exec_catchpoint */
NULL, /* to_has_execd */
NULL, /* to_reported_exec_events_per_exec_call */
NULL, /* to_has_syscall_event */
NULL, /* to_has_exited */
sol_thread_mourn_inferior, /* to_mourn_inferior */
sol_thread_can_run, /* to_can_run */
sol_thread_notice_signals, /* to_notice_signals */
sol_thread_alive, /* to_thread_alive */
sol_thread_stop, /* to_stop */
NULL, /* to_enable_exception_callback */
NULL, /* to_get_current_exception_event */
NULL, /* to_pid_to_exec_file */
NULL, /* to_core_file_to_sym_file */
process_stratum, /* to_stratum */
0, /* to_next */
1, /* to_has_all_memory */
@ -1555,9 +1581,13 @@ struct target_ops sol_core_ops = {
sol_core_open, /* to_open */
sol_core_close, /* to_close */
sol_thread_attach, /* XXX to_attach */
NULL, /* to_post_attach */
NULL, /* to_require_attach */
sol_core_detach, /* to_detach */
NULL, /* to_require_detach */
0, /* to_resume */
0, /* to_wait */
NULL, /* to_post_wait */
sol_thread_fetch_registers, /* to_fetch_registers */
0, /* to_store_registers */
0, /* to_prepare_to_store */
@ -1574,11 +1604,33 @@ struct target_ops sol_core_ops = {
0, /* to_load */
0, /* to_lookup_symbol */
sol_thread_create_inferior, /* XXX to_create_inferior */
NULL, /* to_post_startup_inferior */
NULL, /* to_acknowledge_created_inferior */
NULL, /* to_clone_and_follow_inferior */
NULL, /* to_post_follow_inferior_by_clone */
NULL, /* to_insert_fork_catchpoint */
NULL, /* to_remove_fork_catchpoint */
NULL, /* to_insert_vfork_catchpoint */
NULL, /* to_remove_vfork_catchpoint */
NULL, /* to_has_forked */
NULL, /* to_has_vforked */
NULL, /* to_can_follow_vfork_prior_to_exec */
NULL, /* to_post_follow_vfork */
NULL, /* to_insert_exec_catchpoint */
NULL, /* to_remove_exec_catchpoint */
NULL, /* to_has_execd */
NULL, /* to_reported_exec_events_per_exec_call */
NULL, /* to_has_syscall_event */
NULL, /* to_has_exited */
0, /* to_mourn_inferior */
0, /* to_can_run */
0, /* to_notice_signals */
0, /* to_thread_alive */
0, /* to_stop */
NULL, /* to_enable_exception_callback */
NULL, /* to_get_current_exception_event */
NULL, /* to_pid_to_exec_file */
NULL, /* to_core_file_to_sym_file */
core_stratum, /* to_stratum */
0, /* to_next */
0, /* to_has_all_memory */

View file

@ -902,9 +902,13 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
sparclite_ops.to_open = sparclite_open;
sparclite_ops.to_close = sparclite_close;
sparclite_ops.to_attach = 0;
sparclite_ops.to_detach = 0;
sparclite_ops.to_post_attach = NULL;
sparclite_ops.to_require_attach = NULL;
sparclite_ops.to_detach = 0;
sparclite_ops.to_require_detach = NULL;
sparclite_ops.to_resume = 0;
sparclite_ops.to_wait = 0;
sparclite_ops.to_wait = 0;
sparclite_ops.to_post_wait = NULL;
sparclite_ops.to_fetch_registers = 0;
sparclite_ops.to_store_registers = 0;
sparclite_ops.to_prepare_to_store = 0;
@ -920,12 +924,31 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
sparclite_ops.to_kill = 0;
sparclite_ops.to_load = sparclite_download;
sparclite_ops.to_lookup_symbol = 0;
sparclite_ops.to_create_inferior = 0;
sparclite_ops.to_create_inferior = 0;
sparclite_ops.to_post_startup_inferior = NULL;
sparclite_ops.to_acknowledge_created_inferior = NULL;
sparclite_ops.to_clone_and_follow_inferior = NULL;
sparclite_ops.to_post_follow_inferior_by_clone = NULL;
sparclite_ops.to_insert_fork_catchpoint = NULL;
sparclite_ops.to_remove_fork_catchpoint = NULL;
sparclite_ops.to_insert_vfork_catchpoint = NULL;
sparclite_ops.to_remove_vfork_catchpoint = NULL;
sparclite_ops.to_has_forked = NULL;
sparclite_ops.to_has_vforked = NULL;
sparclite_ops.to_can_follow_vfork_prior_to_exec = NULL;
sparclite_ops.to_post_follow_vfork = NULL;
sparclite_ops.to_insert_exec_catchpoint = NULL;
sparclite_ops.to_remove_exec_catchpoint = NULL;
sparclite_ops.to_has_execd = NULL;
sparclite_ops.to_reported_exec_events_per_exec_call = NULL;
sparclite_ops.to_has_exited = NULL;
sparclite_ops.to_mourn_inferior = 0;
sparclite_ops.to_can_run = 0;
sparclite_ops.to_notice_signals = 0;
sparclite_ops.to_thread_alive = 0;
sparclite_ops.to_stop = 0;
sparclite_ops.to_stop = 0;
sparclite_ops.to_pid_to_exec_file = NULL;
sparclite_ops.to_core_file_to_sym_file = NULL;
sparclite_ops.to_stratum = download_stratum;
sparclite_ops.DONT_USE = 0;
sparclite_ops.to_has_all_memory = 0;

View file

@ -1,5 +1,5 @@
/* Symbol table lookup for the GNU debugger, GDB.
Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 1997
Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
This file is part of GDB.
@ -45,56 +45,65 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Prototypes for local functions */
static int
find_methods PARAMS ((struct type *, char *, struct symbol **));
static int find_methods PARAMS ((struct type *, char *, struct symbol **));
static void
completion_list_add_name PARAMS ((char *, char *, int, char *, char *));
static void completion_list_add_name PARAMS ((char *, char *, int, char *,
char *));
static void
build_canonical_line_spec PARAMS ((struct symtab_and_line *, char *, char ***));
static void build_canonical_line_spec PARAMS ((struct symtab_and_line *,
char *, char ***));
static struct symtabs_and_lines
decode_line_2 PARAMS ((struct symbol *[], int, int, char ***));
static struct symtabs_and_lines decode_line_2 PARAMS ((struct symbol *[],
int, int, char ***));
static void
rbreak_command PARAMS ((char *, int));
static void rbreak_command PARAMS ((char *, int));
static void
types_info PARAMS ((char *, int));
static void types_info PARAMS ((char *, int));
static void
functions_info PARAMS ((char *, int));
static void functions_info PARAMS ((char *, int));
static void
variables_info PARAMS ((char *, int));
static void variables_info PARAMS ((char *, int));
static void
sources_info PARAMS ((char *, int));
static void sources_info PARAMS ((char *, int));
static void
output_source_filename PARAMS ((char *, int *));
static void output_source_filename PARAMS ((char *, int *));
char *
operator_chars PARAMS ((char *, char **));
char *operator_chars PARAMS ((char *, char **));
static int find_line_common PARAMS ((struct linetable *, int, int *));
static struct partial_symbol *
lookup_partial_symbol PARAMS ((struct partial_symtab *, const char *,
int, namespace_enum));
static struct partial_symbol *lookup_partial_symbol PARAMS
((struct partial_symtab *, const char *,
int, namespace_enum));
static struct partial_symbol *
fixup_psymbol_section PARAMS ((struct partial_symbol *, struct objfile *));
static struct partial_symbol *fixup_psymbol_section PARAMS ((struct
partial_symbol *, struct objfile *));
static struct symtab *
lookup_symtab_1 PARAMS ((char *));
static struct symtab *lookup_symtab_1 PARAMS ((char *));
static void
cplusplus_hint PARAMS ((char *));
static void cplusplus_hint PARAMS ((char *));
static struct symbol *
find_active_alias PARAMS ((struct symbol *sym, CORE_ADDR addr));
static struct symbol *find_active_alias PARAMS ((struct symbol *sym,
CORE_ADDR addr));
/* This flag is used in hppa-tdep.c, and set in hp-symtab-read.c */
/* Signals the presence of objects compiled by HP compilers */
int hp_som_som_object_present = 0;
static void fixup_section PARAMS ((struct general_symbol_info *,
struct objfile *));
static int file_matches PARAMS ((char *, char **, int));
static void print_symbol_info PARAMS ((namespace_enum,
struct symtab *, struct symbol *,
int, char *));
static void print_msymbol_info PARAMS ((struct minimal_symbol *));
static void symtab_symbol_info PARAMS ((char *, namespace_enum, int));
void _initialize_symtab PARAMS ((void));
/* */
@ -887,6 +896,120 @@ lookup_partial_symbol (pst, name, global, namespace)
return (NULL);
}
/* Look up a type named NAME in the struct_namespace. The type returned
must not be opaque -- i.e., must have at least one field defined
This code was modelled on lookup_symbol -- the parts not relevant to looking
up types were just left out. In particular it's assumed here that types
are available in struct_namespace and only at file-static or global blocks. */
struct type *
lookup_transparent_type (name)
const char *name;
{
register struct symbol *sym;
register struct symtab *s = NULL;
register struct partial_symtab *ps;
struct blockvector *bv;
register struct objfile *objfile;
register struct block *block;
register struct minimal_symbol *msymbol;
/* Now search all the global symbols. Do the symtab's first, then
check the psymtab's. If a psymtab indicates the existence
of the desired name as a global, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
ALL_SYMTABS (objfile, s)
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
{
return SYMBOL_TYPE (sym);
}
}
ALL_PSYMTABS (objfile, ps)
{
if (!ps->readin && lookup_partial_symbol (ps, name, 1, STRUCT_NAMESPACE))
{
s = PSYMTAB_TO_SYMTAB(ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
* try looking in the statics even though the psymtab
* claimed the symbol was global. It's possible that
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
if (!sym)
error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
(if a template, try specifying an instantiation: %s<type>).",
name, ps->filename, name, name);
}
if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
return SYMBOL_TYPE (sym);
}
}
/* Now search the static file-level symbols.
Not strictly correct, but more useful than an error.
Do the symtab's first, then
check the psymtab's. If a psymtab indicates the existence
of the desired name as a file-level static, then do psymtab-to-symtab
conversion on the fly and return the found symbol.
*/
ALL_SYMTABS (objfile, s)
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
{
return SYMBOL_TYPE (sym);
}
}
ALL_PSYMTABS (objfile, ps)
{
if (!ps->readin && lookup_partial_symbol (ps, name, 0, STRUCT_NAMESPACE))
{
s = PSYMTAB_TO_SYMTAB(ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
* try looking in the globals even though the psymtab
* claimed the symbol was static. It's possible that
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
if (!sym)
error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
(if a template, try specifying an instantiation: %s<type>).",
name, ps->filename, name, name);
}
if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
return SYMBOL_TYPE (sym);
}
}
return (struct type *) 0;
}
/* Find the psymtab containing main(). */
/* FIXME: What about languages without main() or specially linked
executables that have no main() ? */
@ -1912,10 +2035,12 @@ find_methods (t, name, sym_arr)
if (strncmp (method_name, "__", 2) == 0 ||
strncmp (method_name, "op", 2) == 0 ||
strncmp (method_name, "type", 4) == 0)
if (cplus_demangle_opname (method_name, dem_opname, DMGL_ANSI))
method_name = dem_opname;
else if (cplus_demangle_opname (method_name, dem_opname, 0))
method_name = dem_opname;
{
if (cplus_demangle_opname (method_name, dem_opname, DMGL_ANSI))
method_name = dem_opname;
else if (cplus_demangle_opname (method_name, dem_opname, 0))
method_name = dem_opname;
}
if (STREQ (name, method_name))
/* Find all the overloaded methods with that name. */
@ -2575,16 +2700,16 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
msymbol = lookup_minimal_symbol (copy, NULL, NULL);
if (msymbol != NULL)
{
val.pc = SYMBOL_VALUE_ADDRESS (msymbol);
val.section = SYMBOL_BFD_SECTION (msymbol);
if (funfirstline)
{
val.pc += FUNCTION_START_OFFSET;
SKIP_PROLOGUE (val.pc);
}
values.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
values.sals[0] = val;
values.sals[0] = find_pc_sect_line ( SYMBOL_VALUE_ADDRESS (msymbol),
(struct sec *)0,0 );
values.sals[0].section = SYMBOL_BFD_SECTION (msymbol);
if (funfirstline)
{
values.sals[0].pc += FUNCTION_START_OFFSET;
SKIP_PROLOGUE (values.sals[0].pc);
}
values.nelts = 1;
return values;
}
@ -2669,12 +2794,9 @@ decode_line_2 (sym_arr, nelts, funfirstline, canonical)
if ((prompt = getenv ("PS2")) == NULL)
{
prompt = ">";
prompt = "> ";
}
printf_unfiltered("%s ",prompt);
gdb_flush(gdb_stdout);
args = command_line_input ((char *) NULL, 0, "overload-choice");
args = command_line_input (prompt, 0, "overload-choice");
if (args == 0 || *args == 0)
error_no_arg ("one or more choice numbers");
@ -2904,7 +3026,8 @@ search_symbols (regexp, kind, nfiles, files, matches)
register struct blockvector *bv;
struct blockvector *prev_bv = 0;
register struct block *b;
register int i, j;
register int i = 0;
register int j;
register struct symbol *sym;
struct partial_symbol **psym;
struct objfile *objfile;
@ -3104,7 +3227,8 @@ search_symbols (regexp, kind, nfiles, files, matches)
if (tail == NULL)
{
sr = psr;
old_chain = make_cleanup (free_search_symbols, sr);
old_chain = make_cleanup ((make_cleanup_func)
free_search_symbols, sr);
}
else
tail->next = psr;
@ -3148,7 +3272,8 @@ search_symbols (regexp, kind, nfiles, files, matches)
if (tail == NULL)
{
sr = psr;
old_chain = make_cleanup (free_search_symbols, &sr);
old_chain = make_cleanup ((make_cleanup_func)
free_search_symbols, &sr);
}
else
tail->next = psr;
@ -3169,7 +3294,7 @@ search_symbols (regexp, kind, nfiles, files, matches)
the data returned from search_symbols() to print information
regarding the match to gdb_stdout.
*/
static int
static void
print_symbol_info (kind, s, sym, block, last)
namespace_enum kind;
struct symtab *s;
@ -3262,7 +3387,7 @@ symtab_symbol_info (regexp, kind, from_tty)
/* must make sure that if we're interrupted, symbols gets freed */
search_symbols (regexp, kind, 0, (char **) NULL, &symbols);
old_chain = make_cleanup (free_search_symbols, symbols);
old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, symbols);
printf_filtered (regexp
? "All %ss matching regular expression \"%s\":\n"
@ -3341,7 +3466,7 @@ rbreak_command (regexp, from_tty)
struct cleanup *old_chain;
search_symbols (regexp, FUNCTIONS_NAMESPACE, 0, (char **) NULL, &ss);
old_chain = make_cleanup (free_search_symbols, ss);
old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, ss);
for (p = ss; p != NULL; p = p->next)
{

View file

@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define obstack_chunk_free free
#include "bcache.h"
#include "gnu-regex.h"
/* Don't do this; it means that if some .o's are compiled with GNU C
and some are not (easy to do accidentally the way we configure
things; also it is a pain to have to "make clean" every time you
@ -630,10 +628,26 @@ enum address_class
LOC_UNRESOLVED,
/* Value is at a thread-specific location calculated by a
target-specific method. */
LOC_THREAD_LOCAL_STATIC,
/* The variable does not actually exist in the program.
The value is ignored. */
LOC_OPTIMIZED_OUT
LOC_OPTIMIZED_OUT,
/* The variable is static, but actually lives at * (address).
* I.e. do an extra indirection to get to it.
* This is used on HP-UX to get at globals that are allocated
* in shared libraries, where references from images other
* than the one where the global was allocated are done
* with a level of indirection.
*/
LOC_INDIRECT
};
/* Linked list of symbol's live ranges. */
@ -1177,6 +1191,10 @@ contained_in PARAMS ((struct block *, struct block *));
extern void
reread_symbols PARAMS ((void));
extern struct type *
lookup_transparent_type PARAMS ((const char *));
/* Macro for name of symbol to indicate a file compiled with gcc. */
#ifndef GCC_COMPILED_FLAG_SYMBOL
#define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled."
@ -1270,6 +1288,41 @@ struct symtabs_and_lines
int nelts;
};
/* Some types and macros needed for exception catchpoints.
Can't put these in target.h because symtab_and_line isn't
known there. This file will be included by breakpoint.c,
hppa-tdep.c, etc. */
/* Enums for exception-handling support */
enum exception_event_kind {
EX_EVENT_THROW,
EX_EVENT_CATCH
};
/* Type for returning info about an exception */
struct exception_event_record {
enum exception_event_kind kind;
struct symtab_and_line throw_sal;
struct symtab_and_line catch_sal;
/* This may need to be extended in the future, if
some platforms allow reporting more information,
such as point of rethrow, type of exception object,
type expected by catch clause, etc. */
};
#define CURRENT_EXCEPTION_KIND (current_exception_event->kind)
#define CURRENT_EXCEPTION_CATCH_SAL (current_exception_event->catch_sal)
#define CURRENT_EXCEPTION_CATCH_LINE (current_exception_event->catch_sal.line)
#define CURRENT_EXCEPTION_CATCH_FILE (current_exception_event->catch_sal.symtab->filename)
#define CURRENT_EXCEPTION_CATCH_PC (current_exception_event->catch_sal.pc)
#define CURRENT_EXCEPTION_THROW_SAL (current_exception_event->throw_sal)
#define CURRENT_EXCEPTION_THROW_LINE (current_exception_event->throw_sal.line)
#define CURRENT_EXCEPTION_THROW_FILE (current_exception_event->throw_sal.symtab->filename)
#define CURRENT_EXCEPTION_THROW_PC (current_exception_event->throw_sal.pc)
/* Given a pc value, return line number it is in. Second arg nonzero means
if pc is on the boundary use the previous statement's line number. */
@ -1368,7 +1421,8 @@ select_source_symtab PARAMS ((struct symtab *));
extern char **make_symbol_completion_list PARAMS ((char *, char *));
extern void _initialize_source PARAMS ((void));
extern struct symbol **
make_symbol_overload_list PARAMS ((struct symbol *));
/* symtab.c */

File diff suppressed because it is too large Load diff

View file

@ -41,6 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
stratum. */
#include "bfd.h"
#include "symtab.h"
enum strata {
dummy_stratum, /* The lowest of the low */
@ -68,6 +69,27 @@ enum target_waitkind {
(e.g. it called load(2) on AIX). */
TARGET_WAITKIND_LOADED,
/* The program has forked. A "related" process' ID is in value.related_pid.
I.e., if the child forks, value.related_pid is the parent's ID.
*/
TARGET_WAITKIND_FORKED,
/* The program has vforked. A "related" process's ID is in value.related_pid.
*/
TARGET_WAITKIND_VFORKED,
/* The program has exec'ed a new executable file. The new file's pathname
is pointed to by value.execd_pathname.
*/
TARGET_WAITKIND_EXECD,
/* The program has entered or returned from a system call. On HP-UX, this
is used in the hardware watchpoint implementation. The syscall's unique
integer ID number is in value.syscall_id;
*/
TARGET_WAITKIND_SYSCALL_ENTRY,
TARGET_WAITKIND_SYSCALL_RETURN,
/* Nothing happened, but we stopped anyway. This perhaps should be handled
within target_wait, but I'm not sure target_wait should be resuming the
inferior. */
@ -200,10 +222,13 @@ enum target_signal {
struct target_waitstatus {
enum target_waitkind kind;
/* Exit status or signal number. */
/* Forked child pid, execd pathname, exit status or signal number. */
union {
int integer;
enum target_signal sig;
int related_pid;
char * execd_pathname;
int syscall_id;
} value;
};
@ -215,6 +240,7 @@ extern char *target_signal_to_name PARAMS ((enum target_signal));
/* Given a name (SIGHUP, etc.), return its signal. */
enum target_signal target_signal_from_name PARAMS ((char *));
/* If certain kinds of activity happen, target_wait should perform
callbacks. */
@ -234,9 +260,13 @@ struct target_ops
void (*to_open) PARAMS ((char *, int));
void (*to_close) PARAMS ((int));
void (*to_attach) PARAMS ((char *, int));
void (*to_post_attach) PARAMS ((int));
void (*to_require_attach) PARAMS ((char *, int));
void (*to_detach) PARAMS ((char *, int));
void (*to_require_detach) PARAMS ((int, char *, int));
void (*to_resume) PARAMS ((int, int, enum target_signal));
int (*to_wait) PARAMS ((int, struct target_waitstatus *));
void (*to_post_wait) PARAMS ((int, int));
void (*to_fetch_registers) PARAMS ((int));
void (*to_store_registers) PARAMS ((int));
void (*to_prepare_to_store) PARAMS ((void));
@ -296,11 +326,33 @@ struct target_ops
void (*to_load) PARAMS ((char *, int));
int (*to_lookup_symbol) PARAMS ((char *, CORE_ADDR *));
void (*to_create_inferior) PARAMS ((char *, char *, char **));
void (*to_post_startup_inferior) PARAMS ((int));
void (*to_acknowledge_created_inferior) PARAMS ((int));
void (*to_clone_and_follow_inferior) PARAMS ((int, int *));
void (*to_post_follow_inferior_by_clone) PARAMS ((void));
int (*to_insert_fork_catchpoint) PARAMS ((int));
int (*to_remove_fork_catchpoint) PARAMS ((int));
int (*to_insert_vfork_catchpoint) PARAMS ((int));
int (*to_remove_vfork_catchpoint) PARAMS ((int));
int (*to_has_forked) PARAMS ((int, int *));
int (*to_has_vforked) PARAMS ((int, int *));
int (*to_can_follow_vfork_prior_to_exec) PARAMS ((void));
void (*to_post_follow_vfork) PARAMS ((int, int, int, int));
int (*to_insert_exec_catchpoint) PARAMS ((int));
int (*to_remove_exec_catchpoint) PARAMS ((int));
int (*to_has_execd) PARAMS ((int, char **));
int (*to_reported_exec_events_per_exec_call) PARAMS ((void));
int (*to_has_syscall_event) PARAMS ((int, enum target_waitkind *, int *));
int (*to_has_exited) PARAMS ((int, int, int *));
void (*to_mourn_inferior) PARAMS ((void));
int (*to_can_run) PARAMS ((void));
void (*to_notice_signals) PARAMS ((int pid));
int (*to_thread_alive) PARAMS ((int pid));
void (*to_stop) PARAMS ((void));
struct symtab_and_line * (*to_enable_exception_callback) PARAMS ((enum exception_event_kind, int));
struct exception_event_record * (*to_get_current_exception_event) PARAMS ((void));
char * (*to_pid_to_exec_file) PARAMS ((int pid));
char * (*to_core_file_to_sym_file) PARAMS ((char *));
enum strata to_stratum;
struct target_ops
*DONT_USE; /* formerly to_next */
@ -373,6 +425,26 @@ extern struct target_stack_item *target_stack;
#define target_attach(args, from_tty) \
(*current_target.to_attach) (args, from_tty)
/* The target_attach operation places a process under debugger control,
and stops the process.
This operation provides a target-specific hook that allows the
necessary bookkeeping to be performed after an attach completes.
*/
#define target_post_attach(pid) \
(*current_target.to_post_attach) (pid)
/* Attaches to a process on the target side, if not already attached.
(If already attached, takes no action.)
This operation can be used to follow the child process of a fork.
On some targets, such child processes of an original inferior process
are automatically under debugger control, and thus do not require an
actual attach operation. */
#define target_require_attach(args, from_tty) \
(*current_target.to_require_attach) (args, from_tty)
/* Takes a program previously attached to and detaches it.
The program may resume execution (some targets do, some don't) and will
no longer stop on signals, etc. We better not have left any breakpoints
@ -383,6 +455,21 @@ extern struct target_stack_item *target_stack;
extern void
target_detach PARAMS ((char *, int));
/* Detaches from a process on the target side, if not already dettached.
(If already detached, takes no action.)
This operation can be used to follow the parent process of a fork.
On some targets, such child processes of an original inferior process
are automatically under debugger control, and thus do require an actual
detach operation.
PID is the process id of the child to detach from.
ARGS is arguments typed by the user (e.g. a signal to send the process).
FROM_TTY says whether to be verbose or not. */
#define target_require_detach(pid, args, from_tty) \
(*current_target.to_require_detach) (pid, args, from_tty)
/* Resume execution of the target process PID. STEP says whether to
single-step or to run free; SIGGNAL is the signal to be given to
the target, or TARGET_SIGNAL_0 for no signal. The caller may not
@ -402,6 +489,20 @@ target_detach PARAMS ((char *, int));
#define target_wait(pid, status) \
(*current_target.to_wait) (pid, status)
/* The target_wait operation waits for a process event to occur, and
thereby stop the process.
On some targets, certain events may happen in sequences. gdb's
correct response to any single event of such a sequence may require
knowledge of what earlier events in the sequence have been seen.
This operation provides a target-specific hook that allows the
necessary bookkeeping to be performed to track such sequences.
*/
#define target_post_wait(pid, status) \
(*current_target.to_post_wait) (pid, status)
/* Fetch register REGNO, or all regs if regno == -1. No result. */
#define target_fetch_registers(regno) \
@ -444,6 +545,78 @@ xfer_memory PARAMS ((CORE_ADDR, char *, int, int, struct target_ops *));
extern int
child_xfer_memory PARAMS ((CORE_ADDR, char *, int, int, struct target_ops *));
extern char *
child_pid_to_exec_file PARAMS ((int));
extern char *
child_core_file_to_sym_file PARAMS ((char *));
extern void
child_post_attach PARAMS ((int));
extern void
child_post_wait PARAMS ((int, int));
extern void
child_post_startup_inferior PARAMS ((int));
extern void
child_acknowledge_created_inferior PARAMS ((int));
extern void
child_clone_and_follow_inferior PARAMS ((int, int *));
extern void
child_post_follow_inferior_by_clone PARAMS ((void));
extern int
child_insert_fork_catchpoint PARAMS ((int));
extern int
child_remove_fork_catchpoint PARAMS ((int));
extern int
child_insert_vfork_catchpoint PARAMS ((int));
extern int
child_remove_vfork_catchpoint PARAMS ((int));
extern int
child_has_forked PARAMS ((int, int *));
extern int
child_has_vforked PARAMS ((int, int *));
extern void
child_acknowledge_created_inferior PARAMS ((int));
extern int
child_can_follow_vfork_prior_to_exec PARAMS ((void));
extern void
child_post_follow_vfork PARAMS ((int, int, int, int));
extern int
child_insert_exec_catchpoint PARAMS ((int));
extern int
child_remove_exec_catchpoint PARAMS ((int));
extern int
child_has_execd PARAMS ((int, char **));
extern int
child_reported_exec_events_per_exec_call PARAMS ((void));
extern int
child_has_syscall_event PARAMS ((int, enum target_waitkind *, int *));
extern int
child_has_exited PARAMS ((int, int, int *));
extern int
child_thread_alive PARAMS ((int));
/* From exec.c */
extern void
@ -539,6 +712,149 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
#define target_create_inferior(exec_file, args, env) \
(*current_target.to_create_inferior) (exec_file, args, env)
/* Some targets (such as ttrace-based HPUX) don't allow us to request
notification of inferior events such as fork and vork immediately
after the inferior is created. (This because of how gdb gets an
inferior created via invoking a shell to do it. In such a scenario,
if the shell init file has commands in it, the shell will fork and
exec for each of those commands, and we will see each such fork
event. Very bad.)
Such targets will supply an appropriate definition for this function.
*/
#define target_post_startup_inferior(pid) \
(*current_target.to_post_startup_inferior) (pid)
/* On some targets, the sequence of starting up an inferior requires
some synchronization between gdb and the new inferior process, PID.
*/
#define target_acknowledge_created_inferior(pid) \
(*current_target.to_acknowledge_created_inferior) (pid)
/* An inferior process has been created via a fork() or similar
system call. This function will clone the debugger, then ensure
that CHILD_PID is attached to by that debugger.
FOLLOWED_CHILD is set TRUE on return *for the clone debugger only*,
and FALSE otherwise. (The original and clone debuggers can use this
to determine which they are, if need be.)
(This is not a terribly useful feature without a GUI to prevent
the two debuggers from competing for shell input.)
*/
#define target_clone_and_follow_inferior(child_pid,followed_child) \
(*current_target.to_clone_and_follow_inferior) (child_pid, followed_child)
/* This operation is intended to be used as the last in a sequence of
steps taken when following both parent and child of a fork. This
is used by a clone of the debugger, which will follow the child.
The original debugger has detached from this process, and the
clone has attached to it.
On some targets, this requires a bit of cleanup to make it work
correctly.
*/
#define target_post_follow_inferior_by_clone() \
(*current_target.to_post_follow_inferior_by_clone) ()
/* On some targets, we can catch an inferior fork or vfork event when it
occurs. These functions insert/remove an already-created catchpoint for
such events.
*/
#define target_insert_fork_catchpoint(pid) \
(*current_target.to_insert_fork_catchpoint) (pid)
#define target_remove_fork_catchpoint(pid) \
(*current_target.to_remove_fork_catchpoint) (pid)
#define target_insert_vfork_catchpoint(pid) \
(*current_target.to_insert_vfork_catchpoint) (pid)
#define target_remove_vfork_catchpoint(pid) \
(*current_target.to_remove_vfork_catchpoint) (pid)
/* Returns TRUE if PID has invoked the fork() system call. And,
also sets CHILD_PID to the process id of the other ("child")
inferior process that was created by that call.
*/
#define target_has_forked(pid,child_pid) \
(*current_target.to_has_forked) (pid,child_pid)
/* Returns TRUE if PID has invoked the vfork() system call. And,
also sets CHILD_PID to the process id of the other ("child")
inferior process that was created by that call.
*/
#define target_has_vforked(pid,child_pid) \
(*current_target.to_has_vforked) (pid,child_pid)
/* Some platforms (such as pre-10.20 HP-UX) don't allow us to do
anything to a vforked child before it subsequently calls exec().
On such platforms, we say that the debugger cannot "follow" the
child until it has vforked.
This function should be defined to return 1 by those targets
which can allow the debugger to immediately follow a vforked
child, and 0 if they cannot.
*/
#define target_can_follow_vfork_prior_to_exec() \
(*current_target.to_can_follow_vfork_prior_to_exec) ()
/* An inferior process has been created via a vfork() system call.
The debugger has followed the parent, the child, or both. The
process of setting up for that follow may have required some
target-specific trickery to track the sequence of reported events.
If so, this function should be defined by those targets that
require the debugger to perform cleanup or initialization after
the vfork follow.
*/
#define target_post_follow_vfork(parent_pid,followed_parent,child_pid,followed_child) \
(*current_target.to_post_follow_vfork) (parent_pid,followed_parent,child_pid,followed_child)
/* On some targets, we can catch an inferior exec event when it
occurs. These functions insert/remove an already-created catchpoint
for such events.
*/
#define target_insert_exec_catchpoint(pid) \
(*current_target.to_insert_exec_catchpoint) (pid)
#define target_remove_exec_catchpoint(pid) \
(*current_target.to_remove_exec_catchpoint) (pid)
/* Returns TRUE if PID has invoked a flavor of the exec() system call.
And, also sets EXECD_PATHNAME to the pathname of the executable file
that was passed to exec(), and is now being executed.
*/
#define target_has_execd(pid,execd_pathname) \
(*current_target.to_has_execd) (pid,execd_pathname)
/* Returns the number of exec events that are reported when a process
invokes a flavor of the exec() system call on this target, if exec
events are being reported.
*/
#define target_reported_exec_events_per_exec_call() \
(*current_target.to_reported_exec_events_per_exec_call) ()
/* Returns TRUE if PID has reported a syscall event. And, also sets
KIND to the appropriate TARGET_WAITKIND_, and sets SYSCALL_ID to
the unique integer ID of the syscall.
*/
#define target_has_syscall_event(pid,kind,syscall_id) \
(*current_target.to_has_syscall_event) (pid,kind,syscall_id)
/* Returns TRUE if PID has exited. And, also sets EXIT_STATUS to the
exit code of PID, if any.
*/
#define target_has_exited(pid,wait_status,exit_status) \
(*current_target.to_has_exited) (pid,wait_status,exit_status)
/* The debugger has completed a blocking wait() call. There is now
some process event that must be processed. This function should
be defined by those targets that require the debugger to perform
cleanup or internal state changes in response to the process event.
*/
/* The inferior process has died. Do what is right. */
#define target_mourn_inferior() \
@ -565,6 +881,21 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
#define target_stop current_target.to_stop
/* Get the symbol information for a breakpointable routine called when
an exception event occurs.
Intended mainly for C++, and for those
platforms/implementations where such a callback mechanism is available,
e.g. HP-UX with ANSI C++ (aCC). Some compilers (e.g. g++) support
different mechanisms for debugging exceptions. */
#define target_enable_exception_callback(kind, enable) \
(*current_target.to_enable_exception_callback) (kind, enable)
/* Get the current exception event kind -- throw or catch, etc. */
#define target_get_current_exception_event() \
(*current_target.to_get_current_exception_event) ()
/* Pointer to next target in the chain, e.g. a core file and an exec file. */
#define target_next \
@ -615,10 +946,38 @@ extern void target_link PARAMS ((char *, CORE_ADDR *));
extern char *normal_pid_to_str PARAMS ((int pid));
#endif
#ifndef target_tid_to_str
#define target_tid_to_str(PID) \
normal_pid_to_str (PID)
extern char *normal_pid_to_str PARAMS ((int pid));
#endif
#ifndef target_new_objfile
#define target_new_objfile(OBJFILE)
#endif
#ifndef target_pid_or_tid_to_str
#define target_pid_or_tid_to_str(ID) \
normal_pid_to_str (ID)
#endif
/* Attempts to find the pathname of the executable file
that was run to create a specified process.
The process PID must be stopped when this operation is used.
If the executable file cannot be determined, NULL is returned.
Else, a pointer to a character string containing the pathname
is returned. This string should be copied into a buffer by
the client if the string will not be immediately used, or if
it must persist.
*/
#define target_pid_to_exec_file(pid) \
(current_target.to_pid_to_exec_file) (pid)
/* Hook to call target-dependant code after reading in a new symbol table. */
#ifndef TARGET_SYMFILE_POSTREAD
@ -641,6 +1000,18 @@ extern char *normal_pid_to_str PARAMS ((int pid));
#define STOPPED_BY_WATCHPOINT(w) 0
#endif
/* HP-UX supplies these operations, which respectively disable and enable
the memory page-protections that are used to implement hardware watchpoints
on that platform. See wait_for_inferior's use of these.
*/
#if !defined(TARGET_DISABLE_HW_WATCHPOINTS)
#define TARGET_DISABLE_HW_WATCHPOINTS(pid)
#endif
#if !defined(TARGET_ENABLE_HW_WATCHPOINTS)
#define TARGET_ENABLE_HW_WATCHPOINTS(pid)
#endif
/* Provide defaults for systems that don't support hardware watchpoints. */
#ifndef TARGET_HAS_HARDWARE_WATCHPOINTS
@ -652,6 +1023,23 @@ extern char *normal_pid_to_str PARAMS ((int pid));
#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE,CNT,OTHERTYPE) 0
#if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT)
#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_count) \
(LONGEST)(byte_count) <= REGISTER_SIZE
#endif
/* However, some addresses may not be profitable to use hardware to watch,
or may be difficult to understand when the addressed object is out of
scope, and hence should be unwatched. On some targets, this may have
severe performance penalties, such that we might as well use regular
watchpoints, and save (possibly precious) hardware watchpoints for other
locations.
*/
#if !defined(TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT)
#define TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT(pid,start,len) 0
#endif
/* Set/clear a hardware watchpoint starting at ADDR, for LEN bytes. TYPE is 0
for write, 1 for read, and 2 for read/write accesses. Returns 0 for
success, non-zero for failure. */
@ -677,6 +1065,38 @@ extern char *normal_pid_to_str PARAMS ((int pid));
#define DECR_PC_AFTER_HW_BREAK 0
#endif
/* Sometimes gdb may pick up what appears to be a valid target address
from a minimal symbol, but the value really means, essentially,
"This is an index into a table which is populated when the inferior
is run. Therefore, do not attempt to use this as a PC."
*/
#if !defined(PC_REQUIRES_RUN_BEFORE_USE)
#define PC_REQUIRES_RUN_BEFORE_USE(pc) (0)
#endif
/* This will only be defined by a target that supports catching vfork events,
such as HP-UX.
On some targets (such as HP-UX 10.20 and earlier), resuming a newly vforked
child process after it has exec'd, causes the parent process to resume as
well. To prevent the parent from running spontaneously, such targets should
define this to a function that prevents that from happening.
*/
#if !defined(ENSURE_VFORKING_PARENT_REMAINS_STOPPED)
#define ENSURE_VFORKING_PARENT_REMAINS_STOPPED(PID) (0)
#endif
/* This will only be defined by a target that supports catching vfork events,
such as HP-UX.
On some targets (such as HP-UX 10.20 and earlier), a newly vforked child
process must be resumed when it delivers its exec event, before the parent
vfork event will be delivered to us.
*/
#if !defined(RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK)
#define RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK() (0)
#endif
/* Routines for maintenance of the target structures...
add_target: Add a target to the list of all possible targets.
@ -729,14 +1149,15 @@ build_section_table PARAMS ((bfd *, struct section_table **,
/* From mem-break.c */
extern int
memory_remove_breakpoint PARAMS ((CORE_ADDR, char *));
extern int memory_remove_breakpoint PARAMS ((CORE_ADDR, char *));
extern int
memory_insert_breakpoint PARAMS ((CORE_ADDR, char *));
extern int memory_insert_breakpoint PARAMS ((CORE_ADDR, char *));
extern breakpoint_from_pc_fn memory_breakpoint_from_pc;
#ifndef BREAKPOINT_FROM_PC
#define BREAKPOINT_FROM_PC(pcptr, lenptr) memory_breakpoint_from_pc (pcptr, lenptr)
#endif
unsigned char *
memory_breakpoint_from_pc PARAMS ((CORE_ADDR *pcptr, int *lenptr));
/* From target.c */
@ -749,9 +1170,18 @@ noprocess PARAMS ((void));
extern void
find_default_attach PARAMS ((char *, int));
void
find_default_require_attach PARAMS ((char *, int));
void
find_default_require_detach PARAMS ((int, char *, int));
extern void
find_default_create_inferior PARAMS ((char *, char *, char **));
void
find_default_clone_and_follow_inferior PARAMS ((int, int *));
extern struct target_ops *
find_core_target PARAMS ((void));
@ -782,16 +1212,23 @@ extern enum target_signal target_signal_from_command PARAMS ((int));
/* Any target can call this to switch to remote protocol (in remote.c). */
extern void push_remote_target PARAMS ((char *name, int from_tty));
/* Any target cah call this to open using the remote protocol */
extern void open_remote_target PARAMS ((char *name, int from_tty, struct target_ops *target, int extended_p));
/* Imported from machine dependent code */
#ifdef NO_SINGLE_STEP
extern int one_stepped;
extern void single_step PARAMS ((enum target_signal));
#endif /* NO_SINGLE_STEP */
#ifndef SOFTWARE_SINGLE_STEP_P
#define SOFTWARE_SINGLE_STEP_P 0
#define SOFTWARE_SINGLE_STEP(sig,bp_p) abort ()
#endif /* SOFTWARE_SINGLE_STEP_P */
/* Blank target vector entries are initialized to target_ignore. */
void target_ignore PARAMS ((void));
/* Macro for getting target's idea of a frame pointer.
FIXME: GDB's whole scheme for dealing with "frames" and
"frame pointers" needs a serious shakedown. */
#ifndef TARGET_VIRTUAL_FRAME_POINTER
#define TARGET_VIRTUAL_FRAME_POINTER(ADDR, REGP, OFFP) \
do { *(REGP) = FP_REGNUM; *(OFFP) = 0; } while (0)
#endif /* TARGET_VIRTUAL_FRAME_POINTER */
#endif /* !defined (TARGET_H) */

View file

@ -4,7 +4,7 @@
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 Pessublic License as published by
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.
@ -921,10 +921,14 @@ static void init_850ice_ops(void)
v850ice_ops.to_doc = "Debug a system controlled by a NEC 850 ICE.";
v850ice_ops.to_open = v850ice_open;
v850ice_ops.to_close = v850ice_close;
v850ice_ops.to_attach = NULL;
v850ice_ops.to_detach = v850ice_detach;
v850ice_ops.to_attach = NULL;
v850ice_ops.to_post_attach = NULL;
v850ice_ops.to_require_attach = NULL;
v850ice_ops.to_detach = v850ice_detach;
v850ice_ops.to_require_detach = NULL;
v850ice_ops.to_resume = v850ice_resume;
v850ice_ops.to_wait = v850ice_wait;
v850ice_ops.to_wait = v850ice_wait;
v850ice_ops.to_post_wait = NULL;
v850ice_ops.to_fetch_registers = v850ice_fetch_registers;
v850ice_ops.to_store_registers = v850ice_store_registers;
v850ice_ops.to_prepare_to_store = v850ice_prepare_to_store;
@ -940,12 +944,14 @@ static void init_850ice_ops(void)
v850ice_ops.to_kill = v850ice_kill;
v850ice_ops.to_load = v850ice_load;
v850ice_ops.to_lookup_symbol = NULL;
v850ice_ops.to_create_inferior = NULL;
v850ice_ops.to_create_inferior = NULL;
v850ice_ops.to_mourn_inferior = v850ice_mourn;
v850ice_ops.to_can_run = 0;
v850ice_ops.to_notice_signals = 0;
v850ice_ops.to_thread_alive = NULL;
v850ice_ops.to_stop = v850ice_stop;
v850ice_ops.to_pid_to_exec_file = NULL;
v850ice_ops.to_core_file_to_sym_file = NULL;
v850ice_ops.to_stratum = process_stratum;
v850ice_ops.DONT_USE = NULL;
v850ice_ops.to_has_all_memory = 1;

File diff suppressed because it is too large Load diff

View file

@ -61,7 +61,9 @@ struct value
lval_reg_frame_relative. */
int regnum;
} location;
/* Describes offset of a value within lval a structure in bytes. */
/* Describes offset of a value within lval of a structure in bytes.
This is used in retrieving contents from target memory. [Note also
the member embedded_offset below.] */
int offset;
/* Only used for bitfields; number of bits contained in them. */
int bitsize;
@ -77,6 +79,14 @@ struct value
CORE_ADDR frame_addr;
/* Type of the value. */
struct type *type;
/* Type of the enclosing object if this is an embedded subobject.
The member embedded_offset gives the real position of the subobject
if type is not the same as enclosing_type.
If the type field is a pointer type, then enclosing_type is
a pointer type pointing to the real (enclosing) type of the target
object. */
struct type *enclosing_type;
/* Values are stored in a chain, so that they can be deleted
easily over calls to the inferior. Values assigned to internal
variables or put into the value history are taken off this
@ -101,23 +111,41 @@ struct value
/* If nonzero, this is the value of a variable which does not
actually exist in the program. */
char optimized_out;
/* If this value represents an object that is embedded inside a
larger object (e.g., a base subobject in C++), this gives the
offset (in bytes) from the start of the contents buffer where
the embedded object begins. This is required because some C++
runtime implementations lay out objects (especially virtual bases
with possibly negative offsets to ancestors).
Note: This may be positive or negative! Also note that this offset
is not used when retrieving contents from target memory; the entire
enclosing object has to be retrieved always, and the offset for
that is given by the member offset above. */
int embedded_offset;
/* If this value represents a pointer to an object that is embedded
in another object, this gives the embedded_offset of the object
that is pointed to. */
int pointed_to_offset;
/* The BFD section associated with this value. */
asection *bfd_section;
/* Actual contents of the value. For use of this value; setting
it uses the stuff above. Not valid if lazy is nonzero.
Target byte-order. We force it to be aligned properly for any
possible value. */
possible value. Note that a value therefore extends beyond
what is declared here. */
union {
long contents[1];
double force_double_align;
LONGEST force_longlong_align;
char *literal_data;
} aligner;
/* Do not add any new members here -- contents above will trash them */
};
typedef struct value *value_ptr;
#define VALUE_TYPE(val) (val)->type
#define VALUE_ENCLOSING_TYPE(val) (val)->enclosing_type
#define VALUE_LAZY(val) (val)->lazy
/* VALUE_CONTENTS and VALUE_CONTENTS_RAW both return the address of
the gdb buffer used to hold a copy of the contents of the lval.
@ -125,10 +153,23 @@ typedef struct value *value_ptr;
it uses value_fetch_lazy() to load the buffer from the process being
debugged if it hasn't already been loaded. VALUE_CONTENTS_RAW is
used when data is being stored into the buffer, or when it is
certain that the contents of the buffer are valid. */
#define VALUE_CONTENTS_RAW(val) ((char *) (val)->aligner.contents)
certain that the contents of the buffer are valid.
Note: The contents pointer is adjusted by the offset required to
get to the real subobject, if the value happens to represent
something embedded in a larger run-time object. */
#define VALUE_CONTENTS_RAW(val) ((char *) (val)->aligner.contents + (val)->embedded_offset)
#define VALUE_CONTENTS(val) ((void)(VALUE_LAZY(val) && value_fetch_lazy(val)),\
VALUE_CONTENTS_RAW(val))
/* The ALL variants of the above two macros do not adjust the returned
pointer by the embedded_offset value. */
#define VALUE_CONTENTS_ALL_RAW(val) ((char *) (val)->aligner.contents)
#define VALUE_CONTENTS_ALL(val) ((void) (VALUE_LAZY(val) && value_fetch_lazy(val)),\
VALUE_CONTENTS_ALL_RAW(val))
extern int value_fetch_lazy PARAMS ((value_ptr val));
#define VALUE_LVAL(val) (val)->lval
@ -142,6 +183,8 @@ extern int value_fetch_lazy PARAMS ((value_ptr val));
#define VALUE_NEXT(val) (val)->next
#define VALUE_REGNO(val) (val)->regno
#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
#define VALUE_EMBEDDED_OFFSET(val) ((val)->embedded_offset)
#define VALUE_POINTED_TO_OFFSET(val) ((val)->pointed_to_offset)
#define VALUE_BFD_SECTION(val) ((val)->bfd_section)
/* Convert a REF to the object referenced. */
@ -302,12 +345,24 @@ extern value_ptr value_struct_elt_for_reference PARAMS ((struct type *domain,
extern value_ptr value_static_field PARAMS ((struct type *type, int fieldno));
extern struct fn_field *
value_find_oload_method_list PARAMS ((value_ptr *, char *, int, int *, int *, struct type **, int *));
extern value_ptr value_field PARAMS ((value_ptr arg1, int fieldno));
extern value_ptr value_primitive_field PARAMS ((value_ptr arg1, int offset,
int fieldno,
struct type *arg_type));
extern struct type *
value_rtti_type PARAMS ((value_ptr, int *, int *, int *));
extern struct type *
value_rtti_target_type PARAMS ((value_ptr, int *, int *, int *));
extern value_ptr
value_full_object PARAMS ((value_ptr, struct type *, int, int, int));
extern value_ptr value_cast PARAMS ((struct type *type, value_ptr arg2));
extern value_ptr value_zero PARAMS ((struct type *type, enum lval_type lv));
@ -463,7 +518,7 @@ extern value_ptr
value_release_to_mark PARAMS ((value_ptr mark));
extern int
val_print PARAMS ((struct type *type, char *valaddr, CORE_ADDR address,
val_print PARAMS ((struct type *type, char *valaddr, int embedded_offset, CORE_ADDR address,
GDB_FILE *stream, int format, int deref_ref,
int recurse, enum val_prettyprint pretty));
@ -504,10 +559,10 @@ extern value_ptr call_function_by_hand PARAMS ((value_ptr, int, value_ptr *));
extern value_ptr value_literal_complex PARAMS ((value_ptr, value_ptr, struct type*));
extern void find_rt_vbase_offset PARAMS ((struct type *, struct type *, char *, int, int *, int *));
extern value_ptr find_function_in_inferior PARAMS ((char *));
extern value_ptr value_allocate_space_in_inferior PARAMS ((int));
extern void _initialize_values PARAMS ((void));
#endif /* !defined (VALUE_H) */

View file

@ -86,6 +86,7 @@ allocate_value (type)
VALUE_NEXT (val) = all_values;
all_values = val;
VALUE_TYPE (val) = type;
VALUE_ENCLOSING_TYPE (val) = type;
VALUE_LVAL (val) = not_lval;
VALUE_ADDRESS (val) = 0;
VALUE_FRAME (val) = 0;
@ -96,6 +97,8 @@ allocate_value (type)
VALUE_LAZY (val) = 0;
VALUE_OPTIMIZED_OUT (val) = 0;
VALUE_BFD_SECTION (val) = NULL;
VALUE_EMBEDDED_OFFSET (val) = 0;
VALUE_POINTED_TO_OFFSET (val) = 0;
val->modifiable = 1;
return val;
}
@ -213,8 +216,9 @@ value_ptr
value_copy (arg)
value_ptr arg;
{
register struct type *type = VALUE_TYPE (arg);
register value_ptr val = allocate_value (type);
register struct type *encl_type = VALUE_ENCLOSING_TYPE (arg);
register value_ptr val = allocate_value (encl_type);
VALUE_TYPE (val) = VALUE_TYPE (arg);
VALUE_LVAL (val) = VALUE_LVAL (arg);
VALUE_ADDRESS (val) = VALUE_ADDRESS (arg);
VALUE_OFFSET (val) = VALUE_OFFSET (arg);
@ -224,12 +228,15 @@ value_copy (arg)
VALUE_REGNO (val) = VALUE_REGNO (arg);
VALUE_LAZY (val) = VALUE_LAZY (arg);
VALUE_OPTIMIZED_OUT (val) = VALUE_OPTIMIZED_OUT (arg);
VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (arg);
VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (arg);
VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (arg);
val->modifiable = arg->modifiable;
if (!VALUE_LAZY (val))
{
memcpy (VALUE_CONTENTS_RAW (val), VALUE_CONTENTS_RAW (arg),
TYPE_LENGTH (VALUE_TYPE (arg)));
memcpy (VALUE_CONTENTS_ALL_RAW (val), VALUE_CONTENTS_ALL_RAW (arg),
TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg)));
}
return val;
}
@ -744,9 +751,23 @@ value_static_field (type, fieldno)
char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
struct symbol *sym = lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
if (sym == NULL)
return NULL;
addr = SYMBOL_VALUE_ADDRESS (sym);
sect = SYMBOL_BFD_SECTION (sym);
{
/* With some compilers, e.g. HP aCC, static data members are reported
as non-debuggable symbols */
struct minimal_symbol * msym = lookup_minimal_symbol (phys_name, NULL, NULL);
if (!msym)
return NULL;
else
{
addr = SYMBOL_VALUE_ADDRESS (msym);
sect = SYMBOL_BFD_SECTION (msym);
}
}
else
{
addr = SYMBOL_VALUE_ADDRESS (sym);
sect = SYMBOL_BFD_SECTION (sym);
}
SET_FIELD_PHYSADDR (TYPE_FIELD (type, fieldno), addr);
}
return value_at (TYPE_FIELD_TYPE (type, fieldno), addr, sect);
@ -782,23 +803,43 @@ value_primitive_field (arg1, offset, fieldno, arg_type)
VALUE_BITPOS (v) = TYPE_FIELD_BITPOS (arg_type, fieldno) % 8;
VALUE_BITSIZE (v) = TYPE_FIELD_BITSIZE (arg_type, fieldno);
}
else if (fieldno < TYPE_N_BASECLASSES (arg_type))
{
/* This field is actually a base subobject, so preserve the
entire object's contents for later references to virtual
bases, etc. */
v = allocate_value (VALUE_ENCLOSING_TYPE (arg1));
VALUE_TYPE (v) = arg_type;
if (VALUE_LAZY (arg1))
VALUE_LAZY (v) = 1;
else
memcpy (VALUE_CONTENTS_ALL_RAW (v), VALUE_CONTENTS_ALL_RAW (arg1),
TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg1)));
VALUE_OFFSET (v) = VALUE_OFFSET (arg1);
VALUE_EMBEDDED_OFFSET (v)
= offset +
VALUE_EMBEDDED_OFFSET (arg1) +
TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
}
else
{
/* Plain old data member */
offset += TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
v = allocate_value (type);
if (VALUE_LAZY (arg1))
VALUE_LAZY (v) = 1;
else
memcpy (VALUE_CONTENTS_RAW (v),
VALUE_CONTENTS_RAW (arg1) + offset
+ TYPE_FIELD_BITPOS (arg_type, fieldno) / 8,
VALUE_CONTENTS_RAW (arg1) + offset,
TYPE_LENGTH (type));
VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset;
}
VALUE_LVAL (v) = VALUE_LVAL (arg1);
if (VALUE_LVAL (arg1) == lval_internalvar)
VALUE_LVAL (v) = lval_internalvar_component;
VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1);
VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
+ TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
/* VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset
+ TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */
return v;
}
@ -875,74 +916,164 @@ value_virtual_fn_field (arg1p, f, j, type, offset)
{
value_ptr arg1 = *arg1p;
struct type *type1 = check_typedef (VALUE_TYPE (arg1));
struct type *entry_type;
/* First, get the virtual function table pointer. That comes
with a strange type, so cast it to type `pointer to long' (which
should serve just fine as a function type). Then, index into
the table, and convert final value to appropriate function type. */
value_ptr entry, vfn, vtbl;
value_ptr vi = value_from_longest (builtin_type_int,
(LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
struct type *context;
if (fcontext == NULL)
/* We don't have an fcontext (e.g. the program was compiled with
g++ version 1). Try to get the vtbl from the TYPE_VPTR_BASETYPE.
This won't work right for multiple inheritance, but at least we
should do as well as GDB 3.x did. */
fcontext = TYPE_VPTR_BASETYPE (type);
context = lookup_pointer_type (fcontext);
/* Now context is a pointer to the basetype containing the vtbl. */
if (TYPE_TARGET_TYPE (context) != type1)
if (TYPE_HAS_VTABLE (type))
{
arg1 = value_ind (value_cast (context, value_addr (arg1)));
type1 = check_typedef (VALUE_TYPE (arg1));
}
/* Deal with HP/Taligent runtime model for virtual functions */
value_ptr vp;
value_ptr argp; /* arg1 cast to base */
CORE_ADDR vfunc_addr; /* address of virtual method */
CORE_ADDR coreptr; /* pointer to target address */
int class_index; /* which class segment pointer to use */
struct type * ftype = TYPE_FN_FIELD_TYPE (f, j); /* method type */
context = type1;
/* Now context is the basetype containing the vtbl. */
argp = value_cast (type, *arg1p);
/* This type may have been defined before its virtual function table
was. If so, fill in the virtual function table entry for the
type now. */
if (TYPE_VPTR_FIELDNO (context) < 0)
fill_in_vptr_fieldno (context);
/* The virtual function table is now an array of structures
which have the form { int16 offset, delta; void *pfn; }. */
vtbl = value_ind (value_primitive_field (arg1, 0,
TYPE_VPTR_FIELDNO (context),
TYPE_VPTR_BASETYPE (context)));
/* Index into the virtual function table. This is hard-coded because
looking up a field is not cheap, and it may be important to save
time, e.g. if the user has set a conditional breakpoint calling
a virtual function. */
entry = value_subscript (vtbl, vi);
entry_type = check_typedef (VALUE_TYPE (entry));
if (TYPE_CODE (entry_type) == TYPE_CODE_STRUCT)
{
/* Move the `this' pointer according to the virtual function table. */
VALUE_OFFSET (arg1) += value_as_long (value_field (entry, 0));
if (VALUE_ADDRESS (argp) == 0)
error ("Address of object is null; object may not have been created.");
if (! VALUE_LAZY (arg1))
{
VALUE_LAZY (arg1) = 1;
value_fetch_lazy (arg1);
}
/* pai: FIXME -- 32x64 possible problem? */
/* First word (4 bytes) in object layout is the vtable pointer */
coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (argp)); /* pai: (temp) */
/* + offset + VALUE_EMBEDDED_OFFSET (argp)); */
vfn = value_field (entry, 2);
if (!coreptr)
error ("Virtual table pointer is null for object; object may not have been created.");
/* pai/1997-05-09
* FIXME: The code here currently handles only
* the non-RRBC case of the Taligent/HP runtime spec; when RRBC
* is introduced, the condition for the "if" below will have to
* be changed to be a test for the RRBC case. */
if (1)
{
/* Non-RRBC case; the virtual function pointers are stored at fixed
* offsets in the virtual table. */
/* Retrieve the offset in the virtual table from the debug
* info. The offset of the vfunc's entry is in words from
* the beginning of the vtable; but first we have to adjust
* by HP_ACC_VFUNC_START to account for other entries */
/* pai: FIXME: 32x64 problem here, a word may be 8 bytes in
* which case the multiplier should be 8 and values should be long */
vp = value_at (builtin_type_int,
coreptr + 4 * (TYPE_FN_FIELD_VOFFSET (f, j) + HP_ACC_VFUNC_START), NULL);
coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (vp));
/* coreptr now contains the address of the virtual function */
/* (Actually, it contains the pointer to the plabel for the function. */
}
else
{
/* RRBC case; the virtual function pointers are found by double
* indirection through the class segment tables. */
/* Choose class segment depending on type we were passed */
class_index = class_index_in_primary_list (type);
/* Find class segment pointer. These are in the vtable slots after
* some other entries, so adjust by HP_ACC_VFUNC_START for that. */
/* pai: FIXME 32x64 problem here, if words are 8 bytes long
* the multiplier below has to be 8 and value should be long. */
vp = value_at (builtin_type_int,
coreptr + 4 * (HP_ACC_VFUNC_START + class_index), NULL);
/* Indirect once more, offset by function index */
/* pai: FIXME 32x64 problem here, again multiplier could be 8 and value long */
coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (vp) + 4 * TYPE_FN_FIELD_VOFFSET (f, j));
vp = value_at (builtin_type_int, coreptr, NULL);
coreptr = * (CORE_ADDR *) (VALUE_CONTENTS (vp));
/* coreptr now contains the address of the virtual function */
/* (Actually, it contains the pointer to the plabel for the function.) */
}
if (!coreptr)
error ("Address of virtual function is null; error in virtual table?");
/* Wrap this addr in a value and return pointer */
vp = allocate_value (ftype);
VALUE_TYPE (vp) = ftype;
VALUE_ADDRESS (vp) = coreptr;
/* pai: (temp) do we need the value_ind stuff in value_fn_field? */
return vp;
}
else if (TYPE_CODE (entry_type) == TYPE_CODE_PTR)
vfn = entry;
else
error ("I'm confused: virtual function table has bad type");
/* Reinstantiate the function pointer with the correct type. */
VALUE_TYPE (vfn) = lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j));
else
{ /* Not using HP/Taligent runtime conventions; so try to
* use g++ conventions for virtual table */
struct type *entry_type;
/* First, get the virtual function table pointer. That comes
with a strange type, so cast it to type `pointer to long' (which
should serve just fine as a function type). Then, index into
the table, and convert final value to appropriate function type. */
value_ptr entry, vfn, vtbl;
value_ptr vi = value_from_longest (builtin_type_int,
(LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
struct type *context;
if (fcontext == NULL)
/* We don't have an fcontext (e.g. the program was compiled with
g++ version 1). Try to get the vtbl from the TYPE_VPTR_BASETYPE.
This won't work right for multiple inheritance, but at least we
should do as well as GDB 3.x did. */
fcontext = TYPE_VPTR_BASETYPE (type);
context = lookup_pointer_type (fcontext);
/* Now context is a pointer to the basetype containing the vtbl. */
if (TYPE_TARGET_TYPE (context) != type1)
{
arg1 = value_ind (value_cast (context, value_addr (arg1)));
type1 = check_typedef (VALUE_TYPE (arg1));
}
*arg1p = arg1;
return vfn;
context = type1;
/* Now context is the basetype containing the vtbl. */
/* This type may have been defined before its virtual function table
was. If so, fill in the virtual function table entry for the
type now. */
if (TYPE_VPTR_FIELDNO (context) < 0)
fill_in_vptr_fieldno (context);
/* The virtual function table is now an array of structures
which have the form { int16 offset, delta; void *pfn; }. */
vtbl = value_ind (value_primitive_field (arg1, 0,
TYPE_VPTR_FIELDNO (context),
TYPE_VPTR_BASETYPE (context)));
/* Index into the virtual function table. This is hard-coded because
looking up a field is not cheap, and it may be important to save
time, e.g. if the user has set a conditional breakpoint calling
a virtual function. */
entry = value_subscript (vtbl, vi);
entry_type = check_typedef (VALUE_TYPE (entry));
if (TYPE_CODE (entry_type) == TYPE_CODE_STRUCT)
{
/* Move the `this' pointer according to the virtual function table. */
VALUE_OFFSET (arg1) += value_as_long (value_field (entry, 0));
if (! VALUE_LAZY (arg1))
{
VALUE_LAZY (arg1) = 1;
value_fetch_lazy (arg1);
}
vfn = value_field (entry, 2);
}
else if (TYPE_CODE (entry_type) == TYPE_CODE_PTR)
vfn = entry;
else
error ("I'm confused: virtual function table has bad type");
/* Reinstantiate the function pointer with the correct type. */
VALUE_TYPE (vfn) = lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j));
*arg1p = arg1;
return vfn;
}
}
/* ARG is a pointer to an object we know to be at least