Community
Participate
Working Groups
When using the TCF agent compiled with the latest commit from master on Linux, the address of some variables is evaluated to an address that cannot be read. The issue can be reproduced with the following example C code: int times_2(int * num){ return (*num)*2; } int main() { while(1){ int i_1 = 2; int i_2 = 3; int i_3 = 4; volatile unsigned int a[3] = {times_2(&i_1), times_2(&i_2), times_2(&i_3)}; volatile int b = 0; } return 0; } The variables inside the while loop show as "N/A - Cannot read target memory. Input/output error". The addresses of the variables are calculated as follows: i_1 Address: 0xffffffffffffffc0 i_2 Address: 0xffffffffffffffc4 i_3 Address: 0xffffffffffffffc8 a Address: 0xffffffffffffffd0 b Address: 0xffffffffffffffcc While evaluating expressions like "&a[0]" or "&b", the resulting address is the same. On a separate note, the stack shows only one frame. The issue seemed to show up after merging the commit https://git.eclipse.org/c/tcf/org.eclipse.tcf.agent.git/commit/?id=4443aa3df7df5591274b25c7c1868b7a9574be9a . When building the agent with that commit, the addresses and variables are calculated correctly in both the Variables and the Expressions views. The stack shows three frames. The example C code was compiled with the following command: gcc my_app.c -g -Og -o my_app.
It is caused by regression in stack trace. Fixed. Thanks!