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: [PATCH V2] ABI changes for MPX.


> Thanks, I understand now.  So why would a GDB user want to set
> mpx-bnd-init-on-return to zero?  The result will always be a bound
> violation, no?

If I understand correctly, which is a fairly big if, it will
depend on how far in the function's execution you've gone through.
If you return early enough that the bound registers are still
uninitialized, then you want to initialize them to make sure that
there will be no bound violation due to the premature return.
On the other hand, there might be some situations where you know
the bound registers have been set, and you want to preserve their
value, rather than blindly setting it to zero. For instance, what
if there was, in fact, a bound violation. Setting it to zero would
change the program's behavior by canceling the reporting of that
violation.

PS: FWIW, I dislike the term "initialize", here, because it always
    begs the question: "initialize to what?". If this is the
    terminology used in the reference documentation and is known
    to the community working on those chips, then I guess we have
    to go with the flow. But otherwise, I personally would advocate
    for another term, such as "reset" or "set to zero".
    Just my 2 cents.

-- 
Joel


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