Commit Graph

13 Commits

Author SHA1 Message Date
Ian Lance Taylor 83058b8c7b From Yuli Barcohen <yuli.barcohen@telrad.co.il>:
* debug.c (debug_type_samep): Avoid endless loops comparing
	function and method parameter types.
1998-06-01 22:28:07 +00:00
Ian Lance Taylor 7826d7e117 tweak last patch 1996-03-12 17:26:23 +00:00
Ian Lance Taylor e1b8810917 * debug.c (debug_type_samep): Don't loop endlessly in
DEBUG_KIND_ENUM case.  From Eric Baur <ecb@nexen.com>.
1996-03-12 17:10:22 +00:00
Ian Lance Taylor 76e45938c3 * ieee.c (ieee_define_named_type): When creating a tag for an
anonymous struct, copy the name into memory.
	(ieee_tag_type): Likewise.
	* debug.c (debug_write_type): Only check and set id field for an
	unnamed object.
	(debug_write_class_type): Likewise.
1996-01-24 21:10:55 +00:00
Ian Lance Taylor a837b8fc96 comment change 1996-01-24 19:38:16 +00:00
Ian Lance Taylor 501be095c9 * debug.h (enum debug_var_kind): Add DEBUG_VAR_ILLEGAL.
(enum debug_parm_kind): Add DEBUG_PARM_ILLEGAL.
	* debug.c (debug_get_parameter_types): Handle DEBUG_KIND_FUNCTION.
1996-01-24 01:26:49 +00:00
Ian Lance Taylor 796369aa96 * debug.c (debug_append_filename): Remove.
* debug.h (debug_append_filename): Don't declare.
1996-01-23 20:59:18 +00:00
Ian Lance Taylor 35aa91b97d * debug.h (debug_get_type_size): Declare.
(debug_get_field_name): Declare.
	(debug_get_field_bitpos): Declare.
	(debug_get_field_bitsize): Declare.
	(debug_get_field_visibility): Declare.
	(debug_get_field_physname): Declare.
	* debug.c (debug_get_real_type): Handle DEBUG_KIND_TAGGED.
	(debug_get_type_size): New function.
	(debug_get_field_name): New function.
	(debug_get_field_bitpos): New function.
	(debug_get_field_bitsize): New function.
	(debug_get_field_visibility): New function.
	(debug_get_field_physname): New function.
	(debug_write_type): Make sure we pass the real kind, not INDIRECT,
	to tag_type.  Pass the name recursively for INDIRECT.
1996-01-23 00:34:58 +00:00
Ian Lance Taylor 267e52989e * debug.h (struct debug_write_fns): Remove ellipsis_type. Add int
and boolean parameters to function_type.  Add boolean parameter to
	method_type.
	(debug_make_ellipsis_type): Don't declare.
	(debug_make_function_type): Add debug_type * and boolean
	parameters.  Change all callers.
	(debug_make_method_type): Add boolean parameter.  Change all
	callers.
	(debug_get_parameter_types): Add boolean * parameter.  Change all
	callers.
	(debug_get_target_type): Declare.
	* debug.c (struct debug_function_type): Add fields arg_types and
	varargs.
	(struct debug_method_type): Add field varargs.
	(debug_ellipsis_type, ELLIPSIS_P): Remove.
	(debug_make_ellipsis_type): Remove.
	(debug_make_function_type): Add arg_types and varargs parameters.
	(debug_make_method_type): Add varargs parameter.
	(debug_get_parameter_types): Add pvarargs parameter.
	(debug_get_target_type): New function.
	(debug_write_type): In case DEBUG_KIND_FUNCTION, push argument
	types and pass count to function_type.  In DEBUG_KIND_METHOD, use
	a signed int for the count, don't call ellipsis_type, and pass
	varargs to method_type.
	* stabs.c (struct stab_demangle_info): Add varargs field.
	(stab_demangle_argtypes): Add pvarargs parameter.  Change all
	callers.
	(stab_demangle_args): Likewise.
	(stab_demangle_type): In case 'F', pick up argument types.
	* prdbg.c (pr_ellipsis_type): Remove.
	(pr_function_type): Add argcount and varargs parameters.
	(pr_method_type): Add varargs parameter.
	* ieee.c (ieee_ellipsis_type): Remove.
	(ieee_function_type): Add argcount and varargs parameters.
	(ieee_method_type): Add varargs parameter.  Remove most of
	function body, and just call ieee_function_type.
1996-01-19 19:44:00 +00:00
Ian Lance Taylor 07aa1e1b7a * debug.h (enum debug_type_kind): Add DEBUG_KIND_ILLEGAL.
(struct debug_write_fns): Add field ellipsis_type.  Add id
	parameter to start_struct_type, start_class_type, and tag_type.
	(debug_make_ellipsis_type): Declare.
	(debug_find_named_type): Declare.
	(debug_get_type_kind): Declare.
	(debug_get_return_type): Declare.
	(debug_get_parameter_types): Declare.
	(debug_get_fields): Declare.
	(debug_get_field_type): Declare.
	* debug.c (struct debug_handle): Add fields class_id and base_id.
	(struct debug_class_type): Add field id.
	(struct debug_method_variant): Rename argtypes to physname.
	Change all uses.
	(debug_ellipsis_type): New static variable.
	(ELLIPSIS_P): New macro.
	(debug_make_ellipsis_type): New function.
	(debug_make_method_variant): Rename argtypes to physname.
	(debug_make_static_method_variant): Likewise.
	(debug_name_type): Always put types in the global namespace.
	(debug_find_named_type): New function.
	(debug_find_tagged_type): Treat DEBUG_KIND_ILLEGAL specially,
	rather than DEBUG_KIND_VOID.
	(debug_get_real_type): New static function.
	(debug_get_type_kind): New function.
	(debug_get_return_type): New function.
	(debug_get_parameter_types): New function.
	(debug_get_fields): New function.
	(debug_get_field_type): New function.
	(debug_write): Initialize base_id.
	(debug_write_type): Pass new id argument to tag_type.  Handle
	DEBUG_KIND_ILLEGAL.  Use id for	DEBUG_KIND_STRUCT and
	DEBUG_KIND_UNION.  Handle ellipsis for method arguments.
	(debug_write_class_type): Don't dereference kclass if it is NULL.
	Use id.
	* prdbg.c (pr_fns): Add pr_ellipsis_type.
	(pr_ellipsis_type): New static function.
	(pr_pointer_type): If this is a pointer to an array, parenthesize
	it correctly.
	(pr_start_struct_type): Add id parameter.
	(pr_start_class_type): Likewise.
	(pr_tag_type): Likewise.
	(pr_fix_visibility): Add the visibility to the top of the stack,
	not the second element on the stack.
	(pr_struct_field): Pop the stack before calling pr_fix_visibility.
	(pr_class_static_member): Likewise.
	(pr_class_start_method): Don't push a type, just set the method
	name in the type on the top of the stack.
	(pr_class_end_method): Don't pop the stack.
	(pr_class_method_variant): Rename argtypes parameter to physname.
	Append const and volatile rather than prepending them.  Add a
	space after the physname.
	(pr_class_static_method_variant): Likewise.
	* ieee.c (ieee_fns): Add ieee_ellipsis_type.
	(ieee_define_named_type): Use DEBUG_KIND_ILLEGAL rather than
	DEBUG_KIND_VOID.
	(write_ieee_debugging_info): Likewise.
	(ieee_typdef): Likewise.
	(ieee_ellipsis_type): New static function.
	(ieee_start_struct_type): Add id parameter.
	(ieee_start_class_type): Likewise.
	(ieee_tag_type): Likewise.
	(ieee_class_method_variant): Rename name to physname.
	(ieee_class_static_method_variant): Likewise.
1996-01-19 18:03:04 +00:00
Ian Lance Taylor 36302909f2 * debug.c (debug_make_undefined_tagged_type): Make sure we are
given a kind of type we can handle.
	(debug_write_type): Handle undefined enums and structs.
	(debug_write_class_type): Handle undefined classes.
	* prdbg.c (pr_enum_type): Handle an undefined enum.
Also comment changes to debug.h.
1996-01-11 16:47:10 +00:00
Ian Lance Taylor 63840d265c * debug.h (struct debug_write_fns): Add tag parameter to
enum_type, start_struct_type, and start_class_type.
	* debug.c (debug_write_type): Pass any tag name to
	start_struct_type, debug_write_class_type, and enum_type.  If
	DEBUG_KIND_TAGGED, pass the name in the recursive call.
	(debug_write_class_type): Accept a new tag parameter, and pass it
	to start_class_type.
	* prdbg.c (pop_type): Don't remove '+' character.
	(pr_enum_type): Accept and use tag parameter.
	(pr_start_struct_type): Likewise.
	(pr_start_class_type): Likewise.
	(pr_class_baseclass): Adjust algorithm used to find where to put
	the baseclass name.
	(pr_tag): Don't bother to insert the tag name.
1996-01-08 23:18:51 +00:00
Ian Lance Taylor e1c145993e Implement generic debugging support. Implement a stabs reader and
a generic printer.
	* budbg.h, debug.c, debug.h, prdbg.c, rddbg.c, stabs.c: New files.
	* objdump.c: Include "debug.h" and "budbg.h".
	(dump_debugging): New global variable.
	(usage): Mention --debugging.
	(long_options): Add "debugging".
	(display_bfd): Handle --debugging.
	* Makefile.in (OBJDUMP_OBJS): New variable.
	($(OBJDUMP_PROG)): Use $(OBJDUMP_OBJS).
	* binutils.texi, objdump.1: Document --debugging.
1996-01-02 22:48:58 +00:00