aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-04-13 17:38:53 +0200
committerTom de Vries <tdevries@suse.de>2021-04-13 17:38:53 +0200
commit329534fda79702d50374304d1b724bc0b83a9421 (patch)
treef654b12c470243c665fdc3439b334842d31a7781 /gdb
parentd9d2ef05f11736bf2e889047cc7588d0c0dd907e (diff)
downloadfsf-binutils-gdb-329534fda79702d50374304d1b724bc0b83a9421.zip
fsf-binutils-gdb-329534fda79702d50374304d1b724bc0b83a9421.tar.gz
fsf-binutils-gdb-329534fda79702d50374304d1b724bc0b83a9421.tar.bz2
[gdb] Fix regoff_t incompatibility
I did an experiment with importing the regex module in gnulib, and trying to build gdb. The first problem I ran into was that: - regoff_t was defined as long int, and - the address of a regoff_t variable i in ui_file_style::parse was passed as int * to function extended_color. Fix this by changing the types of some function parameters of functions read_semi_number and extended_color from int * to regoff_t *. Tested on x86_64-linux. gdb/ChangeLog: 2021-04-13 Tom de Vries <tdevries@suse.de> * ui-style.c (read_semi_number, extended_color): Change idx parameter type to regoff_t *.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ui-style.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d738f55..49783c4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-13 Tom de Vries <tdevries@suse.de>
+
+ * ui-style.c (read_semi_number, extended_color): Change idx parameter
+ type to regoff_t *.
+
2021-04-13 Luis Machado <luis.machado@linaro.org>
* rs6000-tdep.c (ppc_displaced_step_fixup): Use %s to print
diff --git a/gdb/ui-style.c b/gdb/ui-style.c
index 7deb4ac..2fda9d1 100644
--- a/gdb/ui-style.c
+++ b/gdb/ui-style.c
@@ -169,7 +169,7 @@ ui_file_style::to_ansi () const
characters read and put the number into *NUM. */
static bool
-read_semi_number (const char *string, int *idx, long *num)
+read_semi_number (const char *string, regoff_t *idx, long *num)
{
if (string[*idx] != ';')
return false;
@@ -186,7 +186,7 @@ read_semi_number (const char *string, int *idx, long *num)
sequence; that is, and 8- or 24- bit color. */
static bool
-extended_color (const char *str, int *idx, ui_file_style::color *color)
+extended_color (const char *str, regoff_t *idx, ui_file_style::color *color)
{
long value;