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: RFA: [ARM] "svc" insn check at irrelevant address in ARM unwind info sniffer


Joel Brobecker <brobecker@adacore.com> writes:

> Here is how I understand things: The code is trying to figure out
> if our frame corresponds to a system call or not. For that, it searches
> the instruction at "get_frame_pc (this_frame) - 2" (or -4 for non-thumb).
> To me, the reason for the -2 or the -4, is that it implicitly makes
> the assumption that "get_frame_pc (this_frame)" is a *return address*.

Yeah, that is a good point...

> So, it has to check the instruction immediately before that return
> address. That assumption is not valid for the inner-most address.
>
> Imagine we have a function whose code has been compiled into:
>
>     ...stuff...
>     svc #imm
>     insn #2    <<<-- breakpoint here
>

... and this is a good example too.

> ... and we're stopped at the breakpiont.  In this case, get_frame_pc
> will return the address in "insn #2", and therefore see an "svc"
> instruction just before it, and conclude that we're stuck on a system
> call, which is not true.
>


>
> So, in my opinion, the patch I initially propose is still best.
> When you look at the patch with whitespace changes removed (attached),
> it is actually fairly tiny.

so, your initial patch is OK to me.

-- 
Yao (éå)


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