diff mbox series

[02/19] libpdbg: Print the name of the instruction when erroring

Message ID 20180829015047.7355-3-rashmica.g@gmail.com
State Superseded
Headers show
Series Basic gdbserver for POWER8 | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Rashmica Gupta Aug. 29, 2018, 1:50 a.m. UTC
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
---
 libpdbg/chip.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libpdbg/chip.c b/libpdbg/chip.c
index 80a2261..1c5080e 100644
--- a/libpdbg/chip.c
+++ b/libpdbg/chip.c
@@ -29,7 +29,7 @@ 
 static uint64_t mfspr(uint64_t reg, uint64_t spr)
 {
 	if (reg > 31)
-		PR_ERROR("Invalid register specified\n");
+		PR_ERROR("Invalid register specified for mfspr\n");
 
 	return MFSPR_OPCODE | (reg << 21) | ((spr & 0x1f) << 16) | ((spr & 0x3e0) << 6);
 }
@@ -37,7 +37,7 @@  static uint64_t mfspr(uint64_t reg, uint64_t spr)
 static uint64_t mtspr(uint64_t spr, uint64_t reg)
 {
 	if (reg > 31)
-		PR_ERROR("Invalid register specified\n");
+		PR_ERROR("Invalid register specified for mtspr\n");
 
 	return MTSPR_OPCODE | (reg << 21) | ((spr & 0x1f) << 16) | ((spr & 0x3e0) << 6);
 }
@@ -45,9 +45,9 @@  static uint64_t mtspr(uint64_t spr, uint64_t reg)
 static uint64_t mfocrf(uint64_t reg, uint64_t cr)
 {
 	if (reg > 31)
-		PR_ERROR("Invalid register specified\n");
+		PR_ERROR("Invalid register specified for mfocrf\n");
 	if (cr > 7)
-		PR_ERROR("Invalid register specified\n");
+		PR_ERROR("Invalid CR field specified\n");
 
 	return MFOCRF_OPCODE | (reg << 21) | (1U << (12 + cr));
 }
@@ -55,7 +55,7 @@  static uint64_t mfocrf(uint64_t reg, uint64_t cr)
 static uint64_t mfnia(uint64_t reg)
 {
 	if (reg > 31)
-		PR_ERROR("Invalid register specified\n");
+		PR_ERROR("Invalid register specified for mfnia\n");
 
 	return MFNIA_OPCODE | (reg << 21);
 }
@@ -63,7 +63,7 @@  static uint64_t mfnia(uint64_t reg)
 static uint64_t mtnia(uint64_t reg)
 {
 	if (reg > 31)
-		PR_ERROR("Invalid register specified\n");
+		PR_ERROR("Invalid register specified for mtnia\n");
 
 	return MTNIA_OPCODE | (reg << 21);
 }
@@ -71,7 +71,7 @@  static uint64_t mtnia(uint64_t reg)
 static uint64_t mfmsr(uint64_t reg)
 {
 	if (reg > 31)
-		PR_ERROR("Invalid register specified\n");
+		PR_ERROR("Invalid register specified for mfmsr\n");
 
 	return MFMSR_OPCODE | (reg << 21);
 }
@@ -79,7 +79,7 @@  static uint64_t mfmsr(uint64_t reg)
 static uint64_t mtmsr(uint64_t reg)
 {
 	if (reg > 31)
-		PR_ERROR("Invalid register specified\n");
+		PR_ERROR("Invalid register specified for mtmsr\n");
 
 	return MTMSR_OPCODE | (reg << 21);
 }