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: [rfc] [00/16] Get rid of current gdbarch


On Mon, Oct 08, 2007 at 03:02:51PM +0200, Ulrich Weigand wrote:
> 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.)

   /* This will hopefully provoke a warning.  */
-  return gdbarch_num_regs (current_gdbarch)
-        + gdbarch_num_pseudo_regs (current_gdbarch);
+  return gdbarch_num_regs (gdbarch)
+        + gdbarch_num_pseudo_regs (gdbarch);

That's the only thing it's used for.  Does it provoke a warning?  If
not, maybe -1 or something similar should...

-- 
Daniel Jacobowitz
CodeSourcery


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