Author: jhibbits
Date: Fri Dec 16 04:47:29 2016
New Revision: 310150
URL: https://svnweb.freebsd.org/changeset/base/310150

Log:
  Fix disassembly by adding back some deleted lines.
  
  When importing for r309309, as part of conflict resolution, too much extra was
  removed, resulting in bad disassembly for branches.  Correct this.
  
  Also re-apply the 0->NULL change from r298052.
  
  X-MFC-With:   r309309

Modified:
  head/sys/powerpc/powerpc/db_disasm.c

Modified: head/sys/powerpc/powerpc/db_disasm.c
==============================================================================
--- head/sys/powerpc/powerpc/db_disasm.c        Fri Dec 16 04:44:46 2016        
(r310149)
+++ head/sys/powerpc/powerpc/db_disasm.c        Fri Dec 16 04:47:29 2016        
(r310150)
@@ -871,8 +871,11 @@ disasm_fields(const struct opcode *popco
                func &= ~Op_crbB;
        }
        if (func & Op_LI) {
-               u_int LI;
+               int LI;
                LI = extract_field(instr, 31 - 29, 24);
+               LI = LI << 8;
+               LI = LI >> 6;
+               LI += loc;
                APP_PSTR("0x%x", LI);
                func &= ~Op_LI;
        }
@@ -897,8 +900,11 @@ disasm_fields(const struct opcode *popco
                ;
        }
        if (func & Op_BD) {
-               u_int BD;
+               int BD;
                BD = extract_field(instr, 31 - 29, 14);
+               BD = BD << 18;
+               BD = BD >> 16;
+               BD += loc;
                /* Need to sign extend and shift up 2, then add addr */
                APP_PSTR("0x%x", BD);
                func &= ~Op_BD;
@@ -968,9 +974,9 @@ disasm_fields(const struct opcode *popco
                        reg = "tbu";
                        break;
                default:
-                       reg = 0;
+                       reg = NULL;
                }
-               if (reg == 0)
+               if (reg == NULL)
                        APP_PSTR(", [unknown tbr %d ]", tbr);
                else
                        APP_PSTR(", %s", reg);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to