Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Patch for building gdb on arm-netbsd
@ 2002-01-09  5:34 Richard Earnshaw
  2002-01-09  6:15 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Earnshaw @ 2002-01-09  5:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: Richard.Earnshaw

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

Following the rules for converting to multi-arch, step one says we must 
get it all to compile...  So:

The following patch is needed to enable building of gdb on arm-netbsd.  
The definition of IN_SIGTRAMP tests NAME for being NULL and if not calls 
STREQ to compare the strings.  However, STREQ dereferences the pointers 
directly and this causes a compile time error for the NULL pointer (since 
*(0) is not defined).

<date>  Richard Earnshaw (rearnsha@arm.com)

	* arm-tdep.c (arm_init_extra_frame_info): Cast NULL argument of
	IN_SIGTRAMP to char *.


[-- Attachment #2: sigtramp.patch --]
[-- Type: text/x-patch , Size: 879 bytes --]

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.25
diff -p -r1.25 arm-tdep.c
*** arm-tdep.c	2002/01/05 04:30:15	1.25
--- arm-tdep.c	2002/01/09 13:24:50
*************** arm_init_extra_frame_info (int fromleaf,
*** 1060,1066 ****
       to IN_SIGTRAMP.  */
  
    if (SIGCONTEXT_REGISTER_ADDRESS_P () 
!       && (fi->signal_handler_caller || IN_SIGTRAMP (fi->pc, 0)))
      {
        for (reg = 0; reg < NUM_REGS; reg++)
  	fi->fsr.regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, fi->pc, reg);
--- 1060,1066 ----
       to IN_SIGTRAMP.  */
  
    if (SIGCONTEXT_REGISTER_ADDRESS_P () 
!       && (fi->signal_handler_caller || IN_SIGTRAMP (fi->pc, (char *)0)))
      {
        for (reg = 0; reg < NUM_REGS; reg++)
  	fi->fsr.regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, fi->pc, reg);

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

* Re: Patch for building gdb on arm-netbsd
  2002-01-09  5:34 Patch for building gdb on arm-netbsd Richard Earnshaw
@ 2002-01-09  6:15 ` Eli Zaretskii
  2002-01-09  6:25   ` Richard Earnshaw
  2002-01-09  9:21   ` Andrew Cagney
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2002-01-09  6:15 UTC (permalink / raw)
  To: Richard.Earnshaw; +Cc: gdb-patches


On Wed, 9 Jan 2002, Richard Earnshaw wrote:

> The following patch is needed to enable building of gdb on arm-netbsd.  
> The definition of IN_SIGTRAMP tests NAME for being NULL and if not calls 
> STREQ to compare the strings.

Nitpicking: Elena will probably be very happy if you toss STREQ and use 
strcmp instead.


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

* Re: Patch for building gdb on arm-netbsd
  2002-01-09  6:15 ` Eli Zaretskii
@ 2002-01-09  6:25   ` Richard Earnshaw
  2002-01-09  9:21   ` Andrew Cagney
  1 sibling, 0 replies; 8+ messages in thread
From: Richard Earnshaw @ 2002-01-09  6:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Richard.Earnshaw, gdb-patches

> 
> On Wed, 9 Jan 2002, Richard Earnshaw wrote:
> 
> > The following patch is needed to enable building of gdb on arm-netbsd.  
> > The definition of IN_SIGTRAMP tests NAME for being NULL and if not calls 
> > STREQ to compare the strings.
> 
> Nitpicking: Elena will probably be very happy if you toss STREQ and use 
> strcmp instead.

Since it's only a nit, I think I'll leave that issue for now.  What is 
most important at this time is to get the ARM code multi-arched (I suspect 
that whole function will have to be re-written anyway -- I think it's part 
of one of the deprecated frame calls).

R.


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

* Re: Patch for building gdb on arm-netbsd
  2002-01-09  6:15 ` Eli Zaretskii
  2002-01-09  6:25   ` Richard Earnshaw
@ 2002-01-09  9:21   ` Andrew Cagney
  2002-01-09  9:29     ` Richard Earnshaw
  2002-01-09 10:45     ` Elena Zannoni
  1 sibling, 2 replies; 8+ messages in thread
From: Andrew Cagney @ 2002-01-09  9:21 UTC (permalink / raw)
  To: Eli Zaretskii, Richard.Earnshaw; +Cc: gdb-patches

> On Wed, 9 Jan 2002, Richard Earnshaw wrote:
> 
> 
>> The following patch is needed to enable building of gdb on arm-netbsd.  
>> The definition of IN_SIGTRAMP tests NAME for being NULL and if not calls 
>> STREQ to compare the strings.
> 
> 
> Nitpicking: Elena will probably be very happy if you toss STREQ and use 
> strcmp instead.


I'm puzzled as to why it would be Elena?  Anyway, Richard, when 
generating new code just keep an eye on 
http://sources.redhat.com/gdb/ari/ for things to not copy.

BTW, people tend to just use NULL.

either way, yes it is obvious,
Andrew


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

* Re: Patch for building gdb on arm-netbsd
  2002-01-09  9:21   ` Andrew Cagney
@ 2002-01-09  9:29     ` Richard Earnshaw
  2002-01-09  9:54       ` Andrew Cagney
  2002-01-09 10:45     ` Elena Zannoni
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Earnshaw @ 2002-01-09  9:29 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Eli Zaretskii, Richard.Earnshaw, gdb-patches

> I'm puzzled as to why it would be Elena?  Anyway, Richard, when 
> generating new code just keep an eye on 
> http://sources.redhat.com/gdb/ari/ for things to not copy.
> 

Sure.


> BTW, people tend to just use NULL.

I would normally, but this was more a case of minimal change given that 
that function will probably go away entirely soon.

> 
> either way, yes it is obvious,

Excellent, except I don't have commit privs to gdb (though I have 
sources.redhat.com access for some other trees).

R.



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

* Re: Patch for building gdb on arm-netbsd
  2002-01-09  9:29     ` Richard Earnshaw
@ 2002-01-09  9:54       ` Andrew Cagney
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2002-01-09  9:54 UTC (permalink / raw)
  To: Richard.Earnshaw; +Cc: Eli Zaretskii, gdb-patches

> either way, yes it is obvious,
> 
> 
> Excellent, except I don't have commit privs to gdb (though I have 
> sources.redhat.com access for some other trees).


Doh!  Your welcome to add your self to the write-after-approval list.

Andrew


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

* Re: Patch for building gdb on arm-netbsd
  2002-01-09  9:21   ` Andrew Cagney
  2002-01-09  9:29     ` Richard Earnshaw
@ 2002-01-09 10:45     ` Elena Zannoni
  2002-01-13  8:28       ` Andrew Cagney
  1 sibling, 1 reply; 8+ messages in thread
From: Elena Zannoni @ 2002-01-09 10:45 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Eli Zaretskii, Richard.Earnshaw, gdb-patches

Andrew Cagney writes:
 > > On Wed, 9 Jan 2002, Richard Earnshaw wrote:
 > > 
 > > 
 > >> The following patch is needed to enable building of gdb on arm-netbsd.  
 > >> The definition of IN_SIGTRAMP tests NAME for being NULL and if not calls 
 > >> STREQ to compare the strings.
 > > 
 > > 
 > > Nitpicking: Elena will probably be very happy if you toss STREQ and use 
 > > strcmp instead.
 > 
 > 
 > I'm puzzled as to why it would be Elena?

Oh, just because I expressed a few times a strong dislike for
STREQ.  :-)

Elena


 >  Anyway, Richard, when 
 > generating new code just keep an eye on 
 > http://sources.redhat.com/gdb/ari/ for things to not copy.
 > 
 > BTW, people tend to just use NULL.
 > 
 > either way, yes it is obvious,
 > Andrew


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

* Re: Patch for building gdb on arm-netbsd
  2002-01-09 10:45     ` Elena Zannoni
@ 2002-01-13  8:28       ` Andrew Cagney
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2002-01-13  8:28 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: Eli Zaretskii, Richard.Earnshaw, gdb-patches

>  I'm puzzled as to why it would be Elena?
> 
> Oh, just because I expressed a few times a strong dislike for
> STREQ.  :-)


Just a footnote on this.  Looks like GDB is definitly right with trying 
to eliminate STREQ() et.al..  Turns out that GCC already does things 
like replace:

	strcpy (foo, "foo");
with 
memcpy (foo, "foo", 4);

so simplifying the code for str*() giving GDB a free hand is a good thing.

enjoy,
Andrew




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

end of thread, other threads:[~2002-01-13 16:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-09  5:34 Patch for building gdb on arm-netbsd Richard Earnshaw
2002-01-09  6:15 ` Eli Zaretskii
2002-01-09  6:25   ` Richard Earnshaw
2002-01-09  9:21   ` Andrew Cagney
2002-01-09  9:29     ` Richard Earnshaw
2002-01-09  9:54       ` Andrew Cagney
2002-01-09 10:45     ` Elena Zannoni
2002-01-13  8:28       ` Andrew Cagney

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