This is the mail archive of the gdb-patches@sourceware.org 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: [try 3rd] arm_pc_is_thumb takes displaced stepping into account


Yao Qi wrote:

> This time, instead of exposing displaced_step_inferior_state to tdep, we 
> return displaced_step_closure, which is defined by each tdep, instance 
> to tdep appropriately.

Hmmm.  I see one problem with this approach:

> +/* If inferior is in displaced stepping, and ADDR equals to starting address
> +   of copy area, return corresponding displaced_step_closure.  Otherwise,
> +   return NULL.  */

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?

Your get_displaced_step_closure_by_addr routine would not find the
closure in this case, because the PC doesn't match the start address.

I had originally suggested to create a function that would recognize
any PC within the copy area.  But it seems this cannot be implemented
in common code, since common code does not actually know the length
of the copy area.

Matthew suggested to keep another list of copy areas in target-dependent
code instead.  While I don't really like to keep duplicated data, it
would appear that this approach is able to handle the above situation.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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