Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dan@cgsoftware.com (Daniel Berlin+list.gdb-patches)
To: gdb-patches@sourceware.cygnus.com
Subject: Re: [RFC] Better apropos patch
Date: Wed, 22 Mar 2000 14:43:00 -0000	[thread overview]
Message-ID: <wvmufwx9.fsf@dan.resnet.rochester.edu> (raw)
In-Reply-To: <38D9429B.798F82E2@redhat.com>

Fernando Nasser <fnasser@redhat.com> writes:


> Daniel Berlin wrote:
> > was okay.
> 
> I see.  Sorry, I should have noticed that it was RFC not RFA.
> 
> Well, don't worry about some odd case.  If it happens, we fix it.
Okeydokey

> 
> Maybe the only way to get a feedback with regards to the output format
> will be to incorporate it and let people use it.

I'll go finish commenting it, reformat it, add a changelog entry, and
add a texinfo entry in a few minutes.

> 
> This is way cool.  I am looking forward to the final patch.  

It'll be about 20 minutes.
> 
> P.S.: Are you going to send a gdb.texinfo entry as well? 
Yup, i'd be happy to.
>It would be  nice if you do (else I would have to do it myself before checking it in
> and my TODO list is approaching infinity). 
From msnyder@cygnus.com Wed Mar 22 14:47:00 2000
From: Michael Snyder <msnyder@cygnus.com>
To: Toshiyasu Morita <tm@netcom.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH]: Allow struct compare in expressions.
Date: Wed, 22 Mar 2000 14:47:00 -0000
Message-id: <38D94D62.6951@cygnus.com>
References: <200003222218.OAA02705@netcom.com>
X-SW-Source: 2000-03/msg00484.html
Content-length: 5378

Toshiyasu Morita wrote:
> 
> Does this compare ignore the padding in the struct?

Nope.  It's a binary compare, like memcmp.

> >
> >
> > The following change allows GDB to evaluate (and set watchpoints on)
> > expressions of the form (a == b) and (a != b), where a and b are
> > simple C structs or unions.  It would be possible to extend this
> > further by allowing simple binary comparison for classes that don't
> > have an operator== method: I leave that as an exercise for someone
> > else.
> >
> > Jim Blandy, David Taylor, I think both of your approvals is required.
> >
> > 2000-03-22  Michael Snyder  <msnyder@cleaver.cygnus.com>
> >
> >         * eval.c (evaluate_subexp_standard): allow for simple comparison
> >         of structures, in the absense of C++ method symbols.
> >         * symtab.c (total_number_of_methods): make public, for use above.
> >         * symtab.h (total_number_of_methods): publish prototype.
> >
> > Index: ChangeLog
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/ChangeLog,v
> > retrieving revision 1.163
> > diff -c -r1.163 ChangeLog
> > *** ChangeLog 2000/03/22 09:45:01     1.163
> > --- ChangeLog 2000/03/22 20:38:33
> > ***************
> > *** 1,3 ****
> > --- 1,10 ----
> > + 2000-03-22  Michael Snyder  <msnyder@cleaver.cygnus.com>
> > +
> > +     * eval.c (evaluate_subexp_standard): allow for simple comparison
> > +     of structures, in the absense of C++ method symbols.
> > +     * symtab.c (total_number_of_methods): make public, for use above.
> > +     * symtab.h (total_number_of_methods): publish prototype.
> > +
> >   2000-03-22  Mark Kettenis  <kettenis@gnu.org>
> >
> >       * config/i386/tm-i386aix.h (I386_AIX_TARGET): Remove.
> > Index: eval.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/eval.c,v
> > retrieving revision 1.2
> > diff -c -r1.2 eval.c
> > *** eval.c    2000/03/14 17:01:04     1.2
> > --- eval.c    2000/03/22 20:38:34
> > ***************
> > *** 1448,1454 ****
> >         arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
> >         if (noside == EVAL_SKIP)
> >       goto nosideret;
> > !       if (binop_user_defined_p (op, arg1, arg2))
> >       {
> >         return value_x_binop (arg1, arg2, op, OP_NULL, noside);
> >       }
> > --- 1448,1459 ----
> >         arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
> >         if (noside == EVAL_SKIP)
> >       goto nosideret;
> > !
> > !       /* NOTE: because BINOP_EQUAL is a legal operaton for
> > !      C structs (as opposed to C++ classes), revert to
> > !      simple value comparison if the type has no methods.  */
> > !       if (binop_user_defined_p (op, arg1, arg2) &&
> > !       total_number_of_methods (arg1->type) > 0)
> >       {
> >         return value_x_binop (arg1, arg2, op, OP_NULL, noside);
> >       }
> > ***************
> > *** 1463,1469 ****
> >         arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
> >         if (noside == EVAL_SKIP)
> >       goto nosideret;
> > !       if (binop_user_defined_p (op, arg1, arg2))
> >       {
> >         return value_x_binop (arg1, arg2, op, OP_NULL, noside);
> >       }
> > --- 1468,1479 ----
> >         arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
> >         if (noside == EVAL_SKIP)
> >       goto nosideret;
> > !
> > !       /* NOTE: because BINOP_NOTEQUAL is a legal operaton for
> > !      C structs (as opposed to C++ classes), revert to
> > !      simple value comparison if the type has no methods.  */
> > !       if (binop_user_defined_p (op, arg1, arg2) &&
> > !       total_number_of_methods (arg1->type) > 0)
> >       {
> >         return value_x_binop (arg1, arg2, op, OP_NULL, noside);
> >       }
> > Index: symtab.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/symtab.c,v
> > retrieving revision 1.2
> > diff -c -r1.2 symtab.c
> > *** symtab.c  2000/02/08 04:39:02     1.2
> > --- symtab.c  2000/03/22 20:38:34
> > ***************
> > *** 2217,2225 ****
> >      reader because the type of the baseclass might still be stubbed
> >      when the definition of the derived class is parsed.  */
> >
> > ! static int total_number_of_methods PARAMS ((struct type * type));
> > !
> > ! static int
> >   total_number_of_methods (type)
> >        struct type *type;
> >   {
> > --- 2217,2223 ----
> >      reader because the type of the baseclass might still be stubbed
> >      when the definition of the derived class is parsed.  */
> >
> > ! int
> >   total_number_of_methods (type)
> >        struct type *type;
> >   {
> > Index: symtab.h
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/symtab.h,v
> > retrieving revision 1.4
> > diff -c -r1.4 symtab.h
> > *** symtab.h  2000/03/21 22:37:42     1.4
> > --- symtab.h  2000/03/22 20:38:34
> > ***************
> > *** 1462,1467 ****
> > --- 1462,1472 ----
> >   extern int
> >   in_prologue PARAMS ((CORE_ADDR pc, CORE_ADDR func_start));
> >
> > + /* Number of method symbols for TYPE
> > +    (and all its base classes) */
> > + extern int
> > + total_number_of_methods PARAMS ((struct type * type));
> > +
> >   extern struct symbol *
> >     fixup_symbol_section PARAMS ((struct symbol *, struct objfile *));
> >
> >
From shebs@apple.com Wed Mar 22 14:57:00 2000
From: Stan Shebs <shebs@apple.com>
To: dan@cgsoftware.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [RFC] Better apropos patch
Date: Wed, 22 Mar 2000 14:57:00 -0000
Message-id: <38D94FF8.2932EF67@apple.com>
References: <Pine.LNX.4.10.10003221307320.20082-100000@propylaea.anduin.com> <38D9429B.798F82E2@redhat.com> <wvmufwx9.fsf@dan.resnet.rochester.edu>
X-SW-Source: 2000-03/msg00485.html
Content-length: 451

"Daniel Berlin+list.gdb-patches" wrote:

> I'll go finish commenting it, reformat it, add a changelog entry, and
> add a texinfo entry in a few minutes.

Please please please add a testcase or two also.  I suggest at the
end of gdb.base/help.exp, and lots of wildcarding in the match; but
you can count on basic commands like "break" and "print" always
being in GDB...

This apropos command *will* be really nice to have!  Thanks for adding it!

Stan
From jtc@redback.com Wed Mar 22 16:07:00 2000
From: jtc@redback.com (J.T. Conklin)
To: gdb-patches@sourceware.cygnus.com
Subject: RFA: USE_STRUCT_CONVENTION for NetBSD/i386
Date: Wed, 22 Mar 2000 16:07:00 -0000
Message-id: <5msnxieegg.fsf@jtc.redbacknetworks.com>
X-SW-Source: 2000-03/msg00486.html
Content-length: 2096

I submit the enclosed patch for approval.  This change allows GDB to
extract the return value for most functions returning structs on 
NetBSD/i386 systems.  

Problems remain with functions returning structs of these two forms:

        struct one_float_t {
                float x;
        };

        struct one_double_t {
                double x;
        };

But all others work.

        --jtc

2000-03-22  J.T. Conklin  <jtc@redback.com>

	* i386/tm-nbsd.h (USE_STRUCT_CONVENTION): Define.
	* i386nbsd-nat.c (i386nbsd_use_struct_convention): New function.

Index: i386nbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386nbsd-nat.c,v
retrieving revision 1.1
diff -c -r1.1 i386nbsd-nat.c
*** i386nbsd-nat.c	2000/03/22 01:36:31	1.1
--- i386nbsd-nat.c	2000/03/22 22:59:30
***************
*** 148,154 ****
    ptrace (PT_SETFPREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
  }
! 
  struct md_core
  {
    struct reg intreg;
--- 148,163 ----
    ptrace (PT_SETFPREGS, inferior_pid,
  	  (PTRACE_ARG3_TYPE) &inferior_fpregisters, 0);
  }
! \f
! int
! i386nbsd_use_struct_convention (int gcc_p, struct type *type)
! {
!   return !(TYPE_LENGTH (type) == 1
! 	   || TYPE_LENGTH (type) == 2
! 	   || TYPE_LENGTH (type) == 4
! 	   || TYPE_LENGTH (type) == 8);
! }
! \f
  struct md_core
  {
    struct reg intreg;
Index: config/i386/tm-nbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-nbsd.h,v
retrieving revision 1.2
diff -c -r1.2 tm-nbsd.h
*** tm-nbsd.h	2000/03/22 01:36:31	1.2
--- tm-nbsd.h	2000/03/22 22:59:30
***************
*** 26,31 ****
--- 26,36 ----
  #include "i386/tm-i386bsd.h"
  #include "tm-nbsd.h"
  
+ extern use_struct_convention_fn i386nbsd_use_struct_convention;
+ #define USE_STRUCT_CONVENTION(gcc_p, type) \
+ 	i386nbsd_use_struct_convention(gcc_p, type)
+ 
+ 
  #define JB_ELEMENT_SIZE sizeof(int)	/* jmp_buf[_JBLEN] is array of ints */
  #define JB_PC	0		/* Setjmp()'s return PC saved here */
  

-- 
J.T. Conklin
RedBack Networks
From kettenis@wins.uva.nl Wed Mar 22 16:33:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: jtc@redback.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: USE_STRUCT_CONVENTION for NetBSD/i386
Date: Wed, 22 Mar 2000 16:33:00 -0000
Message-id: <200003230032.e2N0WuD00374@delius.kettenis.local>
References: <5msnxieegg.fsf@jtc.redbacknetworks.com>
X-SW-Source: 2000-03/msg00487.html
Content-length: 371

   From: jtc@redback.com (J.T. Conklin)
   Date: 22 Mar 2000 16:07:43 -0800

   Problems remain with functions returning structs of these two forms:

	   struct one_float_t {
		   float x;
	   };

	   struct one_double_t {
		   double x;
	   };

Could you elaborate on that?  What is the convention used by NetBSD
for returning those structs and why does GDB fail?

Mark
From dan@cgsoftware.com Wed Mar 22 16:39:00 2000
From: dan@cgsoftware.com (Daniel Berlin+list.gdb-patches)
To: gdb-patches@sourceware.cygnus.com
Subject: Re: [RFC] Better apropos patch
Date: Wed, 22 Mar 2000 16:39:00 -0000
Message-id: <7leutt8u.fsf@dan.resnet.rochester.edu>
References: <Pine.LNX.4.10.10003221307320.20082-100000@propylaea.anduin.com> <38D9429B.798F82E2@redhat.com> <wvmufwx9.fsf@dan.resnet.rochester.edu> <38D94FF8.2932EF67@apple.com>
X-SW-Source: 2000-03/msg00488.html
Content-length: 554

Stan Shebs <shebs@apple.com> writes:

Done, on all accounts, about to post.

> "Daniel Berlin+list.gdb-patches" wrote:
> 
> > I'll go finish commenting it, reformat it, add a changelog entry, and
> > add a texinfo entry in a few minutes.
> 
> Please please please add a testcase or two also.  I suggest at the
> end of gdb.base/help.exp, and lots of wildcarding in the match; but
> you can count on basic commands like "break" and "print" always
> being in GDB...
> 
> This apropos command *will* be really nice to have!  Thanks for adding it!
> 
> Stan
From dan@cgsoftware.com Wed Mar 22 16:46:00 2000
From: dan@cgsoftware.com (Daniel Berlin+list.gdb-patches)
To: gdb-patches@sourceware.cygnus.com
Cc: Fernando Nasser <fnasser@cygnus.com>, Stan Shebs <shebs@apple.com>
Subject: [RFA]: Apropos patch
Date: Wed, 22 Mar 2000 16:46:00 -0000
Message-id: <1z52tswd.fsf@dan.resnet.rochester.edu>
X-SW-Source: 2000-03/msg00489.html
Content-length: 296

It includes documentation, a test case (which uses a slightly weird
regexp so it only finds one thing, and we make sure it only found one
thing), and all the apropriate changelog entries.

Let me know if i can check it in, i believe it needs approval from
Stan Shebs, and Fernando Nasser.

--Dan
From jtc@redback.com Wed Mar 22 17:03:00 2000
From: jtc@redback.com (J.T. Conklin)
To: Mark Kettenis <kettenis@wins.uva.nl>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: USE_STRUCT_CONVENTION for NetBSD/i386
Date: Wed, 22 Mar 2000 17:03:00 -0000
Message-id: <5mitye7b2s.fsf@jtc.redbacknetworks.com>
References: <5msnxieegg.fsf@jtc.redbacknetworks.com> <200003230032.e2N0WuD00374@delius.kettenis.local>
X-SW-Source: 2000-03/msg00490.html
Content-length: 687

>>>>> "Mark" == Mark Kettenis <kettenis@wins.uva.nl> writes:
Mark>    Problems remain with functions returning structs of these two forms:
Mark>
Mark> 	   struct one_float_t {
Mark> 		   float x;
Mark> 	   };
Mark>
Mark> 	   struct one_double_t {
Mark> 		   double x;
Mark> 	   };
Mark>
Mark> Could you elaborate on that?  What is the convention used by NetBSD
Mark> for returning those structs and why does GDB fail?

Gcc, at least gcc-2.95.2, returns the above structs in floating point
registers instead of integer registers.

I don't think NetBSD's gcc config does anything special except for
setting DEFAULT_PPC_STRUCT_RETURN to 0.

        --jtc

-- 
J.T. Conklin
RedBack Networks
From ezannoni@cygnus.com Wed Mar 22 17:06:00 2000
From: Elena Zannoni <ezannoni@cygnus.com>
To: "Philippe De Muyter" <phdm@macqel.be>
Cc: ac131313@cygnus.com (Andrew Cagney), ezannoni@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: HAVE_POLL is not enough - RFA
Date: Wed, 22 Mar 2000 17:06:00 -0000
Message-id: <14553.28151.426657.410579@kwikemart.cygnus.com>
References: <38D5BE1D.7BB02C99@cygnus.com> <200003211559.QAA16996@mail.macqel.be>
X-SW-Source: 2000-03/msg00491.html
Content-length: 986

Philippe De Muyter writes:
 > Andrew Cagney wrote :
 > > 	if (use_poll)
 > > 	  {
 > > #if HAVE_POLL
 > > 	    ...
 > > #else
 > > 	    internal_error (...);
 > > #endif
 > > 	  }
 > > 	else
 > > 	  {
 > > 	  }
 > I have done that.  OK to commit ?
 > 

The patch would be OK, except that there is a problem on platforms that
don't have poll() at all, like cygwin.

In those cases HAVE_POLL is undefined, not defined as 0.  This is what
the AC_CHECK_FUNCS does, I don't know if there is a way to specify to
autoconf that we would like to have HAVE_POLL == 0 in case the check
fails.

Instead of these 2 lines:

 > +/* Do we use poll or select ? */
 > +static unsigned char use_poll = HAVE_POLL;

We should use:

#ifdef HAVE_POLL
#define USE_POLL 1
#else
#define USE_POLL 0
#endif /* HAVE_POLL */

/* Do we use poll or select ? */
static unsigned char use_poll = USE_POLL;


I am testing with this modification at the moment, on cygwin. I will also 
give a spin to target async.

Elena



       reply	other threads:[~2000-03-22 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.10.10003221307320.20082-100000@propylaea.anduin.com>
     [not found] ` <38D9429B.798F82E2@redhat.com>
2000-03-22 14:43   ` Daniel Berlin+list.gdb-patches [this message]
2000-03-22 12:58 Daniel Berlin
2000-03-22 13:07 ` Fernando Nasser
2000-04-01  0:00 ` Daniel Berlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wvmufwx9.fsf@dan.resnet.rochester.edu \
    --to=dan@cgsoftware.com \
    --cc=gdb-patches@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox