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: [PING][RFC][PATCH v2] Python API: add gdb.stack_may_be_invalid


Martin Galvan wrote:

> +stack_is_destroyed (gdb_py_ulongest pc)
> +{
> +  return gdbarch_in_function_epilogue_p (python_gdbarch, pc);
> +}

Just one comment here: python_gdbarch isn't really correct here.
If you have a platform that supports multiple architectures, then
you really should use the appropriate gdbarch for PC.

(python_gdbarch is unfortunately one of those hacks; it would be
preferable if we didn't have it at all ...)

Ideally, the Python interface should carry enough information to
determine the appropriate gdbarch, e.g. by operating on a Frame
instead of a plain PC value.

If that isn't possible, one fall-back might be to look up the
symbol table from the PC, and use the associated objfile arch.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  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]