aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/psim.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-10-11 15:02:08 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-10-12 10:37:00 +0100
commit182421c9d2eea8c4877d983a2124e591f0aca710 (patch)
treee5fa104849987288045a1c6ec89bab2cab0f946f /sim/ppc/psim.c
parent33fb3d6f140b03062b6bce2065a44b3c8a42ba62 (diff)
downloadgdb-182421c9d2eea8c4877d983a2124e591f0aca710.zip
gdb-182421c9d2eea8c4877d983a2124e591f0aca710.tar.gz
gdb-182421c9d2eea8c4877d983a2124e591f0aca710.tar.bz2
sim/ppc: fixes for arguments to printf style functions
After the recent series of fixes to mark more functions in the simulator with ATTRIBUTE_PRINTF, there were some build failures in the ppc sim due, in some cases, to bugs with the arguments being passed, and in other cases, the issues were (maybe) less serious, with arguments being the wrong size, or type, for the printf format being used. This commit fixes all of the issues that I ran into. In each case I selected the easiest solution to the problem, which is usually just casting the argument to the correct type. If anyone later on thinks the print format should change, please feel free to do that. What we have here should keep the simulator basically working as it does currently, which is my goal with this commit.
Diffstat (limited to 'sim/ppc/psim.c')
-rw-r--r--sim/ppc/psim.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c
index 9f1db67..acc40ed 100644
--- a/sim/ppc/psim.c
+++ b/sim/ppc/psim.c
@@ -99,7 +99,7 @@ find_arg(const char *err_msg,
{
*ptr_to_argp += 1;
if (argv[*ptr_to_argp] == NULL)
- error(err_msg);
+ error("%s", err_msg);
return argv[*ptr_to_argp];
}
@@ -535,7 +535,7 @@ psim_create(const char *file_name,
if (ppc_trace[trace_print_device_tree] || ppc_trace[trace_dump_device_tree])
tree_print(root);
if (ppc_trace[trace_dump_device_tree])
- error("");
+ error("%s", "");
return system;
}
@@ -1186,7 +1186,7 @@ psim_merge_device_file(device *root,
/* append the next line */
if (!fgets(device_path + curlen, sizeof(device_path) - curlen, description)) {
fclose(description);
- error("%s:%s: unexpected eof in line continuation - %s",
+ error("%s:%d: unexpected eof in line continuation - %s",
file_name, line_nr, device_path);
}
if (strchr(device_path, '\n') == NULL) {