gdb/warn.patch

634 lines
22 KiB
Diff
Raw Normal View History

--- gdb/remote.c
+++ gdb/remote.c
@@ -966,8 +966,8 @@
static int use_threadextra_query;
/* Tokens for use by the asynchronous signal handlers for SIGINT. */
-static void *sigint_remote_twice_token;
-static void *sigint_remote_token;
+static struct async_signal_handler *sigint_remote_twice_token;
+static struct async_signal_handler *sigint_remote_token;
/* These are pointers to hook functions that may be set in order to
modify resume/wait behavior for a particular architecture. */
@@ -2843,11 +2843,9 @@
{
signal (SIGINT, handle_sigint);
if (sigint_remote_twice_token)
- delete_async_signal_handler ((struct async_signal_handler **)
- &sigint_remote_twice_token);
+ delete_async_signal_handler (&sigint_remote_twice_token);
if (sigint_remote_token)
- delete_async_signal_handler ((struct async_signal_handler **)
- &sigint_remote_token);
+ delete_async_signal_handler (&sigint_remote_token);
}
/* Send ^C to target to halt it. Target will respond, and send us a
--- gdb/tui/tui-layout.c
+++ gdb/tui/tui-layout.c
@@ -47,7 +47,7 @@
********************************/
static void show_layout (enum tui_layout_type);
static void init_gen_win_info (struct tui_gen_win_info *, enum tui_win_type, int, int, int, int);
-static void init_and_make_win (void **, enum tui_win_type, int, int, int, int, int);
+static void init_and_make_win (struct tui_gen_win_info **, enum tui_win_type, int, int, int, int, int);
static void show_source_or_disasm_and_command (enum tui_layout_type);
static void make_source_or_disasm_window (struct tui_win_info * *, enum tui_win_type, int, int);
static void make_command_window (struct tui_win_info * *, int, int);
@@ -640,13 +640,13 @@
static void
make_command_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
{
- init_and_make_win ((void **) win_info_ptr,
- CMD_WIN,
- height,
- tui_term_width (),
- 0,
- origin_y,
- DONT_BOX_WINDOW);
+ init_and_make_win ((struct tui_gen_win_info **) win_info_ptr,
+ CMD_WIN,
+ height,
+ tui_term_width (),
+ 0,
+ origin_y,
+ DONT_BOX_WINDOW);
(*win_info_ptr)->can_highlight = FALSE;
}
@@ -679,13 +679,13 @@
static void
make_data_window (struct tui_win_info * * win_info_ptr, int height, int origin_y)
{
- init_and_make_win ((void **) win_info_ptr,
- DATA_WIN,
- height,
- tui_term_width (),
- 0,
- origin_y,
- BOX_WINDOW);
+ init_and_make_win ((struct tui_gen_win_info **) win_info_ptr,
+ DATA_WIN,
+ height,
+ tui_term_width (),
+ 0,
+ origin_y,
+ BOX_WINDOW);
}
@@ -751,13 +751,13 @@
if (TUI_DISASM_WIN == NULL)
{
make_disasm_window (&TUI_DISASM_WIN, asm_height, src_height - 1);
- init_and_make_win ((void **) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- tui_term_width (),
- 0,
- (src_height + asm_height) - 1,
- DONT_BOX_WINDOW);
+ init_and_make_win (&locator,
+ LOCATOR_WIN,
+ 2 /* 1 */ ,
+ tui_term_width (),
+ 0,
+ (src_height + asm_height) - 1,
+ DONT_BOX_WINDOW);
}
else
{
@@ -844,13 +844,13 @@
make_source_window (&tui_win_list[win_type], src_height, data_height - 1);
else
make_disasm_window (&tui_win_list[win_type], src_height, data_height - 1);
- init_and_make_win ((void **) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- tui_term_width (),
- 0,
- total_height - 1,
- DONT_BOX_WINDOW);
+ init_and_make_win (&locator,
+ LOCATOR_WIN,
+ 2 /* 1 */ ,
+ tui_term_width (),
+ 0,
+ total_height - 1,
+ DONT_BOX_WINDOW);
}
else
{
@@ -912,37 +912,25 @@
** init_and_make_win().
*/
static void
-init_and_make_win (void ** win_info_ptr, enum tui_win_type win_type,
- int height, int width, int origin_x, int origin_y, int box_it)
+init_and_make_win (struct tui_gen_win_info **win_info_ptr,
+ enum tui_win_type win_type, int height, int width,
+ int origin_x, int origin_y, int box_it)
{
- void *opaque_win_info = *win_info_ptr;
- struct tui_gen_win_info * generic;
+ struct tui_gen_win_info *generic = *win_info_ptr;
- if (opaque_win_info == NULL)
+ if (generic == NULL)
{
if (tui_win_is_auxillary (win_type))
- opaque_win_info = (void *) tui_alloc_generic_win_info ();
+ generic = tui_alloc_generic_win_info ();
else
- opaque_win_info = (void *) tui_alloc_win_info (win_type);
- }
- if (tui_win_is_auxillary (win_type))
- generic = (struct tui_gen_win_info *) opaque_win_info;
- else
- generic = &((struct tui_win_info *) opaque_win_info)->generic;
-
- if (opaque_win_info != NULL)
- {
- init_gen_win_info (generic, win_type, height, width, origin_x, origin_y);
- if (!tui_win_is_auxillary (win_type))
- {
- if (generic->type == CMD_WIN)
- ((struct tui_win_info *) opaque_win_info)->can_highlight = FALSE;
- else
- ((struct tui_win_info *) opaque_win_info)->can_highlight = TRUE;
- }
- tui_make_window (generic, box_it);
+ generic = &tui_alloc_win_info (win_type)->generic;
+ *win_info_ptr = generic;
}
- *win_info_ptr = opaque_win_info;
+ init_gen_win_info (generic, win_type, height, width, origin_x, origin_y);
+ if (!tui_win_is_auxillary (win_type))
+ ((struct tui_win_info *) generic)->can_highlight
+ = generic->type != CMD_WIN;
+ tui_make_window (generic, box_it);
}
@@ -959,23 +947,23 @@
execution_info = tui_source_exec_info_win_ptr ();
else
execution_info = tui_disassem_exec_info_win_ptr ();
- init_and_make_win ((void **) & execution_info,
- EXEC_INFO_WIN,
- height,
- 3,
- 0,
- origin_y,
- DONT_BOX_WINDOW);
+ init_and_make_win (&execution_info,
+ EXEC_INFO_WIN,
+ height,
+ 3,
+ 0,
+ origin_y,
+ DONT_BOX_WINDOW);
/*
** Now create the source window.
*/
- init_and_make_win ((void **) win_info_ptr,
- type,
- height,
- tui_term_width () - execution_info->width,
- execution_info->width,
- origin_y,
- BOX_WINDOW);
+ init_and_make_win ((struct tui_gen_win_info **) win_info_ptr,
+ type,
+ height,
+ tui_term_width () - execution_info->width,
+ execution_info->width,
+ origin_y,
+ BOX_WINDOW);
(*win_info_ptr)->detail.source_info.execution_info = execution_info;
}
@@ -1009,13 +997,13 @@
make_source_window (win_info_ptr, src_height - 1, 0);
else
make_disasm_window (win_info_ptr, src_height - 1, 0);
- init_and_make_win ((void **) & locator,
- LOCATOR_WIN,
- 2 /* 1 */ ,
- tui_term_width (),
- 0,
- src_height - 1,
- DONT_BOX_WINDOW);
+ init_and_make_win (&locator,
+ LOCATOR_WIN,
+ 2 /* 1 */ ,
+ tui_term_width (),
+ 0,
+ src_height - 1,
+ DONT_BOX_WINDOW);
}
else
{
--- sim/common/gentmap.c
+++ sim/common/gentmap.c
@@ -2,6 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
struct tdefs {
char *symbol;
--- sim/ppc/debug.c
+++ sim/ppc/debug.c
@@ -29,6 +29,10 @@
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
int ppc_trace[nr_trace_options];
typedef struct _trace_option_descriptor {
--- sim/ppc/ppc-instructions
+++ sim/ppc/ppc-instructions
@@ -3958,7 +3958,7 @@
*603e:PPC_UNIT_FPU, PPC_UNIT_FPU, 2, 4, 0
*604: PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
FPSCR_BEGIN;
- double product; /*HACK! - incorrectly loosing precision ... */
+ union { double d; unsigned64 u; } product; /*HACK! - incorrectly loosing precision ... */
/* compute the multiply */
if (is_invalid_operation(processor, cia,
*frA, *frC,
@@ -3966,7 +3966,7 @@
0, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- (unsigned64*)&product, *frA, 0, *frC,
+ &product.u, *frA, 0, *frC,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -3974,16 +3974,16 @@
}
else {
/*HACK!*/
- product = *(double*)frA * *(double*)frC;
+ product.d = *(double*)frA * *(double*)frC;
}
/* compute the add */
if (is_invalid_operation(processor, cia,
- product, *frB,
+ product.d, *frB,
fpscr_vxsnan | fpscr_vxisi,
0, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- frT, product, *frB, 0,
+ frT, product.d, *frB, 0,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -3991,7 +3991,7 @@
}
else {
/*HACK!*/
- double s = product + *(double*)frB;
+ double s = product.d + *(double*)frB;
*(double*)frT = s;
}
FPSCR_END(Rc);
@@ -4003,7 +4003,7 @@
*603e:PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
*604: PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
FPSCR_BEGIN;
- float product; /*HACK! - incorrectly loosing precision ... */
+ union { float f; unsigned64 u; } product; /*HACK! - incorrectly loosing precision ... */
/* compute the multiply */
if (is_invalid_operation(processor, cia,
*frA, *frC,
@@ -4011,7 +4011,7 @@
1, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- (unsigned64*)&product, *frA, 0, *frC,
+ &product.u, *frA, 0, *frC,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4019,16 +4019,16 @@
}
else {
/*HACK!*/
- product = *(double*)frA * *(double*)frC;
+ product.f = *(double*)frA * *(double*)frC;
}
/* compute the add */
if (is_invalid_operation(processor, cia,
- product, *frB,
+ product.f, *frB,
fpscr_vxsnan | fpscr_vxisi,
1, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- frT, product, *frB, 0,
+ frT, product.f, *frB, 0,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4036,7 +4036,7 @@
}
else {
/*HACK!*/
- float s = product + *(double*)frB;
+ float s = product.f + *(double*)frB;
*(double*)frT = (double)s;
}
FPSCR_END(Rc);
@@ -4048,7 +4048,7 @@
*603e:PPC_UNIT_FPU, PPC_UNIT_FPU, 2, 4, 0
*604: PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
FPSCR_BEGIN;
- double product; /*HACK! - incorrectly loosing precision ... */
+ union { double d; unsigned64 u; } product; /*HACK! - incorrectly loosing precision ... */
/* compute the multiply */
if (is_invalid_operation(processor, cia,
*frA, *frC,
@@ -4056,7 +4056,7 @@
0, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- (unsigned64*)&product, *frA, 0, *frC,
+ &product.u, *frA, 0, *frC,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4064,16 +4064,16 @@
}
else {
/*HACK!*/
- product = *(double*)frA * *(double*)frC;
+ product.d = *(double*)frA * *(double*)frC;
}
/* compute the subtract */
if (is_invalid_operation(processor, cia,
- product, *frB,
+ product.d, *frB,
fpscr_vxsnan | fpscr_vxisi,
0, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- frT, product, *frB, 0,
+ frT, product.d, *frB, 0,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4081,7 +4081,7 @@
}
else {
/*HACK!*/
- double s = product - *(double*)frB;
+ double s = product.d - *(double*)frB;
*(double*)frT = s;
}
FPSCR_END(Rc);
@@ -4093,7 +4093,7 @@
*603e:PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
*604: PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
FPSCR_BEGIN;
- float product; /*HACK! - incorrectly loosing precision ... */
+ union { float f; unsigned64 u; } product; /*HACK! - incorrectly loosing precision ... */
/* compute the multiply */
if (is_invalid_operation(processor, cia,
*frA, *frC,
@@ -4101,7 +4101,7 @@
1, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- (unsigned64*)&product, *frA, 0, *frC,
+ &product.u, *frA, 0, *frC,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4109,16 +4109,16 @@
}
else {
/*HACK!*/
- product = *(double*)frA * *(double*)frC;
+ product.f = *(double*)frA * *(double*)frC;
}
/* compute the subtract */
if (is_invalid_operation(processor, cia,
- product, *frB,
+ product.f, *frB,
fpscr_vxsnan | fpscr_vxisi,
1, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- frT, product, *frB, 0,
+ frT, product.f, *frB, 0,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4126,7 +4126,7 @@
}
else {
/*HACK!*/
- float s = product - *(double*)frB;
+ float s = product.f - *(double*)frB;
*(double*)frT = (double)s;
}
FPSCR_END(Rc);
@@ -4138,7 +4138,7 @@
*603e:PPC_UNIT_FPU, PPC_UNIT_FPU, 2, 4, 0
*604: PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
FPSCR_BEGIN;
- double product; /*HACK! - incorrectly loosing precision ... */
+ union { double d; unsigned64 u; } product; /*HACK! - incorrectly loosing precision ... */
/* compute the multiply */
if (is_invalid_operation(processor, cia,
*frA, *frC,
@@ -4146,7 +4146,7 @@
0, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- (unsigned64*)&product, *frA, 0, *frC,
+ &product.u, *frA, 0, *frC,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4154,16 +4154,16 @@
}
else {
/*HACK!*/
- product = *(double*)frA * *(double*)frC;
+ product.d = *(double*)frA * *(double*)frC;
}
/* compute the add */
if (is_invalid_operation(processor, cia,
- product, *frB,
+ product.d, *frB,
fpscr_vxsnan | fpscr_vxisi,
0, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- frT, product, *frB, 0,
+ frT, product.d, *frB, 0,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4171,7 +4171,7 @@
}
else {
/*HACK!*/
- double s = -(product + *(double*)frB);
+ double s = -(product.d + *(double*)frB);
*(double*)frT = s;
}
FPSCR_END(Rc);
@@ -4183,7 +4183,7 @@
*603e:PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
*604: PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
FPSCR_BEGIN;
- float product; /*HACK! - incorrectly loosing precision ... */
+ union { float f; unsigned64 u; } product; /*HACK! - incorrectly loosing precision ... */
/* compute the multiply */
if (is_invalid_operation(processor, cia,
*frA, *frC,
@@ -4191,7 +4191,7 @@
1, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- (unsigned64*)&product, *frA, 0, *frC,
+ &product.u, *frA, 0, *frC,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4199,16 +4199,16 @@
}
else {
/*HACK!*/
- product = *(double*)frA * *(double*)frC;
+ product.f = *(double*)frA * *(double*)frC;
}
/* compute the add */
if (is_invalid_operation(processor, cia,
- product, *frB,
+ product.f, *frB,
fpscr_vxsnan | fpscr_vxisi,
1, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- frT, product, *frB, 0,
+ frT, product.f, *frB, 0,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4216,7 +4216,7 @@
}
else {
/*HACK!*/
- float s = -(product + *(double*)frB);
+ float s = -(product.f + *(double*)frB);
*(double*)frT = (double)s;
}
FPSCR_END(Rc);
@@ -4228,7 +4228,7 @@
*603e:PPC_UNIT_FPU, PPC_UNIT_FPU, 2, 4, 0
*604: PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
FPSCR_BEGIN;
- double product; /*HACK! - incorrectly loosing precision ... */
+ union { double d; unsigned64 u; } product; /*HACK! - incorrectly loosing precision ... */
/* compute the multiply */
if (is_invalid_operation(processor, cia,
*frA, *frC,
@@ -4236,7 +4236,7 @@
0, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- (unsigned64*)&product, *frA, 0, *frC,
+ &product.u, *frA, 0, *frC,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4244,16 +4244,16 @@
}
else {
/*HACK!*/
- product = *(double*)frA * *(double*)frC;
+ product.d = *(double*)frA * *(double*)frC;
}
/* compute the subtract */
if (is_invalid_operation(processor, cia,
- product, *frB,
+ product.d, *frB,
fpscr_vxsnan | fpscr_vxisi,
0, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- frT, product, *frB, 0,
+ frT, product.d, *frB, 0,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4261,7 +4261,7 @@
}
else {
/*HACK!*/
- double s = -(product - *(double*)frB);
+ double s = -(product.d - *(double*)frB);
*(double*)frT = s;
}
FPSCR_END(Rc);
@@ -4273,7 +4273,7 @@
*603e:PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
*604: PPC_UNIT_FPU, PPC_UNIT_FPU, 1, 3, 0
FPSCR_BEGIN;
- float product; /*HACK! - incorrectly loosing precision ... */
+ union { float f; unsigned64 u; } product; /*HACK! - incorrectly loosing precision ... */
/* compute the multiply */
if (is_invalid_operation(processor, cia,
*frA, *frC,
@@ -4281,7 +4281,7 @@
1, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- (unsigned64*)&product, *frA, 0, *frC,
+ &product.u, *frA, 0, *frC,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4289,16 +4289,16 @@
}
else {
/*HACK!*/
- product = *(double*)frA * *(double*)frC;
+ product.f = *(double*)frA * *(double*)frC;
}
/* compute the subtract */
if (is_invalid_operation(processor, cia,
- product, *frB,
+ product.f, *frB,
fpscr_vxsnan | fpscr_vxisi,
1, /*single?*/
0) /*negate?*/) {
invalid_arithemetic_operation(processor, cia,
- frT, product, *frB, 0,
+ frT, product.f, *frB, 0,
0, /*instruction_is_frsp*/
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
@@ -4306,7 +4306,7 @@
}
else {
/*HACK!*/
- float s = -(product - *(double*)frB);
+ float s = -(product.f - *(double*)frB);
*(double*)frT = (double)s;
}
FPSCR_END(Rc);