[Pdbg] [PATCH 10/10] pdbg: Make return codes consistent for get/put registers

Rashmica Gupta rashmica.g at gmail.com
Thu May 31 15:29:15 AEST 2018


---
 src/main.c | 2 +-
 src/reg.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index e714377..3df9a4e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -739,7 +739,7 @@ int main(int argc, char *argv[])
 	return 1;
 
 found_action:
-	if (rc <= 0) {
+	if (rc != 0) {
                 printf("No valid targets found or specified. Try adding -p/-c/-t options to specify a target.\n");
                 printf("Alternatively run '%s -a probe' to get a list of all valid targets\n",
 		       basename(argv[0]));
diff --git a/src/reg.c b/src/reg.c
index 0a87006..e58275f 100644
--- a/src/reg.c
+++ b/src/reg.c
@@ -103,7 +103,7 @@ static int getprocreg(struct pdbg_target *target, uint32_t index, uint64_t *reg,
 
 	print_proc_reg(target, *reg, value, rc);
 
-	return !rc;
+	return rc;
 }
 
 int handle_gpr(int optind, int argc, char *argv[])
-- 
2.14.3



More information about the Pdbg mailing list