mi/2309: Internal error (Assertion failure) on "-var-update" command
Nils.Hagge@siemens.com
Nils.Hagge@siemens.com
Fri Aug 31 15:38:00 GMT 2007
>Number: 2309
>Category: mi
>Synopsis: Internal error (Assertion failure) on "-var-update" command
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Aug 31 15:38:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator: Nils Hagge
>Release: version 6.5
>Organization:
>Environment:
- Windows/Cygwin AND
- SuSE Linux 10.2
>Description:
How to reproduce:
Take the following program:
#include <stdio.h>
struct {
struct { int secondA; int secondB; } firstA;
int firstB;
} *p;
int main(void) { // line 18
int i = 20; // line 19
printf("!!!Hello World!!!\n");
printf("i = %d\n", ++i);
p = 0;
return 0;
}
compile with debug info.
Start gdb as follows:
gdb -q -nw -i mi Debug/TestLocalDebug.exe
---------------
The following MI dialog
- starts the program and stops in main (line 19)
- create two watch expression
- "p" and
- "p->firstA.secondB"
- the second of which cannot be evaluated since p is not sensibly initialized.
- the command -var-expression-evaluate works and an error is indicated.
- the command -var-update brings gdb to crash on the "bad expression, see below:
-----------------------------------------------------
adhani1@ad026663nb$ gdb -q -nw -i mi Debug/TestLocalDebug.exe
(gdb)
break main
&"break main\n"
~"Breakpoint 1 at 0x401075: file ../src/TestLocalDebug.c, line 18.\n"
^done
(gdb)
2-exec-run
2^running
(gdb)
2*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x004010
75",func="main",args=[],file="../src/TestLocalDebug.c",fullname="/cygdrive/d/workspaces/rtpdebugger-devel-runtime/TestLocalDebug/src/TestLocalDebug.c", line="18"}
(gdb)
3 info program
&"info program\n"
~"\tUsing the running image of child thread 1924.0x14bc.\n"
~"Program stopped at 0x401075.\n"
~"It stopped at breakpoint 1.\n"
3^done
(gdb)
4 info threads
&"info threads\n"
~" 2 thread 1924.0xc8 0x7c90eb94 in ntdll!LdrAccessResource ()\n"
~" from /cygdrive/c/WINNT/system32/ntdll.dll\n"
~"* 1 thread 1924.0x14bc main () at ../src/TestLocalDebug.c:18\n"
4^done
(gdb)
5-var-create - * p
5^done,name="var1",numchild="2",type="struct {...} *"
(gdb)
6-var-create - * p->firstA.secondB
6^done,name="var2",numchild="0",type="int"
(gdb)
8-var-evaluate-expression var1
8^done,value="0x0"
(gdb)
9-var-evaluate-expression var2
&"Cannot access memory at address 0x4\n"
9^error,msg="Cannot access memory at address 0x4"
(gdb)
11-data-evaluate-expression p->firstA.secondB
&"Cannot access memory at address 0x4\n"
11^error,msg="Cannot access memory at address 0x4"
(gdb)
12-exec-next 1
12^running
(gdb)
12*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x0040107a", func="main",args=[],file="../src/TestLocalDebug.c",fullname="/cygdrive/d/workspaces/rtpdebugger-devel-runtime/TestLocalDebug/src/TestLocalDebug.c",line="19"}
(gdb)
13-var-update var1
13^done,changelist=[]
(gdb)
14-var-update var2
~"/netrel/src/gdb-20060706-2/gdb/varobj.c:1471: internal-error: my_value_equal:
Assertion `!value_lazy (val1)' failed.\n"
~"A problem internal to GDB has been detected,\n"
~"further debugging may prove unreliable.\n"
~"Quit this debugging session? (y or n) "
>How-To-Repeat:
replay the dialog
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gdb-prs
mailing list