Bug 12013 - MIPS tracepoint cannot collect stack info through collect *(unsigned char *)($sp)@512
Summary: MIPS tracepoint cannot collect stack info through collect *(unsigned char *)(...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: tdep (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-14 03:36 UTC by teawater
Modified: 2010-12-30 03:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description teawater 2010-09-14 03:36:15 UTC
I try MIPS tracepoint but when I want to use collect *(unsigned char *)($sp)@512 
to collect the stack info, but I got:
(gdb) actions 
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
>collect *(unsigned char *)($sp)@512
'sp' is a pseudo-register; GDB cannot yet trace pseudoregister contents.

That is because in ax-gdb.c:
	reg = user_reg_map_name_to_regnum (exp->gdbarch, name, strlen (name));
	if (reg == -1)
	  internal_error (__FILE__, __LINE__,
			  _("Register $%s not available"), name);
	if (reg >= gdbarch_num_regs (exp->gdbarch))
	  error (_("'%s' is a pseudo-register; "
		   "GDB cannot yet trace pseudoregister contents."),
		 name);

In user_reg_map_name_to_regnum, it will call mips_register_name to get reg name:
But in function mips_register_name:
  /* Map [gdbarch_num_regs .. 2*gdbarch_num_regs) onto the raw registers, 
     but then don't make the raw register names visible.  */
  int rawnum = regno % gdbarch_num_regs (gdbarch);
  if (regno < gdbarch_num_regs (gdbarch))
    return "";

So it make user_reg_map_name_to_regnum just can return the "reg" bigger than 
gdbarch_num_regs.

Then it will get this error message.  Do you have some way to handle this issue?