Bug 16729 - wrong tracepoint bytedcode doumentation for rot
Summary: wrong tracepoint bytedcode doumentation for rot
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: breakpoints (show other bugs)
Version: 7.7
: P2 normal
Target Milestone: 8.1
Assignee: Not yet assigned to anyone
URL:
Keywords: good-first-bug
Depends on:
Blocks:
 
Reported: 2014-03-20 13:38 UTC by Toma Bilius
Modified: 2024-01-08 17:38 UTC (History)
2 users (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 Toma Bilius 2014-03-20 13:38:24 UTC
The description for rot function from https://sourceware.org/gdb/onlinedocs/gdb/Bytecode-Descriptions.html specifies that rot should do the rotation a b c -> c b a. However, in the implementation (gdb_eval_agent_expr) the rotation is a b c -> c a b

Here is the code that does this:

          case gdb_agent_op_rot:
	  {
	    ULONGEST tem = stack[sp - 1];

	    stack[sp - 1] = stack[sp - 2];
	    stack[sp - 2] = top;
	    top = tem;
	  }
	  break;