[rfc] Replace macros by gdbarch functions in gdbint manual

Markus Deuling deuling@de.ibm.com
Fri Jun 22 07:10:00 GMT 2007


Hi Eli,

Eli Zaretskii wrote:
> Yes, after you take care of the following gotchas:
> 
>> -@deftypefn {Target Macro} CORE_ADDR POINTER_TO_ADDRESS (struct type *@var{type}, char *@var{buf})
>> +@deftypefn {Target Macro} CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *@var{current_gdbarch}, struct type *@var{type}, char *@var{buf})
> 
> You've replaced a macro with a function, so "Target Macro" is no
> longer appropriate.  (There are many more instances like this one.)
> 
>> -@anchor{BREAKPOINT_FROM_PC} Use the program counter to determine the
>> +@item gdbarch_breakpoint_from_pc (@var{current_gdbarch}, @var{pcptr}, @var{lenptr})
>> +@findex gdbarch_breakpoint_from_pc
>> +@anchor{gdbarch_breakpoint_from_pc} Use the program counter to determine the
> 
> Presumably, some @xref uses this @anchor, and that @xref will need to
> be changed as well, but I don't see any such changes in the patch.
> What am I missing?
> 
>> -@item DECR_PC_AFTER_BREAK
>> -@findex DECR_PC_AFTER_BREAK
>> -Define this to be the amount by which to decrement the PC after the
>> +@item gdbarch_decr_pc_after_break (@var{current_gdbarch})
>> +@findex gdbarch_decr_pc_after_break
>> +Set this to the amount by which to decrement the PC after the
> 
> A macro can be defined to a constant value, but how can one ``set'' a
> function to do the same?  (Again, there are several similar problems
> with ``setting'' a function.
> 
>> --- src/gdb/doc/gdb.texinfo	2007-06-19 05:22:05.000000000 +0200
>> +++ dev/gdb/doc/gdb.texinfo	2007-06-20 10:49:17.000000000 +0200
>> @@ -22763,8 +22763,8 @@
>>  Each byte of register data is described by two hex digits.  The bytes
>>  with the register are transmitted in target byte order.  The size of
>>  each register and their position within the @samp{g} packet are
>> -determined by the @value{GDBN} internal macros
>> -@code{DEPRECATED_REGISTER_RAW_SIZE} and @code{REGISTER_NAME} macros.  The
>> +determined by the @value{GDBN} internal gdbarch functions
>> +@code{DEPRECATED_REGISTER_RAW_SIZE} and @code{gdbarch_register_name}.  The
> DEPRECATED_REGISTER_RAW_SIZE is not a function, is it?

thank you for your review. I reworked the patch and think I addressed all of your points.

Furthermore I removed a lot of descriptions for macros that have already been deleted in the past.
I also changed the signature of some function descriptions where necessary (for example variable naming changed). 

The section "Converting an existing Target Architecture to Multi-arch" seems to be obsolete?
So I deleted it. I'm not sure about that :-) but its not hard to revert if I'm wrong with that.

I also renewed two code examples for gdbarch_unwind_pc and gdbarch_unwind_sp. 

In some places in "Target Architecture Definition" the return values of the functions were added, in others not.
I now added the return values to all descriptions in that section. The macros and functions in that section are all @items.
Maybe we should change the functions to @deftypefun? 

The patch got a little longer than I expected :-)

ChangeLog:

	* gdb.texinfo: Replace following macros by their appropriate gdbarch
	routines:
	(TARGET_CHAR_SIGNED, CALL_DUMMY_LOCATION, CANNOT_FETCH_REGISTER)
	(CANNOT_STORE_REGISTER, GET_LONGJMP_TARGET, POINTER_TO_ADDRESS)
	(ADDRESS_TO_POINTER, INNER_THAN, FRAME_NUM_ARGS)
	(HAVE_NONSTEPPABLE_WATCHPOINT, TARGET_SHORT_BIT, TARGET_INT_BIT)
	(TARGET_LONG_BIT, TARGET_LONG_LONG_BIT, TARGET_FLOAT_BIT)
	(TARGET_DOUBLE_BIT, TARGET_LONG_DOUBLE_BIT, TARGET_PTR_BIT
	(TARGET_ADDR_BIT, SP_REGNUM, PC_REGNUM, PS_REGNUM, FP0_REGNUM)
	(STAB_REG_TO_REGNUM, ECOFF_REG_TO_REGNUM, DWARF_REG_TO_REGNUM)
	(SDB_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM, BELIEVE_PCC_PROMOTION)
	(CONVERT_REGISTER_P, REGISTER_TO_VALUE, VALUE_TO_REGISTER)
	(POINTER_TO_ADDRESS, ADDRESS_TO_POINTER, EXTRACT_RETURN_VALUE)
	(STORE_RETURN_VALUE, SKIP_PROLOGUE, MEMORY_INSERT_BREAKPOINT)
	(BREAKPOINT_FROM_PC, MEMORY_REMOVE_BREAKPOINT, DECR_PC_AFTER_BREAK)
	(ADDR_BITS_REMOVE, TARGET_PRINT_INSN, SKIP_TRAMPOLINE_CODE)
	(IN_SOLIB_RETURN_TRAMPOLINE, NAME_OF_MALLOC, ADDRESS_CLASS_TYPE_FLAGS)
	(ADDRESS_CLASS_TYPE_FLAGS_TO_NAME, ADDRESS_CLASS_TYPE_FLAGS_P).
	(ADDRESS_CLASS_NAME_to_TYPE_FLAGS, ADJUST_BREAKPOINT_ADDRESS)
	(PRINT_FLOAT_INFO, PRINT_VECTOR_INFO, INTEGER_TO_ADDRESS)
	(SKIP_PERMANENT_BREAKPOINT, TARGET_VIRTUAL_FRAME_POINTER).

	(push_dummy_call, stabs_argument_has_addr, unwind_sp, unwind_pc)
	(print_registers_info, push_dummy_code, unwind_dummy_id): Rework.

	(REGISTER_CONVERT_TO_TYPE, END_OF_TEXT_DEFAULT, GDB_MULTI_ARCH)
	(GDB_TARGET_IS_HPPA, DEPRECATED_GET_SAVED_REGISTER)
	(SYMBOLS_CAN_START_WITH_DOLLAR, DEPRECATED_INIT_EXTRA_FRAME_INFO)
	(DEPRECATED_INIT_FRAME_PC, DEPRECATED_SIGTRAMP_START)
	(IN_SOLIB_CALL_TRAMPOLINE, NO_HIF_SUPPORT, REGISTER_CONVERTIBLE)
	(DEPRECATED_REGISTER_RAW_SIZE, PARM_BOUNDARY, DEPRECATED_STACK_ALIGN)
	(PROLOGUE_FIRSTLINE_OVERLAP, DEPRECATED_POP_FRAME, STEP_SKIPS_DELAY)
	(TARGET_COMPLEX_BIT, TARGET_DOUBLE_COMPLEX_BIT)
	(OS9K_VARIABLES_INSIDE_BLOCK, KERNEL_U_ADDR, KERNEL_U_ADDR_HPUX)
	(REGISTER_U_ADDR, U_REGS_OFFSET, DEBUG_PTRACE): Remove description.

	(Converting an existing Target Architecture to Multi-arch): Remove
	 section.

	(gdbarch_unwind_pc, gdbarch_unwind_sp): Renew code example.

	* gdb.texinfo: Replace REGISTER_NAME by gdbarch_register_name.

Is this ok ?

-- 
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff-gdbint
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20070622/931f307c/attachment.ksh>


More information about the Gdb-patches mailing list