[try 3rd] arm_pc_is_thumb takes displaced stepping into account
Ulrich Weigand
uweigand@de.ibm.com
Tue Feb 15 21:15:00 GMT 2011
Yao Qi wrote:
> On 01/31/2011 11:38 PM, Ulrich Weigand wrote:
> > What if the copy area contains more than a single instruction, and we
> > need to find out the mode of the PC corresponding to the second of them?
> >
>
> This approach can handle multiple instructions in copy area, because
> during preparation of displaced stepping (in displaced_step_prepare),
> regcache_write_pc is called to update PC to the *address of copy area*,
> no matter how many instructions in copy area.
>
> Per my limited knowledge on GDB, I can't find a case that PC is set
> somewhere of copy area other than the beginning of copy area during
> displaced stepping. That is to say, we don't have to know the mode of
> the 2nd instruction.
Hmm, I guess you're right ... GDB does "hide" the fact that it has
replaced the original instruction, and you should never end up in
the middle of a displaced stepping sequence.
The patch is OK, except for a couple of formatting issues:
+ struct displaced_step_closure* dsc
+ = get_displaced_step_closure_by_addr(memaddr);
Please use
struct displaced_step_closure *dsc
(i.e. the * next to the variable, not the type).
+struct displaced_step_closure*
+get_displaced_step_closure_by_addr (CORE_ADDR addr);
Here as well, there should be a space between the type and the *.
Also, please do not start the function name on the next line
in the header file; "grep ^get_displaced_step_closure_by_addr *"
should find only the definition, not the declaration.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
More information about the Gdb-patches
mailing list