This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 1/2 v2] Re-check fastpoint after reloading symbols.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: qiyaoltc at gmail dot com (Yao Qi), cole945 at gmail dot com (Wei-cheng Wang), gdb-patches at sourceware dot org
- Date: Wed, 16 Sep 2015 09:35:35 +0100
- Subject: Re: [PATCH 1/2 v2] Re-check fastpoint after reloading symbols.
- Authentication-results: sourceware.org; auth=none
- References: <20150915162152 dot 75FF92209 at oc7340732750 dot ibm dot com>
"Ulrich Weigand" <firstname.lastname@example.org> writes:
> I guess I'm not really sure what the difference is between checks
> "using GDBserver internal knowledge" and those that don't. Doesn't
> the x86 check, strictly speaking, also use GDBserver internal knowlegde,
> i.e. it knows which instruction GDBserver attempts to place at the
> tracepoint location, and therefore knows how much space must be
> available there?
It is different when GDB talks with some debugging stubs other than
GDBserver, which support tracepoint too. It is OK that GDB checks fast
tracepoint's validity according to GDB's own knowledge, such as
instruction size. That is what x86 does nowadays. However, GDB can't
check validity by checking whether it is too far to jump to the jumppad
from the tracepoint address. Jumppad address is unknown to GDB, and
other debugging stub may allocate jumppad differently. PPC GDB
tracepoint do checks in this way, which isn't right to me.
> That's why I am now wondering whether the best fix shouldn't be to
> simply remove the GDB-side check completely, even on x86, and solely
> rely on GDBserver reporting errors via the remote protocol ...
It is fine with me to move validity checks to GDBserver side, but we
need to add some thing to decode x86 instructions and get to know instruction
length. Nowadays, we are using gdb_print_insn which calls some function
in opcodes in GDB side, but it doesn't exist in GDBserver side.