HSAFoundation / HSAIL-Instruction-Set-Simulator

HSAIL Instruction Set Simulator - for testing execution of HSAIL Brig files
Other
36 stars 9 forks source link

Variables having different scope but with the same name aren't distinguished #14

Closed vvenkata closed 10 years ago

vvenkata commented 10 years ago

When the HSAIL code being simulated uses variables with the same name but in different scopes, the output of "info locals" command doesn't distinguish between the two scopes. Here's an example gdb trace (from the fib example) that illustrates this: For brevity I've just displayed the relevant part of the output that shows the local variables res and nm2 repeated.

GNU gdb (GDB) 7.5-ubuntu Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/tester/mcwsimtesting/Okra-Interface-to-HSAIL-Simulator/sim/hsail2brig/build_linux/fib...done. (gdb) break fib Function "fib" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (fib) pending. (gdb) run Starting program: /home/tester/mcwsimtesting/Okra-Interface-to-HSAIL-Simulator/sim/hsail2brig/build_linux/fib [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Fib sequence: [New Thread 0x7ffff6bcd700 (LWP 3602)] [Switching to Thread 0x7ffff6bcd700 (LWP 3602)] Breakpoint 1, fib (r=@0x7ffff6bcc83c: 0, n=@0x7ffff6bcc838: 1) at /home/tester/mcwsimtesting/Okra-Interface-to-HSAIL-Simulator/sim/hsail2brig/test/fib.hsail:16 (gdb) n (gdb) n (gdb) info locals p = 0 spillvar = 0 rovar = 0 globalvar = 0 nm2 = 0 res = 0 nm2 = 0 res = 0

tjablin commented 10 years ago

Fixed in 79b239fa87ac3aaa0a83ab4de76069b09068f26b.