This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: [PATCH] CFI directives for GAS


On Thu, May 15, 2003 at 06:08:45PM +0200, Michal Ludvig wrote:
> the attached patch introduces some new pseudo-ops for easier generating 
> of Dwarf2 CFI unwind info. This is especially needed for unwinding over 
> hand-written assembler routines on amd64 target, where no standard 
> prologues are used.
[snip]
> How do you like this idea? Any comments? Can I apply the patch?

I like the idea.  Some comments on the implementation follow.

> +/* Codes of CFI instructions taken from Dwarf2 standard.  */
> +enum cfi_insn { 
> +  CFA_nop = 0x0,
> +  CFA_set_loc = 0x01,

Use include/elf/dwarf2.h:dwarf_call_frame_info if possible.

> +  char *regnames[] = { 
> +    "rax", "rbx", "rcx", "rdx",
> +    "rdi", "rsi", "rbp", "rsp",
> +    "r8", "r9", "r10", "r11",
> +    "r12", "r13", "r14", "r15",
> +    "rip" };

This is obviously processor dependent.  Needs to be split out to an
md_* define in tc-i386.h.

> +    as_bad ("Can't convert argument to %s.",
> +	    resolvereg ? "register number" : "integer");

No internationalization of messages, and better for translation to
write:
    as_bad (resolvereg
	    ? _("can't convert argument to register number")
	    : _("can't convert argument to integer"));

Note also that messages generally don't start with a capital (because
they aren't the start of a sentence), and don't finish with a fullstop.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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