The parser's debug log is missing a few line breaks as well as some
crucial information, like control register dumps.

Add them for read- and debugability.

Signed-off-by: Mathias Krause <mini...@grsecurity.net>
---
 vmware_vmss.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/vmware_vmss.c b/vmware_vmss.c
index 11b7b72bf503..2eee36c3daec 100644
--- a/vmware_vmss.c
+++ b/vmware_vmss.c
@@ -175,8 +175,10 @@ vmware_vmss_init(char *filename, FILE *ofp)
                                }
                                DEBUG_PARSE_PRINT((ofp, "[%d]", idx[j]));
                        }
-                      if (nextgroup)
+                       if (nextgroup) {
+                               DEBUG_PARSE_PRINT((ofp, "\n"));
                                break;
+                       }
 
                        if (IS_BLOCK_TAG(tag)) {
                                uint64_t nbytes;
@@ -232,16 +234,21 @@ vmware_vmss_init(char *filename, FILE *ofp)
                                                      filename, errno, 
strerror(errno));
                                                break;
                                        }
+                                       DEBUG_PARSE_PRINT((ofp, "\n"));
                                        vmss.vcpu_regs[cpu] |= 
REGS_PRESENT_GPREGS;
                                } else if (strcmp(name, "CR64") == 0 &&
                                           nbytes == VMW_CR64_SIZE &&
                                           idx[0] < vmss.num_vcpus) {
                                        int cpu = idx[0];
+                                       DEBUG_PARSE_PRINT((ofp, "\t=> "));
                                        if (fread(&vmss.regs64[cpu]->cr[0], 
VMW_CR64_SIZE, 1, fp) != 1) {
                                                error(INFO, LOGPRX"Failed to 
read '%s': [Error %d] %s\n",
                                                      filename, errno, 
strerror(errno));
                                                break;
                                        }
+                                       for (j = 0; j < VMW_CR64_SIZE / 8; j++)
+                                               DEBUG_PARSE_PRINT((ofp, 
"%s%016llX", j ? " " : "", vmss.regs64[cpu]->cr[j]));
+                                       DEBUG_PARSE_PRINT((ofp, "\n"));
                                        vmss.vcpu_regs[cpu] |= REGS_PRESENT_CRS;
                                } else if (strcmp(name, "IDTR") == 0 &&
                                           nbytes == VMW_IDTR_SIZE &&
@@ -258,6 +265,7 @@ vmware_vmss_init(char *filename, FILE *ofp)
                                                      filename, errno, 
strerror(errno));
                                                break;
                                        }
+                                       DEBUG_PARSE_PRINT((ofp, "\n"));
                                        vmss.regs64[cpu]->idtr = idtr;
                                        vmss.vcpu_regs[cpu] |= 
REGS_PRESENT_IDTR;
                                } else {
@@ -266,6 +274,7 @@ vmware_vmss_init(char *filename, FILE *ofp)
                                                      (ulonglong)(blockpos + 
nbytes));
                                                break;
                                        }
+                                       DEBUG_PARSE_PRINT((ofp, "\n"));
                                }
                        } else {
                                union {
-- 
2.20.1


--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Reply via email to