From f628d9051f6cf28e0e1f21187289f9870c9bc6e7 Mon Sep 17 00:00:00 2001 From: mudlord Date: Thu, 6 Dec 2007 02:48:03 +0000 Subject: [PATCH] Changed SDL debugger a little git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@165 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/sdl/debugger.cpp | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/sdl/debugger.cpp b/src/sdl/debugger.cpp index d419402e..26b62bd6 100644 --- a/src/sdl/debugger.cpp +++ b/src/sdl/debugger.cpp @@ -435,12 +435,17 @@ static void debuggerPrintMember(Function *f, int off = m->bitOffset; int size = m->byteSize; u32 v = 0; - if(size == 1) + switch(size){ + case 1: v = debuggerReadByte(location); - else if(size == 2) - v = debuggerReadHalfWord(location); - else if(size == 4) - v = debuggerReadMemory(location); + break; + case 2: + v = debuggerReadHalfWord(location); + break; + default: + v = debuggerReadMemory(location); + break; + } while(bitSize) { int top = size*8 - off; @@ -454,12 +459,17 @@ static void debuggerPrintMember(Function *f, bitSize -= (top+1); location -= size; off = 0; - if(size == 1) - v = debuggerReadByte(location); - else if(size == 2) - v = debuggerReadHalfWord(location); - else - v = debuggerReadMemory(location); + switch(size){ + case 1: + v = debuggerReadByte(location); + break; + case 2: + v = debuggerReadHalfWord(location); + break; + default: + v = debuggerReadMemory(location); + break; + } } } debuggerPrintBaseType(m->type, value, location, LOCATION_memory,