aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.h
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2020-11-15 03:10:52 -0500
committerJoel Brobecker <brobecker@adacore.com>2020-11-15 03:10:52 -0500
commite55c6530dbf96bfbe2e4a232c0feb19c0a4a2294 (patch)
tree2924eba4d072b23919374e31ef15ac42b0e8024b /gdb/utils.h
parentb34c74ab9a6b8dc0ace3d0cc67bf62de8a74ea00 (diff)
downloadgdb-e55c6530dbf96bfbe2e4a232c0feb19c0a4a2294.zip
gdb-e55c6530dbf96bfbe2e4a232c0feb19c0a4a2294.tar.gz
gdb-e55c6530dbf96bfbe2e4a232c0feb19c0a4a2294.tar.bz2
Move uinteger_pow gdb/valarith.c to gdb/utils.c and make it public
This is a generic function which I would like to use in a followup patch adding support for fixed-point types. So this commit moves it out of valarith.c into util.c, and makes it non-static. gdb/ChangeLog: * utils.h (uinteger_pow): Add declaration. * utils.c (uinteger_pow): Moved here (without changes)... * valarith.c (uinteger_pow): ... from here.
Diffstat (limited to 'gdb/utils.h')
-rw-r--r--gdb/utils.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/utils.h b/gdb/utils.h
index 6948908..a8c65ed 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -593,6 +593,13 @@ extern pid_t wait_to_die_with_timeout (pid_t pid, int *status, int timeout);
extern int myread (int, char *, int);
+/* Integer exponentiation: Return V1**V2, where both arguments
+ are integers.
+
+ Requires V1 != 0 if V2 < 0.
+ Returns 1 for 0 ** 0. */
+extern ULONGEST uinteger_pow (ULONGEST v1, LONGEST v2);
+
/* Resource limits used by getrlimit and setrlimit. */
enum resource_limit_kind