[rfc] [00/16] Get rid of current gdbarch

Markus Deuling deuling@de.ibm.com
Mon Oct 8 13:22:00 GMT 2007


Ulrich Weigand schrieb:
> Markus Deuling wrote:
> 

> I've checked all of those in, except for the i386-tdep.c one:

Thank you very much.

> @@ -169,6 +169,8 @@ i386_register_name (int regnum)
>  static int
>  i386_dbx_reg_to_regnum (int reg)
>  {
> +  struct gdbarch *gdbarch = get_frame_arch (get_current_frame ());
> +
>    /* This implements what GCC calls the "default" register map
>       (dbx_register_map[]).  */
>  

Ops, you're right. Thank you very much. This one shouldn't have been in there.

> You should not call get_current_frame at this point; this might
> in fact fail as there is not necessarily a current frame selected
> at the point this callback is called.
> 
> Instead, you should change the XXX_reg_to_regnum gdbarch entries
> from type "f" to "m"; then the functions will be automatically
> provided with a gdbarch parameter.  (This should be a separate
> patch from the remaining trivial current_gdbarch replacements.)
> 

Yes' I'll come up with a patch for that...

-- 
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com



More information about the Gdb-patches mailing list