Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH to gdb/linux-nat.c
@ 2007-02-09  9:08 Gabriel Dos Reis
  2007-02-09 13:49 ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Gabriel Dos Reis @ 2007-02-09  9:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: dan


Hi,

  This patchlet fixes the build failure

[...]
gcc -c -g -O2    -I. -I/home/gdr/redhat/src/gdb -I/home/gdr/redhat/src/gdb/config -DLOCALEDIR="\"/home/gdr/share/locale\"" -DHAVE_CONFIG_H -I/home/gdr/redhat/src/gdb/../include/opcode -I/home/gdr/redhat/src/gdb/../readline/.. -I../bfd -I/home/gdr/redhat/src/gdb/../bfd -I/home/gdr/redhat/src/gdb/../include   -DMI_OUT=1 -DTUI=1  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wno-switch -Werror /home/gdr/redhat/src/gdb/linux-nat.c
cc1: warnings being treated as errors
/home/gdr/redhat/src/gdb/linux-nat.c: In function 'linux_nat_find_memory_regions':
/home/gdr/redhat/src/gdb/linux-nat.c:2556: warning: the address of 'filename' will always evaluate as 'true'
make[2]: *** [linux-nat.o] Error 1


for a native configuration on an i686-pc-linux-gnu and a build with
SVN GCC.  The problem is that the existing code was testing whether
the value of 'filename' is null.  That test is statically known to be
false since 'filename' is declared as a local array variable.

OK to apply?

-- Gaby

2007-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>

	* linux-nat.c (linux_nat_find_memory_regions): Don't check the
	address of 'filename'; it is always non null.

Index: gdb/linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.55
diff -p -r1.55 linux-nat.c
*** gdb/linux-nat.c	9 Jan 2007 17:58:51 -0000	1.55
--- gdb/linux-nat.c	9 Feb 2007 08:58:04 -0000
*************** linux_nat_find_memory_regions (int (*fun
*** 2553,2559 ****
  			    size, paddr_nz (addr),
  			    read ? 'r' : ' ',
  			    write ? 'w' : ' ', exec ? 'x' : ' ');
! 	  if (filename && filename[0])
  	    fprintf_filtered (gdb_stdout, " for %s", filename);
  	  fprintf_filtered (gdb_stdout, "\n");
  	}
--- 2553,2559 ----
  			    size, paddr_nz (addr),
  			    read ? 'r' : ' ',
  			    write ? 'w' : ' ', exec ? 'x' : ' ');
! 	  if (filename[0])
  	    fprintf_filtered (gdb_stdout, " for %s", filename);
  	  fprintf_filtered (gdb_stdout, "\n");
  	}


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH to gdb/linux-nat.c
  2007-02-09  9:08 PATCH to gdb/linux-nat.c Gabriel Dos Reis
@ 2007-02-09 13:49 ` Daniel Jacobowitz
  2007-02-09 16:38   ` Gabriel Dos Reis
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2007-02-09 13:49 UTC (permalink / raw)
  To: gdb-patches

On Fri, Feb 09, 2007 at 03:08:38AM -0600, Gabriel Dos Reis wrote:
> 2007-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>
> 
> 	* linux-nat.c (linux_nat_find_memory_regions): Don't check the
> 	address of 'filename'; it is always non null.

OK, thanks.  Do you have write access to GDB?  If not, do you want it?

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH to gdb/linux-nat.c
  2007-02-09 13:49 ` Daniel Jacobowitz
@ 2007-02-09 16:38   ` Gabriel Dos Reis
  2007-02-09 19:24     ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Gabriel Dos Reis @ 2007-02-09 16:38 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

Daniel Jacobowitz <dan@codesourcery.com> writes:

| On Fri, Feb 09, 2007 at 03:08:38AM -0600, Gabriel Dos Reis wrote:
| > 2007-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>
| > 
| > 	* linux-nat.c (linux_nat_find_memory_regions): Don't check the
| > 	address of 'filename'; it is always non null.
| 
| OK, thanks.  Do you have write access to GDB?  If not, do you want it?

A while ago, when libstdc++-v3 was a standalone project, I had an
account on sourceware.  I think things have changed over the years, so
yes, I'll welcome a write access t GDB.  Thanks!

-- Gaby


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH to gdb/linux-nat.c
  2007-02-09 16:38   ` Gabriel Dos Reis
@ 2007-02-09 19:24     ` Daniel Jacobowitz
  2007-02-09 19:39       ` Gabriel Dos Reis
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2007-02-09 19:24 UTC (permalink / raw)
  To: gdb-patches

On Fri, Feb 09, 2007 at 10:37:49AM -0600, Gabriel Dos Reis wrote:
> Daniel Jacobowitz <dan@codesourcery.com> writes:
> 
> | On Fri, Feb 09, 2007 at 03:08:38AM -0600, Gabriel Dos Reis wrote:
> | > 2007-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>
> | > 
> | > 	* linux-nat.c (linux_nat_find_memory_regions): Don't check the
> | > 	address of 'filename'; it is always non null.
> | 
> | OK, thanks.  Do you have write access to GDB?  If not, do you want it?
> 
> A while ago, when libstdc++-v3 was a standalone project, I had an
> account on sourceware.  I think things have changed over the years, so
> yes, I'll welcome a write access t GDB.  Thanks!

OK, now you have write access.  Please commit this, and post and commit
a patch adding yourself to the write-after-approval list in
gdb/MAINTAINERS.  Thanks for the patch!

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH to gdb/linux-nat.c
  2007-02-09 19:24     ` Daniel Jacobowitz
@ 2007-02-09 19:39       ` Gabriel Dos Reis
  2007-02-09 19:41         ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Gabriel Dos Reis @ 2007-02-09 19:39 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

Daniel Jacobowitz <dan@codesourcery.com> writes:

| On Fri, Feb 09, 2007 at 10:37:49AM -0600, Gabriel Dos Reis wrote:
| > Daniel Jacobowitz <dan@codesourcery.com> writes:
| > 
| > | On Fri, Feb 09, 2007 at 03:08:38AM -0600, Gabriel Dos Reis wrote:
| > | > 2007-02-09  Gabriel Dos Reis  <gdr@integrable-solutions.net>
| > | > 
| > | > 	* linux-nat.c (linux_nat_find_memory_regions): Don't check the
| > | > 	address of 'filename'; it is always non null.
| > | 
| > | OK, thanks.  Do you have write access to GDB?  If not, do you want it?
| > 
| > A while ago, when libstdc++-v3 was a standalone project, I had an
| > account on sourceware.  I think things have changed over the years, so
| > yes, I'll welcome a write access t GDB.  Thanks!
| 
| OK, now you have write access.  Please commit this, and post and commit
| a patch adding yourself to the write-after-approval list in
| gdb/MAINTAINERS.  Thanks for the patch!

Great; that was quick!  Many thanks.

One more favor:  Would you mind looking at my other patch?  The GCC PR
I filled was demonstrated to be a duplicate and nothing happened
since the first PR was filled; I believe GDB+GCC-4.2.0 is affected too.  I
think the patch I sent works around the problem within GDB and
"improves" the const-correctness of the two functions involved.

Thanks,

-- Gaby


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH to gdb/linux-nat.c
  2007-02-09 19:39       ` Gabriel Dos Reis
@ 2007-02-09 19:41         ` Daniel Jacobowitz
  2007-02-09 19:44           ` Gabriel Dos Reis
  2007-02-09 20:00           ` Joel Brobecker
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2007-02-09 19:41 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gdb-patches

On Fri, Feb 09, 2007 at 01:39:50PM -0600, Gabriel Dos Reis wrote:
> One more favor:  Would you mind looking at my other patch?  The GCC PR
> I filled was demonstrated to be a duplicate and nothing happened
> since the first PR was filled; I believe GDB+GCC-4.2.0 is affected too.  I
> think the patch I sent works around the problem within GDB and
> "improves" the const-correctness of the two functions involved.

I'd prefer to wait a little while to see if anyone else (Joel maybe)
has comments on that one - he's the expert on that code.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH to gdb/linux-nat.c
  2007-02-09 19:41         ` Daniel Jacobowitz
@ 2007-02-09 19:44           ` Gabriel Dos Reis
  2007-02-09 20:00           ` Joel Brobecker
  1 sibling, 0 replies; 8+ messages in thread
From: Gabriel Dos Reis @ 2007-02-09 19:44 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Fri, 9 Feb 2007, Daniel Jacobowitz wrote:

| On Fri, Feb 09, 2007 at 01:39:50PM -0600, Gabriel Dos Reis wrote:
| > One more favor:  Would you mind looking at my other patch?  The GCC PR
| > I filled was demonstrated to be a duplicate and nothing happened
| > since the first PR was filled; I believe GDB+GCC-4.2.0 is affected too.  I
| > think the patch I sent works around the problem within GDB and
| > "improves" the const-correctness of the two functions involved.
|
| I'd prefer to wait a little while to see if anyone else (Joel maybe)
| has comments on that one - he's the expert on that code.

Thanks makes sense.  Thanks!

-- Gaby


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH to gdb/linux-nat.c
  2007-02-09 19:41         ` Daniel Jacobowitz
  2007-02-09 19:44           ` Gabriel Dos Reis
@ 2007-02-09 20:00           ` Joel Brobecker
  1 sibling, 0 replies; 8+ messages in thread
From: Joel Brobecker @ 2007-02-09 20:00 UTC (permalink / raw)
  To: Gabriel Dos Reis, gdb-patches

> On Fri, Feb 09, 2007 at 01:39:50PM -0600, Gabriel Dos Reis wrote:
> > One more favor:  Would you mind looking at my other patch?  The GCC PR
> > I filled was demonstrated to be a duplicate and nothing happened
> > since the first PR was filled; I believe GDB+GCC-4.2.0 is affected too.  I
> > think the patch I sent works around the problem within GDB and
> > "improves" the const-correctness of the two functions involved.
> 
> I'd prefer to wait a little while to see if anyone else (Joel maybe)
> has comments on that one - he's the expert on that code.

Is it the patch to ada-lang.c? I'll have a look at this one very
shortly.

-- 
Joel


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-02-09 20:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-09  9:08 PATCH to gdb/linux-nat.c Gabriel Dos Reis
2007-02-09 13:49 ` Daniel Jacobowitz
2007-02-09 16:38   ` Gabriel Dos Reis
2007-02-09 19:24     ` Daniel Jacobowitz
2007-02-09 19:39       ` Gabriel Dos Reis
2007-02-09 19:41         ` Daniel Jacobowitz
2007-02-09 19:44           ` Gabriel Dos Reis
2007-02-09 20:00           ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox