Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Setting character variable in idb

a_gel
Beginner
911 Views
I tried to modify a character variable in a debug session using idb.
Neither
set varname="newVal"
in the command window

nor
on selection "var"/ set value
in the graphical ui

modified the according variable.

Integer or real variables can be modified these ways. How about character?

Thank you in advance
AG
0 Kudos
1 Solution
Hubert_H_Intel
Employee
911 Views
Yes, in the command line and GUI command window changing a character value is not supported, but you can change it on the Evaluations window. Just right-click on the value, select Set Value and enter either the ASCII code (e.g.) 66 or 'B' to change the value.

View solution in original post

0 Kudos
4 Replies
Hubert_H_Intel
Employee
911 Views

Axel,

Maybe I missed the point, but I cannot reproduce the problem. A character variable can be modified with the debugger on command line and also on the GUI via the Eval Window.

Here a sample on command line:

$ cat charval.c
int main()
{
char charval='x';
}
$ icc -g charval.c
$ idbc a.out
Intel Debugger for applications running on IA-32, Version 12.0, Build [74.923.2]
-----------------
object file name: a.out
Reading symbols from a.out...done.
(idb) b main
Brakpiont 1 at 0x80483c1: file charval.c, line 3.
(idb) r
Starting program a.out
Breakpoint 1, main () at charvlc:3
3 char charval='x';
(idb) step
4 }
(idb) print charval
$1 = 120 'x'
(idb) set charval='y'
(idb) print charval
$2 = 121 'y'
(idb)

0 Kudos
a_gel
Beginner
911 Views
I did not mention the programming language (though the Forum 'Intel Fortran Compiler...' is sufficient).

Using a Fortran 90 application (RedHat Linux, IA32, idb 11.1 (idb 12 does not work as well), I faced the problems described before:

PROGRAM bubu

CHARACTER*10 text

text = 'A'
PRINT *,text

END PROGRAM bubu

Changing variable 'text' cannot be done.

Thank you in advance.
AG

0 Kudos
Hubert_H_Intel
Employee
911 Views
Sorry, my mistake. I didn't pay attention thatyou submitted this inthe Fortran Forum.
I'll investigate on this.
Hubert.
0 Kudos
Hubert_H_Intel
Employee
912 Views
Yes, in the command line and GUI command window changing a character value is not supported, but you can change it on the Evaluations window. Just right-click on the value, select Set Value and enter either the ASCII code (e.g.) 66 or 'B' to change the value.
0 Kudos
Reply