Author Topic: Debugger variable display issues on macOS  (Read 104 times)

rjpontefract

  • Senior Community Member
  • Posts: 193
  • Hero Points: 7
Debugger variable display issues on macOS
« on: January 09, 2023, 04:42:18 am »
I'm using SE 27.0.1.0 on an m1 Mac and am having problems with the debugger and the way it displays variables.

When debugging the following code:
Code: [Select]
void arm_exec()
{
        uint32_t opcode,templ,templ2,mask,addr,addr2;
        int c;
        while (tubecycles>0)
        {
                opcode=opcode2;
                opcode2=opcode3;
                opcode3=readarml(PC);
                if (arm_debug_enabled)

Under Locals, opcode, templ, templ2, addr and addr2 all have the correct type of unsigned but all have a displayed value of 0 which is incorrect.

Under Autos, opcode has a type of void and a value of void which is also incorrect.

opcode2 and opcode3 which are defined as:

Code: [Select]
static uint32_t opcode2,opcode3;
Are show under Autos as unsigned with the correct values, but I'm not sure why they're displayed under Autos as they're static globals and not local to the arm_exec() stack frame.

If I "go to definition" for opcode, SE shows the correct definition as above.

If I then add a watch for opcode, the watches window also shows it as type void with a value of void.

I tried the same thing on an Intel Linux host and opcode is displayed correctly in autos, locals and a watch.

Is this due to using lldb on the Mac and gdb on Linux?   How do I get the Mac version to show me the correct type for opcode?  And how do I get SE to show the correct values in the locals windows?

Let me know what other information you need and I'll do my best to get for you.

rjpontefract

  • Senior Community Member
  • Posts: 193
  • Hero Points: 7
Re: Debugger variable display issues on macOS
« Reply #1 on: January 09, 2023, 06:35:32 am »
Doh!  I'm going to have to admit that I missed a -O2 hidden in the Makefile :-(
I guess those variables had been elided by the optimiser.