Re: [PATCH/arm] Backtrace through exception frames on arm/cortex-m target

Joel Brobecker
2012-11-14T02:57:51Z

> Sure. We didn't add comments to these functions because they are
> installed to 'struct frame_unwind' to compose a unwinder for a specific
> type of frames. The situation is similar to gdbarch hook functions, so
> I add comment in the similar way, for example,

Thank you. I know the comment is slightly superfluous, but a comment
like the one you added is good to confirm what it's for, and where
to go looking for the function's general documentation. And one of
the reasons why I usually insist on documenting every function is
because it is just simpler to say "document everything" than to say
"document everything except ...".

> 2012-11-14 Daniel Jacobowitz <dan@codesourcery.com>
> Yao Qi <yao@codesourcery.com>
>
> * arm-tdep.c (arm_addr_bits_remove): Do not adjust the low
> bit of EXC_RETURN.
> (arm_m_exception_cache, arm_m_exception_this_id)
> (arm_m_exception_prev_register, arm_m_exception_unwind_sniffer)
> (arm_m_exception_unwind): New.
> (arm_gdbarch_init): Register arm_m_exception_unwind.

The patch looks fine to me, except for one minor formatting nit.
Pre-appoved with that change.

Also, a small reminder that the soft limit for line length is 70
chars, with a hard limit of 80 per an earlier discussion on this list.
Some of the comments are a little wide, in that respect, but nothing
significant enough to worry about. Just something to keep in mind
for the future, if you don't mind.

> + /* On M-profile devices, do not strip the low bit from EXC_RETURN
> + (the magic exception return address). */

Question from an arm novice: Why? (and would it be something useful
to add to the comment as well?

> +struct frame_unwind arm_m_exception_unwind = {

Can you put the opening curly brace on the next line? We're a little
inconsistent regarding this, but I believe that this is the style
that we should be using.

Thanks,
--
Joel