From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: Jim Blandy Cc: msnyder@redhat.com, gdb-patches@sources.redhat.com, ac131313@cygnus.com Subject: Re: [RFA] enum enable Date: Tue, 31 Jul 2001 01:45:00 -0000 Message-id: References: X-SW-Source: 2001-07/msg00753.html On 30 Jul 2001, Jim Blandy wrote: > This patch still fails to build. I'm stumped; did Patch say something about failed hunks? Do you have a broken version of Patch or something? It looks like part of the patch (see below) somehow didn't apply on your machine. > The code your patch forgets to > change has been present in the sources for over a year. Did you do a > full rebuild? I did a full rebuild of the DJGPP port, so I could miss something in files which aren't compiled in that version (although I grep'ed everything). But printcmd.c _is_ compiled for DJGPP, so I couldn't possibly miss anything there. > Here are the error messages: I attach below, after the error messages, the part of patch for printcmd.c, which clearly shows that _all_ of the lines for which GCC complained on your machine should in fact have been patched by the patch I posted. How come it didn't work for you? > gcc -c -g -O2 -I. -I/home/jimb/cygnus/src/sourceware/gdb/main/src/gdb -I/home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/config -DHAVE_CONFIG_H -I/home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../include/opcode -I/home/jimb/cygnus/src/sourceware/ gdb/main/src/gdb/../readline/.. -I../bfd -I/home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../bfd -I/home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../include -I../intl -I/home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/../intl -DMI_OUT=1 -DUI_OUT= 1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c:115: field `status' has incomplete type > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c: In function `display_command': > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c:1436: `enabled' undeclared (first use in this function) > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c:1436: (Each undeclared identifier is reported only once > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c:1436: for each function it appears in.) > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c: In function `do_one_display': > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c:1547: `disabled' undeclared (first use in this function) > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c: In function `disable_display': > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c:1647: `disabled' undeclared (first use in this function) > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c: In function `enable_display': > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c:1703: `enabled' undeclared (first use in this function) > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c: In function `disable_display_command': > /home/jimb/cygnus/src/sourceware/gdb/main/src/gdb/printcmd.c:1741: `disabled' undeclared (first use in this function) > make[1]: *** [printcmd.o] Error 1 > make[1]: Leaving directory `/gnomon/jimb/cygnus/pentium3/sourceware/gdb/main/native/build/gdb' > make: *** [all-gdb] Error 2 > > Compilation exited abnormally with code 2 at Mon Jul 30 14:09:33 > Here's the patch for printcmd.c: --- gdb/printcmd.c~0 Sat May 12 07:08:22 2001 +++ gdb/printcmd.c Sat Jul 14 12:23:40 2001 @@ -111,7 +111,7 @@ struct display /* Innermost block required by this expression when evaluated */ struct block *block; /* Status of this display (enabled or disabled) */ - enum enable status; + int enabled_p; }; /* Chain of expressions whose values should be displayed @@ -1427,7 +1427,7 @@ display_command (char *exp, int from_tty new->next = display_chain; new->number = ++display_number; new->format = fmt; - new->status = enabled; + new->enabled_p = 1; display_chain = new; if (from_tty && target_has_execution) @@ -1538,7 +1538,7 @@ do_one_display (struct display *d) { int within_current_scope; - if (d->status == disabled) + if (d->enabled_p == 0) return; if (d->block) @@ -1638,7 +1638,7 @@ disable_display (int num) for (d = display_chain; d; d = d->next) if (d->number == num) { - d->status = disabled; + d->enabled_p = 0; return; } printf_unfiltered ("No display number %d.\n", num); @@ -1669,7 +1669,7 @@ Num Enb Expression\n"); for (d = display_chain; d; d = d->next) { - printf_filtered ("%d: %c ", d->number, "ny"[(int) d->status]); + printf_filtered ("%d: %c ", d->number, "ny"[(int) d->enabled_p]); if (d->format.size) printf_filtered ("/%d%c%c ", d->format.count, d->format.size, d->format.format); @@ -1694,7 +1694,7 @@ enable_display (char *args, int from_tty if (p == 0) { for (d = display_chain; d; d = d->next) - d->status = enabled; + d->enabled_p = 1; } else while (*p) @@ -1710,7 +1710,7 @@ enable_display (char *args, int from_tty for (d = display_chain; d; d = d->next) if (d->number == num) { - d->status = enabled; + d->enabled_p = 1; goto win; } printf_unfiltered ("No display number %d.\n", num); @@ -1732,7 +1732,7 @@ disable_display_command (char *args, int if (p == 0) { for (d = display_chain; d; d = d->next) - d->status = disabled; + d->enabled_p = 0; } else while (*p)