Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] Assignement and side effects (PR 31484)

I'll move this discussion here.

Note 1: I had already raised a PR on this on gdb, keith/elena and all have in
the current gdb head branch, a new OOB that will notify for assignements
and when side effects, in the GDB/MI 2 protocol it looks like this:

(gdb)
&"set *(int*)&argc = 32\n"
=target-changed
^done
(gdb)

Base on this, I would advocate for a more general approach for
the PR 31484 (see below):

An assignement, whether a register, memoryblock or variable, should trigger
an ChangedEvent event, then it will be up to the framework to call update()
on all the managers to check for any side effect of the assigment.
And in the future, it may not be necessary to do it manually in the cdt/gdb
implementation because of the new OOB "=target-changed"


something like this in pseudo-code:

void handleChangeEvent() {
	IManagers[] mgrs = session.getManagers();
	if (updateOnAssignement) {
		for (int i = 0; i < mgrs.length; i++) {
			mgrs.update();
		}
	}
}
  


Note 2:
The other point is particular to gdb-5.3 and pseudo-registers even
calling update() on the RegisterManager may not work since the GDB/MI
command "-data-list-changed-register" and "-data-list-register-values"
do not track the pseudo-register.  A PR was created in the GDB database
for this.


==========================================================
http://bugs.eclipse.org/bugs/show_bug.cgi?id=31484

           Summary: Register setting does not correctly update display.
           Product: CDT
           Version: 1.0
          Platform: All
        OS/Version: Windows 2000
            Status: NEW
          Severity: minor
          Priority: P3
         Component: Debug
        AssignedTo: Mikhailk@xxxxxxx
        ReportedBy: songer@xxxxxxxxxxxxx


GDB pseudo registers are registers that do not really exist in the architecture 
but are convenient values that are often based on actual architectural state. A 
user initiated change with the Register Manager to either a pseudo register or 
register on which a psuedo register depends did not update the displayed values 
for all the affected registers. 

Consider the following example of this happening in a normal run with the 
Xtensa debugger. Note in particular that changing the value of $a6 also changes 
the value for $ar10.

(xt-gdb) run
Starting program: /cygdrive/c/JavaDev/eclipseclean/runtime-
workspace/HelloWorld/bin/SimpleSystem.soc/simple_build/proces
sor_s1/Debug/HelloWorld
Switching to remote protocol
Remote debugging using localhost:56679
Found ISS3
0x40000020 in _ResetVector ()

Breakpoint 1, main (argc=1, argv=0x600fff40) at main.c:6
6               printf( "hello world\n");
(xt-gdb) print $wb
$1 = 1
(xt-gdb) print $a6
$2 = 0
(xt-gdb) print $ar10
$3 = 0
(xt-gdb) set $a6 = 0x10
(xt-gdb) print $ar10
$4 = 16
(xt-gdb)

(Note, I've fixed this already and will submit a patch for it, but wanted a bug 
tracking number to go with it.)



Back to the top