This is the mail archive of the gdb@sources.redhat.com 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]

prob with "next"


Hi All, 
         I have some problem with "next" on function calls. My doubts are

Q1 If my target PC register points to the next instruction(to be executed)
not the current one, then does the setting 

		gdbarch_decr_pc_after_break (gdbarch, 2); (My instruction
size is 2 bytes)

is enough to compenstate the "current pc" requirement of gdb ?

--------------------------------

Q2	How does the "next" work on a function call(on a target which does
not have any hardware support for breakpoint, but single stepping is
supported)? I thought it just sets the breakpoint(at the funct end) and
continues. But that s not happening?

-----------------------------------
Q3I am facing problem with "next" in the following case :

 when i execute the "next" command, at x=add(a,b);

 at that point my PC is pointing to next instr (i. e address 0x26) and the
current instruction is (0x24)


				b=222;			//Pseudo
					  22:   3e 06           MOVE  R1,
XXX
 					  24:   0e de           MOVE  R2,
#deh
				x=add(a,b);
		PC-> 			  26:   3e 04           MOVE  R3,
#04h
					  28:   89 0e           MOVE  R9,
@R3
					  2a:   3e 06           MOVE  R8,
#06h
					  2c:   99 0e           MOVE  R1,
@R7
					  2e:   0b 00           MOVE  R1,
#00h
					  30:   49 28           MOVE  R2,
#28h
					  32:   df 0c           MOVE  R3, PC
					  34:   bd 49           CALL  _add
					  36:   c9 09           MOVE  R1, R2
					  38:   3e 02           MOVE  R3,
#02h
					  3a:   8e 49           MOVE  @R4,
R4
				return 0;
					  3c:   49 00           MOVE  R4,
#00h
					}

It executes the whole program and does not halt at "return 0"?

----------------------------------------
Any suggestion help?


Regards
Vineet sharma


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