[comp.sys.mips] DBX processor registers & assembly code modification

stherien@sobeco.com (s.therien) (05/07/90)

I believe that there is something wrong in the DBX debugger. Does 
anybody know if this is a bug, or just what am I doing wrong. If 
there is a documented bug list for dbx, can someone send it to me.
I am running on:

          RISC/os Release 4.3 mips Version UMIPS
          dbx version 2.0

Problem description: I use the assign command to modify the contens of
registers (ex: "assign $r0 = 0x12") then use the printregs command
to verify that the register as realy been modify, register is still at
his old value but in fact it has been modified. As soon as I step, printregs
command reflect the new value for register 0. Does dbx has its own
copy of registers, and processor registers are only refreshed while execution
commands are given ? 

Question: Is it possible to directly modifing the object code while I'm
using dbx ? I tried to disassemble source code then patch the object 
corresponding to the instruction without success. It appears that the
codes is protected against writing.

---------------------------------------
Here is my sample DBX OUTPUT

/* assembly source line instruction before */
(DBX)0x402e04,20?i
[loadcode:1216, 0x402e04] 	li	r1,1

/* assembly source line contents */
(DBX)0x402e04/20x
00402e04:  2401 0001 15e1 0003 0000 0000 1000 0002
00402e14:  2790 83d1 2790 83d7 2784 83cb 0c10 c901
00402e24:  0200 2821 af82 cdbc

/* patch to the assembly source line instruction */
/* change li r1,1 for li r1,5 */
(DBX)assign 0x402e04 = 0x24010005
cannot write to address 0x402e04 in process 8177

/* assembly source line instruction after */
(DBX)0x402e04,20?i
[loadcode:1216, 0x402e04] 	li	r1,1


Thanks
Sylvain Therien
-- 
					Sylvain Therien
					{attcan,mcgill-vision,telly}!sobeco!stherien

rogerk@mips.COM (Roger B.A. Klorese) (05/08/90)

In article <1990May7.151950.13684@sobeco.com> stherien@sobeco.com (s.therien) writes:
>Problem description: I use the assign command to modify the contens of
>registers (ex: "assign $r0 = 0x12") then use the printregs command
>to verify that the register as realy been modify, register is still at
>his old value but in fact it has been modified. As soon as I step, printregs
>command reflect the new value for register 0. Does dbx has its own
>copy of registers, and processor registers are only refreshed while execution
>commands are given ? 

This is dependent on the value of the DBX setting "$datacache" which is by
default 1 (on).  If you "set $datacache=0" this cacheing is disabled.
-- 
ROGER B.A. KLORESE      MIPS Computer Systems, Inc.      phone: +1 408 720-2939
MS 4-02    950 DeGuigne Dr.   Sunnyvale, CA  94086   voicemail: +1 408 524-7421 
rogerk@mips.COM         {ames,decwrl,pyramid}!mips!rogerk         "I'm the NLA"
"Two guys, one cart, fresh pasta... *you* figure it out." -- Suzanne Sugarbaker