This is the mail archive of the 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]
Other format: [Raw text]

Re: [rfc] Replace macros by gdbarch functions in gdbint manual

> Date: Wed, 20 Jun 2007 12:17:34 +0200
> From: Markus Deuling <>
> CC: Ulrich Weigand <>
> this patch replaces the macros that have been replaced in in GDB's manuals.


> Is this ok to commit?

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?

> -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?

Thanks again for working on this.

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