Patch #1869 2007-02-02 15:43

domen

added or32/ba on linux support (before only for windows)
Download
1869-added_or32_ba.patch (4.1 KB)
Category
Plugin::Refinement
Status
Out of date
Close date
2013-10-01 20:41
Assigned to
tpetrov
diff -urN src/plugins/debuggergdb/gdb_commands.h src/plugins/debuggergdb/gdb_commands.h
--- src/plugins/debuggergdb/gdb_commands.h    2007-02-02 16:40:17.000000000 +0100
+++ src/plugins/debuggergdb/gdb_commands.h    2007-02-02 16:40:05.000000000 +0100
@@ -130,8 +130,8 @@
 //  ebx at 0x22ff6c, ebp at 0x22ff78, esi at 0x22ff70, edi at 0x22ff74, eip at 0x22ff7c
 static wxRegEx reDisassemblyInit(_T("^Stack level [0-9]+, frame at (0x[A-Fa-f0-9]+):"));
 static wxRegEx reDisassemblyInitFunc(_T("eip = (0x[A-Fa-f0-9]+) in ([^;]*)"));
-// or32 variant
-#ifdef __WXMSW__
+// or32/ba variant
+#if (defined(__WXMSW__) || defined(__LINUX__))
 static wxRegEx reDisassemblyInitFuncOR32(_T("PC = (0x[A-Fa-f0-9]+) in ([^;]*)"));
 #endif
 //    Using the running image of child Thread 46912568064384 (LWP 7051).
@@ -932,8 +932,9 @@
 
     public:
         /** @param dlg The disassembly dialog. */
-#ifdef __WXMSW__
+#if (defined(__WXMSW__) || defined(__LINUX__))
         // only tested on mingw/pc/win env
+        // tested allso on gcc/pc/linux env
         GdbCmd_InfoRegisters(DebuggerDriver* driver, CPURegistersDlg* dlg, wxString disassemblyFlavor)
 #else
         GdbCmd_InfoRegisters(DebuggerDriver* driver, CPURegistersDlg* dlg)
@@ -942,7 +943,7 @@
             m_pDlg(dlg)
         {
             m_Cmd << _T("info registers");
-#ifdef __WXMSW__
+#if (defined(__WXMSW__) || defined(__LINUX__))
             m_disassemblyFlavor = disassemblyFlavor;
 #endif
         }
@@ -969,8 +970,9 @@
 
             if (!m_pDlg)
                 return;
-            // or32 register string parser
-            if(m_disassemblyFlavor == _T("set disassembly-flavor or32"))
+            // or32/ba register string parser
+            if((m_disassemblyFlavor == _T("set disassembly-flavor or32")) ||
+              (m_disassemblyFlavor == _T("set disassembly-flavor ba")))
             {
                 ParseOutputFromOR32gdbPort(output);
             }
@@ -1106,14 +1108,15 @@
 class GdbCmd_DisassemblyInit : public DebuggerCmd
 {
         DisassemblyDlg* m_pDlg;
-#ifdef __WXMSW__
+#if (defined(__WXMSW__) || defined(__LINUX__))
         wxString m_disassemblyFlavor;
 #endif
     public:
         static wxString LastAddr;
         /** @param dlg The disassembly dialog. */
-#ifdef __WXMSW__
+#if (defined(__WXMSW__) || defined(__LINUX__))
         // only tested on mingw/pc/win env
+        // also tested on gcc/pc/linux env
         GdbCmd_DisassemblyInit(DebuggerDriver* driver, DisassemblyDlg* dlg, wxString disassemblyFlavor)
 #else
         GdbCmd_DisassemblyInit(DebuggerDriver* driver, DisassemblyDlg* dlg)
@@ -1122,7 +1125,7 @@
             m_pDlg(dlg)
         {
             m_Cmd << _T("info frame");
-#ifdef __WXMSW__
+#if (defined(__WXMSW__) || defined(__LINUX__))
             m_disassemblyFlavor = disassemblyFlavor;
 #endif
         }
@@ -1145,8 +1148,9 @@
                     sf.function = reDisassemblyInitFunc.GetMatch(output, 2);
                     long int active;
 
-#ifdef __WXMSW__
-                    if(m_disassemblyFlavor == _T("set disassembly-flavor or32"))
+#if (defined(__WXMSW__) || defined(__LINUX__))
+                    if((m_disassemblyFlavor == _T("set disassembly-flavor or32")) ||
+                       (m_disassemblyFlavor == _T("set disassembly-flavor ba")))
                     {
                         reDisassemblyInitFuncOR32.GetMatch(output, 1).ToLong(&active, 16);
                     }
diff -urN src/plugins/debuggergdb/gdb_driver.cpp src/plugins/debuggergdb/gdb_driver.cpp
--- src/plugins/debuggergdb/gdb_driver.cpp    2007-02-02 16:40:17.000000000 +0100
+++ src/plugins/debuggergdb/gdb_driver.cpp    2007-02-02 16:39:45.000000000 +0100
@@ -440,7 +440,7 @@
 {
     if (!m_pDisassembly)
         return;
-#ifdef __WXMSW__
+#if (defined(__WXMSW__) || defined(__LINUX__))
     QueueCommand(new GdbCmd_DisassemblyInit(this, m_pDisassembly, flavour));
 #else
     QueueCommand(new GdbCmd_DisassemblyInit(this, m_pDisassembly));
@@ -451,7 +451,7 @@
 {
     if (!m_pCPURegisters)
         return;
-#ifdef __WXMSW__
+#if (defined(__WXMSW__) || defined(__LINUX__))
     QueueCommand(new GdbCmd_InfoRegisters(this, m_pCPURegisters, flavour));
 #else
     QueueCommand(new GdbCmd_InfoRegisters(this, m_pCPURegisters));
mandrav 2007-04-12 13:18

ok, what are or32 and ba flavors? And what gdb version supports them?

domen 2007-04-12 15:21

The gdb that suports them is a costum patched gdb.

As far as I can remember the difference is only in gegister layout and not in disassembly. I have only added the extension to that code that has alredy been added before.

I don't know when it was posted and howcome this hack was accepted.

ba is a newer version of or32 processor.

I don't work for the company that wanted to have this anymore so I can't provide you with the details but I think that this code should be changed entirely (the old or32 part too) and insteed something to switch between the register output or amd/intel and Mips/or32/ba type.

You will have to ask about the or32 code that has alredy been added the one who added it and as I sayed I was surprised as I have seen that code.

tpetrov 2013-10-01 20:41

Resubmit against trunk if still interested.