Linux build fixes
[clinton/Virtual-Jaguar-Rx.git] / src / debugger / DBGManager.cpp
index d86ecf9..0dec2c0 100644 (file)
@@ -13,6 +13,7 @@
 // JPM  09/15/2018  Support the unsigned char\r
 // JPM   Oct./2018  Cosmetic changes, added source file search paths, and ELF function name\r
 // JPM   Aug./2019  Added new functions mainly for source text lines\r
+// JPM  Sept./2019  Support the unsigned/signed short type\r
 //\r
 \r
 // To Do\r
 #include <stdlib.h>\r
 #include <string.h>\r
 #include <stdint.h>\r
-#include "libelf/libelf.h"\r
-#include "libelf/gelf.h"\r
+#include "libelf.h"\r
+#include "gelf.h"\r
 #include "log.h"\r
 #include "ELFManager.h"\r
-#include "DwarfManager.h"\r
+#include "DWARFManager.h"\r
 #include "DBGManager.h"\r
 #include "HWLABELManager.h"\r
 #include "settings.h"\r
@@ -44,8 +45,10 @@ struct Value
                bool B;\r
                double D;\r
                float F;\r
+               int16_t SS;\r
                int32_t SI;\r
                int64_t SL;\r
+               uint16_t US;\r
                uint32_t UI;\r
                uint64_t UL;\r
        };\r
@@ -211,11 +214,11 @@ size_t DBGManager_GetType(void)
 \r
 // Get source filename based on the memeory address\r
 // return NULL if no source filename\r
-char *DBGManager_GetFullSourceFilenameFromAdr(size_t Adr, bool *Error)\r
+char *DBGManager_GetFullSourceFilenameFromAdr(size_t Adr, DBGstatus *Status)\r
 {\r
        if ((DBGType & DBG_ELFDWARF))\r
        {\r
-               return DWARFManager_GetFullSourceFilenameFromAdr(Adr, Error);\r
+               return DWARFManager_GetFullSourceFilenameFromAdr(Adr, (DWARFstatus *)Status);\r
        }\r
        else\r
        {\r
@@ -504,6 +507,10 @@ char *DBGManager_GetVariableValueFromAdr(size_t Adr, size_t TypeEncoding, size_t
                case DBG_ATE_signed:\r
                        switch (TypeByteSize)\r
                        {\r
+                       case 2:\r
+                               sprintf(value, "%i", V.SS);\r
+                               break;\r
+\r
                        case 4:\r
                                sprintf(value, "%i", V.SI);\r
                                break;\r
@@ -523,6 +530,10 @@ char *DBGManager_GetVariableValueFromAdr(size_t Adr, size_t TypeEncoding, size_t
                case DBG_ATE_unsigned:\r
                        switch (TypeByteSize)\r
                        {\r
+                       case 2:\r
+                               sprintf(value, "%u", V.US);\r
+                               break;\r
+\r
                        case 4:\r
                                sprintf(value, "%u", V.UI);\r
                                break;\r
@@ -537,7 +548,7 @@ char *DBGManager_GetVariableValueFromAdr(size_t Adr, size_t TypeEncoding, size_t
                        break;\r
 \r
                case DBG_ATE_unsigned_char:\r
-                       sprintf(value, "%u", (unsigned int(V.C)));\r
+                       sprintf(value, "%u", (unsigned int) V.C);\r
                        break;\r
 \r
                case DBG_ATE_ptr:\r