This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Proposal: convert function definitions to prototyped form


On Jun 12,  4:30pm, Eric Bachalo wrote:

> > You can tell indent about all the types defined by typedef with -T
> > option, and then it won't add the extra space.  It shouldn't be too
> > difficult to identify all the types.
> > 
> > It might be useful for us to maintain an indent.pro file that has
> > these definitions so that additional runs of indent don't add back
> > the space.
> 
> I believe etags does a fairly good job a finding typedefs.  I would be a
> fairly simple script to parse the TAGS file to make a list of all typedefs.  I
> have a python script for this.  Not sure how ported etags and python are for
> all the hosts that compile GDB though. 

What you suggest would work so long as you also run etags over the
system header files.

For the task at hand, however, the check-decls script has already
identified the necessary types.  (Recall that check-decls is run on
the "diff -u" output after doing a fix-decls.  It constructs a program
which is then compiled with "gcc -Wall" to check the validity of the
protoization performed by fix-decls.  In the process of constructing
the validating program, it must first identify all of the types
requiring typedefs.)

Here is the list of types found by check-decls:

    ADDR32, B_TYPE, COMMON_ENTRY_PTR, CORE_ADDR, CPUSpace, DCACHE,
    DIE_REF, DOUBLEST, EXTR, EventRecord, FDR, FILE, HWND, INSN_WORD,
    INT32, LONG, LONGEST, LPARAM, LRESULT, PDR, PTR, PTRACE_ARG3_TYPE,
    PXDB_header_ptr, Point, Ptrace_return, RDB_EVENT, REGISTER_TYPE,
    RgnHandle, Rptrace, SAVED_BF_PTR, SAVED_F77_COMMON_PTR,
    SAVED_FUNCTION, SYMR, TTRACE_ARG_TYPE, UINT, ULONGEST, WAITTYPE,
    WPARAM, WindowPtr, XDR, YYSTYPE, alpha_extra_func_info_t,
    arg_array, arg_one, arg_type, arg_value, argsin, asection,
    attach_continue_t, bfd, bfd_arch_info_type, bfd_byte,
    bfd_signed_vma, bfd_vma, bool_t, boolean, boolean_t, bpstat,
    branch_type, catch_errors_ftype, catch_fork_kind, cma__t_int_tcb,
    disassemble_info, dld_cache_t, dnttpointer, dst_rec_ptr_t,
    dst_sec, dst_sect_ref_t, dst_type_t, file_ptr, fltset_t,
    fpregset_t, func_call, gdb_client_data, gdb_fpregset_t,
    gdb_gregset_t, gdb_thread_t, gdb_threadref, gregset_t,
    host_callback, insertion_state_t, insn_type, kern_return_t,
    lwpid_t, mach_msg_header_t, mach_msg_id_t, mach_msg_type_name_t,
    mach_port_mscount_t, mach_port_t, memory_page_t, memxferfunc,
    mips_extra_func_info_t, namespace_enum, off_t, pid_t,
    port_chain_t, process_state_t, procinfo, quick_file_entry,
    quick_module_entry, quick_procedure_entry, return_mask,
    rmt_thread_action, sec_ptr, serial_t, serial_ttystate, sigset_t,
    size_t, sltpointer, stepping_mode_t, sysset_t, t_inst, task_t,
    td_err_e, td_thr_state_e, td_thr_type_e, td_thragent_t,
    td_thrhandle_t, thread_array_t, thread_info, thread_t, threadinfo,
    threadref, time_t, tree, ttevents_t, ttreq_t, ttstate_t, ttwopt_t,
    u_long, ui_file_delete_ftype, ui_file_flush_ftype,
    ui_file_fputs_ftype, ui_file_isatty_ftype, ui_file_put_ftype,
    ui_file_rewind_ftype, va_list, value_ptr, and xdrproc_t

Note that there are likely typedefs for types in the gdb sources
missing from the above list, but these were not necessary for doing
the fix-decls conversion.  Also, there are some in the above list
which are defined in system header files.  But that's okay because
indent still needs to know about them in order to do a good job of
formatting.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]