From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: scottb@netwinder.org Cc: gdb-patches@sourceware.cygnus.com Subject: Re: Minor patches for ARM Linux native port... Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200002282058.e1SKwHF08116@delius.kettenis.local> References: <38BAD90A.FE163BDA@netwinder.org> X-SW-Source: 2000-q1/msg00404.html Hi Scott, Could you please send patches as plain text, instead of base64 encoded. Makes it easier to quickly scan the patches for anomalies and things that could be unified with other targets. Mark >From fnasser@cygnus.com Sat Apr 01 00:00:00 2000 From: Fernando Nasser To: Andrew Cagney Cc: GDB Patches Subject: Re: RFA Replace gdb/TODO with issues50 Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38DB8ABC.AED03A6B@cygnus.com> References: <38DAED11.C314EA48@cygnus.com> X-SW-Source: 2000-q1/msg00987.html Content-length: 905 Andrew Cagney wrote: > > Hello, > > I'd like to propose that the file gdb/TODO be emptied and then refilled > with a heavily edited version of: > > http://sourceware.cygnus.com/gdb/issues50.html > > To the best of my knowledge large chunks of the existing TODO file are > either wrong or irrelevant. I think starting from scratch would be more > useful. > Can't we do the same we do with ChangeLog? Rename TODO to TODO.??? and have the issues50 become the new TODO? We may have to do this again eventually... The file sort of documents the way people thought about gdb issues and can eventually serve as inspiration for some problem that does not exist anymore but come back (in another incarnation) in the future. But I don't how bad it is, maybe there is not much contents to worth keeping it. -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@cygnus.com >From fnasser@cygnus.com Sat Apr 01 00:00:00 2000 From: Fernando Nasser To: Elena Zannoni Cc: Andrew Cagney , Jim Kingdon , gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH] remote_detach() and inferior_pid Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38AC7BF4.8F9601EB@cygnus.com> References: <14505.29243.656290.516276@kwikemart.cygnus.com> <38ABADEC.F0320CCB@cygnus.com> <14508.25526.45779.825197@kwikemart.cygnus.com> <38AC660E.7D898F58@cygnus.com> <14508.26505.557237.402681@kwikemart.cygnus.com> X-SW-Source: 2000-q1/msg00233.html Content-length: 1238 Elena Zannoni wrote: > > Fernando Nasser writes: > > Elena Zannoni wrote: > > > > > > OK, all in agreement then. I'll add a generic_mourn_inferior() call in > > > there. New patch follows. OK to check in? > > > > > > > Hum, shouldn't we just change the calls to pop_target() by calls to > > remote_mourn() and remote_asynch_mourn() instead? > > > > True, I thought about that, but remote_mourn / remote_async_mourn call > unpush_target(), instead of pop_target(). I am not sure if that's an > important difference, or just a coincidence. > If your target does not have a to_close (it is inherited), then you need to call pop_target() because it calls the to_close of current_target (which will have one, even if the default). The other difference is that pop_target() makes gdb dump core if it does not find the target in the stack, which will never happen as it passes the top of the stack as a parameter. I believe for all practical purposes of remote.c they are equivalent. I even prefer the unpush one. -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@cygnus.com 2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311 Toronto, Ontario M4P 2C9 Fax: 416-482-6299 >From kettenis@wins.uva.nl Sat Apr 01 00:00:00 2000 From: Mark Kettenis To: gdb-patches@sourceware.cygnus.com Subject: [PATCH] AIX/i386 config tweaks Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003021552.e22FqXZ09797@delius.kettenis.local> X-SW-Source: 2000-q1/msg00459.html Content-length: 2936 FYI, I have checked in the following. This is untested, but AIX/i386 was broken anyway, and in theory this should fix it. The problem is that i386-tdep.c:i386_extract_return_value() accessed the FP0_REGNUM in GDB's register array, but since the reorganization of tm-i386.h last fall, the register array wasn't large enough anymore. It also clears the way for some changes I'm planning to make to i386-tdep.c:i386_extract_return_value(). Mark 2000-03-02 Mark Kettenis * config/i386/tm-i386aix.h (NUM_FPREGS, NUM_REGS, REGISTER_BYTES): Override definitions to include the normal FPU registers. (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Removed. The default definitions are fine for AIX/i386. (i387_to_double, double_to_i387): Remove prototypes. Index: config/i386/tm-i386aix.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-i386aix.h,v retrieving revision 1.1.1.2 diff -u -p -r1.1.1.2 tm-i386aix.h --- config/i386/tm-i386aix.h 1999/07/07 20:13:03 1.1.1.2 +++ config/i386/tm-i386aix.h 2000/03/02 15:37:29 @@ -29,40 +29,27 @@ #ifndef I386 #define I386 1 #endif + +/* FIXME: kettenis/2000-03-02: This is used in + i386-tdep.c:i386_extract_return_value(), and will be remove once + I've fixed that. Meanwhile don't use it for any other purpose + please! */ #ifndef I386_AIX_TARGET #define I386_AIX_TARGET 1 #endif - -/* Nonzero if register N requires conversion - from raw format to virtual format. */ - -#undef REGISTER_CONVERTIBLE -#define REGISTER_CONVERTIBLE(N) \ - ((N < FP0_REGNUM) ? 0 : 1) - -/* Convert data from raw format for register REGNUM in buffer FROM - to virtual format with type TYPE in buffer TO. */ -#undef REGISTER_CONVERT_TO_VIRTUAL -#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ -{ \ - double val; \ - i387_to_double ((FROM), (char *)&val); \ - store_floating ((TO), TYPE_LENGTH (TYPE), val); \ -} -extern void -i387_to_double PARAMS ((char *, char *)); +/* AIX/i386 has FPU support. However, the native configuration (which + is the only supported configuration) doesn't make the FPU control + registers available. Override the appropriate symbols such that + only the normal FPU registers are included in GDB's register array. */ + +#undef NUM_FPREGS +#define NUM_FPREGS (8) -/* Convert data from virtual format with type TYPE in buffer FROM - to raw format for register REGNUM in buffer TO. */ +#undef NUM_REGS +#define NUM_REGS (NUM_GREGS + NUM_FPREGS) -#undef REGISTER_CONVERT_TO_RAW -#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ -{ \ - double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ - double_to_i387((char *)&val, (TO)); \ -} -extern void -double_to_i387 PARAMS ((char *, char *)); +#undef REGISTER_BYTES +#define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS) #endif /* TM_I386AIX_H */ >From msnyder@cygnus.com Sat Apr 01 00:00:00 2000 From: Michael Snyder To: Mark Kettenis Cc: ac131313@cygnus.com, gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH] Replace ../include/wait.h with gdb_wait.h. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38D28BC0.4243@cygnus.com> References: <38A12872.13D194C4@cygnus.com> <200002091429.e19ETk916570@delius.kettenis.local> X-SW-Source: 2000-q1/msg00756.html Content-length: 1094 Mark Kettenis wrote: > [snip] > There is a problem with `linux-thread.c', where `gdb_wait.h' is included > before config.h. This means that HAVE_SYS_WAIT_H and HAVE_WAIT_H are > still undefined and the system headers are never used. > > Since `linux-thread.c' uses __W_STOPCODE, and `gdb_wait.h' doesn't > provide a fallback macro I get a linker failure. Moving up the > include for `defs.h' solves this problem. As noted earlier, the above part of this patch has already been checked in... > The rest of GDB seems to be using WSETSTOP, so it seems appropriate to > use that macro instead of __W_STOPCODE in `linux-thread.c'. I changed > the definition of WSETSTOP and WSETEXIT in `gdb_wait.h' to use > W_STOPCODE and W_EXITCODE if they are available. All BSD-derived > systems and systems that try to be source-compatible with BSD (like > Linux and the Hurd) should have those macros. The change is merely > cosmetic but there might be systems out there that really use a > different way to store this information. And I've now checked in this part as well. Michael Snyder >From jtc@redback.com Sat Apr 01 00:00:00 2000 From: jtc@redback.com (J.T. Conklin) To: Mark Kettenis Cc: hjl@lucon.org, shebs@apple.com, gdb-patches@sourceware.cygnus.com, gdb@sourceware.cygnus.com Subject: Re: A patch for gnu-regex Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <5m4saivyew.fsf@jtc.redbacknetworks.com> References: <20000307134103.A20533@valinux.com> <38C585BB.3F7B1AC7@apple.com> <20000307155806.A30106@valinux.com> <5mg0u2l3g0.fsf@jtc.redbacknetworks.com> <20000307162127.D485@lucon.org> <200003080044.e280iGB00429@delius.kettenis.local> X-SW-Source: 2000-q1/msg00585.html Content-length: 1011 >>>>> "Mark" == Mark Kettenis writes: Mark> Either way is fine with me. All I want is regex in glibc 2 :-). Any Mark> objections? Mark> Is this really important? From an engineering standpoint introducing Mark> a dependency on glibc may not be the right thing. I've seen a quite a Mark> few problems related to regex.h that were caused by getting out of Mark> sync with glibc. I'd prefer not to add this to GDB 5.0. I think Mark makes a good point. In fact, I vaguely remember conflicts with regex.c/regex.h that caused those files to be renamed to gnu-regex.c/gnu-regex.h back in the mid 90's. If it is at all important to use the host regular expression routines, perhaps we should investigate changing the calls used by GDB from the old BSD re_comp()/re_exec() API to the POSIX.2 regcomp()/regexec() API and using the host headers/library if the host provides it. I'd prefer going that route than special casing glibc. --jtc -- J.T. Conklin RedBack Networks >From dan@cgsoftware.com Sat Apr 01 00:00:00 2000 From: dan@cgsoftware.com (Daniel Berlin+mail.gdb) To: Eli Zaretskii Cc: Daniel Berlin , gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH]: add set/show debug, move gdb debugging flags into it Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: References: <200003150919.EAA29966@indy.delorie.com> <200003151430.JAA01149@indy.delorie.com> X-SW-Source: 2000-q1/msg00716.html Content-length: 1146 Eli Zaretskii writes: > > Are you saying i should write docs for the commands? > > Yes. Or at least Someone(tm) should. Okey dokey. I'm perfectly willing to document them, but personally, i don't think they *should* be documented. Or at least, the documentation shouldn't go with documentation for any regular commands. > > I consider the lack of any documentation for the commands you replaced > to be part of the same bug that you were fixing. In general, with those debug commands, if you can't figure out what they do based on the one sentence docstring, you shouldn't be touching them. It's hard to say more about what "target debugging" is, except that it enables printing of target debug info. > > Even a simple one-liner that mentions the command's existence, with a > @cindex entry to make it easy to find, is infinitely better than no > documentation at all, because the latter doesn't leave the user any > reasonable way of finding out that the commands exist. They shouldn't find out they exist, unless specifically instructed by someone. IMHO. They are for debugging GDB, not debugging *with* GDB. --Dan >From kevinb@cygnus.com Sat Apr 01 00:00:00 2000 From: Kevin Buettner To: gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH] Configury changes for IA-64 Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <1000321071034.ZM20906@ocotillo.lan> References: <1000321061323.ZM20818@ocotillo.lan> X-SW-Source: 2000-q1/msg00850.html Content-length: 5554 On Mar 20, 11:13pm, Kevin Buettner wrote: > Note: The observant among you will notice that I've diffed revision > 1.1 and revision 1.3 for configure.host. This is because in revision > 1.2, I inadvertently merged in all of the differences between the copy > of configure.host that I used for my IA-64 work and sourceware. (And > these diffs were far more substantial than just the addition of the > ia64-*-linux* entry.) I realized this when I made diffs after my 1.2 > commit. So 1.3 puts things right; it restores everything that I > inadvertently changed, but leaves in place my new ia64-*-linux entry. > If you do a diff between 1.1 and 1.3, you'll see what I wanted to > commit in the first place. I apologize for any confusion that this > may cause. I've done some more digging... It turns out that revision 1.2 of configure.host wasn't botched after all. But CVS's messages lead me to believe it was. I've just checked in a 1.4 which (I think) puts everything back right. I'll now explain the reason for my confusion... Immediately after checking in my changes to configure.host, CVS told me the following: Checking in configure.host; /cvs/src/src/gdb/configure.host,v <-- configure.host new revision: 1.2; previous revision: 1.1 done I thought it would be a good idea to check my work. So I did cvs diff -up -r1.1 configure.host to verify that everything was correct. I expected to see only the following hunk. i[3456]86-*-sysv*) gdb_host=i386v ;; i[3456]86-*-isc*) gdb_host=i386v32 ;; i[3456]86-*-cygwin*) gdb_host=cygwin ;; + +ia64-*-linux*) gdb_host=linux ;; + m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;; m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;; m68030-sony-*) gdb_host=news1000 ;; But (to my horror), I found that the diff was 108 lines long! What could have gone wrong? Suspecting that cvs might be playing tricks on me, I did a "cvs annotate" to see who was really responsible for all of those other changes. Well, "cvs annotate" said it was me!! Here's a small portion of the output from CVS annotate: 1.1 (shebs 16-Apr-99): 1.1 (shebs 16-Apr-99): alpha*) gdb_host_cpu=alpha ;; 1.2 (kevinb 21-Mar-00): arm*) gdb_host_cpu=arm ;; 1.2 (kevinb 21-Mar-00): # OBSOLETE c[12]) gdb_host_cpu=convex ;; 1.1 (shebs 16-Apr-99): hppa*) gdb_host_cpu=pa ;; Yup, sure enough; in version 1.2, it says that I was responsible for the arm entry and the OBSOLETE c[12] entry. So my conclusion at this point was that I'd made a grievous error in merging the configure.host file from my IA-64 sources with the one in sourceware. (Hey, I probably have you convinced at this point too, right?) So I used "cvs update -r1.1 -p configure.head >configure.head" to fetch the original file. (After all, 1.2 *was* all my doing, right?) I then hand applied my IA-64 changes, committed that and wrote that nice little note quoted above apologizing for any confusion. But I like to think of myself as a pretty careful guy when it comes to these things, so I did some more checking to find out how I could have made such an error in the first place. The first thing I did was to check my [PATCH RFA] message that I sent to sourceware. I suspected that I must have sent a patch made vs. the Cygnus internal repository. (I'm not supposed to mention this repository in this forum, so forget that I said anything about it.) But, if I *had* taken this diff against Cygnus's internal repository, it could explain how I could have sent a perfectly reasonable looking diff to gdb-patches and yet managed to horribly bungle my commit to the sourceware repository. But it turns out that the diff I sent to the list was vs. the sourceware repository. How could this be? The following line from the diff in question gave a telling clue: diff -u -p -r1.1.1.10 configure.host That 1.1.1.10 number looks like something on a branch, or maybe an import... In any event, it's certainly different than the 1.1 number which CVS claimed was the previous revision. So I did a "cvs log" to find out more. Here's the relevant portion: revision 1.3 date: 2000/03/21 05:43:30; author: kevinb; state: Exp; lines: +10 -16 Fixed botched commit in 1.2. ---------------------------- revision 1.2 date: 2000/03/21 05:26:31; author: kevinb; state: Exp; lines: +19 -10 IA-64 changes. ---------------------------- revision 1.1 date: 1999/04/16 01:33:58; author: shebs; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.10 date: 1999/12/22 21:45:03; author: jsm; state: Exp; lines: +3 -1 import gdb-1999-12-21 snapshot My conclusion at this point is that CVS lied to me after I did the commit. Moreover, it lied to me when I did the annotate. jsm should be credited with those changes due to his import, not me. As I said at the outset, I think I've now put everything back right. Certainly, when I diff 1.1.1.10 and my current version, I am seeing just those IA-64 changes that I had originally wanted to commit in the first place. (But it wouldn't hurt for one or more of you to check *before* you update. Do a "cvs diff -u -rHEAD configure.host" and make sure that the only change that you see is the one adding the "ia64-*-linux*" entry.) Once again, I apologize for the confusion. (Though I think ample blame can be laid upon CVS.) Kevin >From hjl@lucon.org Sat Apr 01 00:00:00 2000 From: "H . J . Lu" To: "J.T. Conklin" Cc: Mark Kettenis , shebs@apple.com, gdb-patches@sourceware.cygnus.com, gdb@sourceware.cygnus.com Subject: Re: A patch for gnu-regex Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <20000307211842.C1573@lucon.org> References: <20000307134103.A20533@valinux.com> <38C585BB.3F7B1AC7@apple.com> <20000307155806.A30106@valinux.com> <5mg0u2l3g0.fsf@jtc.redbacknetworks.com> <20000307162127.D485@lucon.org> <200003080044.e280iGB00429@delius.kettenis.local> <5m4saivyew.fsf@jtc.redbacknetworks.com> X-SW-Source: 2000-q1/msg00586.html Content-length: 1228 On Tue, Mar 07, 2000 at 09:11:35PM -0800, J.T. Conklin wrote: > >>>>> "Mark" == Mark Kettenis writes: > Mark> Either way is fine with me. All I want is regex in glibc 2 :-). Any > Mark> objections? > > Mark> Is this really important? From an engineering standpoint introducing > Mark> a dependency on glibc may not be the right thing. I've seen a quite a > Mark> few problems related to regex.h that were caused by getting out of > Mark> sync with glibc. I'd prefer not to add this to GDB 5.0. > > I think Mark makes a good point. In fact, I vaguely remember > conflicts with regex.c/regex.h that caused those files to be renamed I believe that is because there are several different implementations of regex.c/regex.h. > to gnu-regex.c/gnu-regex.h back in the mid 90's. > The current master copy of GNU regex is in glibc. I'd like to be able to compile gdb on a known good glibc base system using the GNU regex in glibc. I don't want to spend time to check if gdb has the updated regex or not. It is also useful when you compile a GNU/Linux system from the source. I don't like have N copies of the same thing in my source tree. If possible, everyone should use the master copy. H.J. >From ac131313@cygnus.com Sat Apr 01 00:00:00 2000 From: Andrew Cagney To: Jim Kingdon , GDB Patches Subject: FYI, updated gdb/CONTRIBUTE link Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38ABC58E.25895FB8@cygnus.com> X-SW-Source: 2000-q1/msg00220.html Content-length: 226 Jim, Thanks to some hints from Jason, I've changed the gdb/CONTRIBUTE link so that it jumps direct to the file. Andrew PS: Do to a bad habit (emacs: M-X 4 a) I also ended up with a ChangeLog file in the web repository.... >From dan@cgsoftware.com Sat Apr 01 00:00:00 2000 From: dan@cgsoftware.com (Daniel Berlin+list.gdb-patches) To: Chris Faylor Cc: Daniel Berlin , gdb-patches@sourceware.cygnus.com Subject: Re: [RFA] Demangled minsym hash table broken Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: References: <20000329195755.A4249@cygnus.com> X-SW-Source: 2000-q1/msg01118.html Content-length: 477 Chris Faylor writes: > > Peter Schauer submitted a patch a while ago when he discovered this. > > It's here: http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00869.html > > I don't know if your patch is similar but we should probably go with the > simplest solution... > I'll work up some testcases and commit his patch, along with some more C++ support fixes i've been working on (Should help a lot with the people still using STABS). --Dan > cgf >From dan@cgsoftware.com Sat Apr 01 00:00:00 2000 From: dan@cgsoftware.com (Daniel Berlin+list.gdb-patches) To: shebs@apple.com Cc: dan@cgsoftware.com, gdb-patches@sourceware.cygnus.com, Fernando Nasser Subject: Re: [RFA]: Apropos patch Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: References: <1z52tswd.fsf@dan.resnet.rochester.edu> <38D9815A.FC4E178E@apple.com> X-SW-Source: 2000-q1/msg00932.html Content-length: 1985 Stan Shebs writes: > "Daniel Berlin+list.gdb-patches" wrote: > > > > 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. > > You're going to hate this, but now that I see the example in the manual, > I'm wondering why "prefix:" and "command:" are on separate lines? No particular reason, i can make it go away if you like, it's simple. > Why not just imitate the syntax that comes out of the help command - > > set symbol-reloading -- > show symbol-reloading -- I thought of this, but the problem is that the help command only displays the first line, and the match may not be there. If something wanted to say, highlight the match, or something, it might not have appeared in the first line, and thus, not in the output. > > Another advantage is that users can then cut-n-paste from the apropos > output more easily. > > > Let me know if i can check it in, i believe it needs approval from > > Stan Shebs, and Fernando Nasser. > > Just needs approval from one of us, not both! I must confess to being > a bit mystified by the test though - why use "handle" as the match > string, and do I understand right, you're requiring that it be the > first output from apropos? That regexp gets rid of every command with "print" in the name or doc string, except one. Handle happened to be that one when i got done removing commands by adding to the regexp, and i figured it should be available on every single platform (even platforms where signals basically were ignored when it came to gdb, like BeOS), so why not use that? If it come out to be some weird command, i would have changed the regex. The [^:]+ just makes sure it doesn't catch another command. It's kinda a crappy test, i'll revise it as soon as some consensus is reached as to what the output should be like. > > Stan >From ac131313@cygnus.com Sat Apr 01 00:00:00 2000 From: Andrew Cagney To: GDB Patches Subject: [SIM] Change sim_trace() iface, add ``-o'' to run.c Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38B20DFA.8AAF741@cygnus.com> X-SW-Source: 2000-q1/msg00298.html Content-length: 1045 Hello, I've encountered the situation where for the d10v simulator needs to exhibit both user and operating environment behaviors (1). To allow this, I'd like to propose the following changes to the sim sub directory: o run.c Add the option ``-o'' for operating (system) environment. When selected operating environment is provided. Change the main loop so that it only loops when ``operating_p''. o sim/*/* + include/remote-sim.h Change the sim_trace() interface so that it just sets the trace option and doesn't try to run the simulator. run.c being updated accordingly. This change is needed as, currently, the old simulators are confused as to what exactly sim_trace() should do. Trying to introduce a ``-o'' option would result in inconsistent behavour: ``-t -o'' would be different to ``-o'' thoughts? Andrew -- (1) For the curious, operating environment provides the raw machine - traps and interrupts are delivered. User environment is more like unix where a trap halts the program. >From jimb@zwingli.cygnus.com Sat Apr 01 00:00:00 2000 From: Jim Blandy To: gdb-patches@sourceware.cygnus.com Subject: RFA: handle sparse register sets in Insight register window Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003242326.SAA17809@zwingli.cygnus.com> X-SW-Source: 2000-q1/msg01008.html Content-length: 5252 The Insight register window doesn't properly display register sets that have holes in the register numbering. Jim Ingham's change of 1999-10-05 doesn't fix the whole problem. In gdb/gdbtk/generic/ChangeLog-gdbtk: 2000-03-24 Jim Blandy Handle the fact that there are holes in the register numbering. (gdb_regnames): Return value is now a list of pairs of the form {REGNAME NUMBER}. (get_register_name): Record both the register name and number. In gdb/gdbtk/library/ChangeLog: 2000-03-24 Jim Blandy Handle the fact that there are holes in the register numbering. * actiondlg.tcl (ActionDlg::constructor): Handle new type of gdb_regnames result. * regwin.itb (RegWin::init_reg_display_vars, RegWin::build_win): Same. Use the register numbers provided by gdb_regnames; don't just assume that the Nth element is register N. Index: gdb/gdbtk/generic/gdbtk-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v retrieving revision 1.4 diff -c -r1.4 gdbtk-cmds.c *** gdb/gdbtk/generic/gdbtk-cmds.c 2000/02/29 22:47:37 1.4 --- gdb/gdbtk/generic/gdbtk-cmds.c 2000/03/24 23:19:55 *************** *** 1834,1840 **** } /* This implements the TCL command `gdb_regnames', which returns a list of ! all of the register names. */ static int gdb_regnames (clientData, interp, objc, objv) --- 1834,1840 ---- } /* This implements the TCL command `gdb_regnames', which returns a list of ! all of the register names, and their indices. */ static int gdb_regnames (clientData, interp, objc, objv) *************** *** 1854,1861 **** int regnum; void *argp; /* Ignored */ { ! Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, ! Tcl_NewStringObj (REGISTER_NAME (regnum), -1)); } /* This implements the tcl command gdb_fetch_registers --- 1854,1869 ---- int regnum; void *argp; /* Ignored */ { ! /* Build a tuple of the form "{REGNAME NUMBER}", and append it to ! our result. */ ! Tcl_Obj *array[2]; ! Tcl_Obj *pair; ! ! array[0] = Tcl_NewStringObj (REGISTER_NAME (regnum), -1); ! array[1] = Tcl_NewIntObj (regnum); ! pair = Tcl_NewListObj (2, array); ! ! Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, pair); } /* This implements the tcl command gdb_fetch_registers Index: gdb/gdbtk/library/actiondlg.tcl =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/actiondlg.tcl,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 actiondlg.tcl *** gdb/gdbtk/library/actiondlg.tcl 2000/02/07 00:19:42 1.1.1.1 --- gdb/gdbtk/library/actiondlg.tcl 2000/03/24 23:20:00 *************** *** 30,36 **** set top [winfo toplevel [namespace tail $this]] wm withdraw $top ! set Registers [gdb_regnames] if {$Line != ""} { set Locals [gdb_get_locals "$File:$Line"] set Args [gdb_get_args "$File:$Line"] --- 30,40 ---- set top [winfo toplevel [namespace tail $this]] wm withdraw $top ! set Registers {} ! set tmp [gdb_regnames] ! foreach pair $tmp { ! lappend Registers [lindex $pair 0] ! } if {$Line != ""} { set Locals [gdb_get_locals "$File:$Line"] set Args [gdb_get_args "$File:$Line"] Index: gdb/gdbtk/library/regwin.itb =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/regwin.itb,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 regwin.itb *** gdb/gdbtk/library/regwin.itb 2000/02/07 00:19:42 1.1.1.1 --- gdb/gdbtk/library/regwin.itb 2000/03/24 23:20:01 *************** *** 77,83 **** set regMaxLen 0 foreach r [gdb_regnames] { ! set l [string length $r] if {$l > $regMaxLen} { set regMaxLen $l } --- 77,83 ---- set regMaxLen 0 foreach r [gdb_regnames] { ! set l [string length [lindex $r 0]] if {$l > $regMaxLen} { set regMaxLen $l } *************** *** 187,206 **** set reg_display_list {} set regnames [gdb_regnames] set i 1 - set rn 0 foreach r $regnames { ! set reg_display($rn,name) $r ! set format [pref getd gdb/reg/$r-format] if {$format == ""} { set format x } set reg_display($rn,format) $format ! if {$args != "" && [pref getd gdb/reg/$r] == "no"} { set reg_display($rn,line) 0 } else { set reg_display($rn,line) $i lappend reg_display_list $rn incr i } - incr rn } set num_regs [expr {$i - 1}] set max_regs $rn --- 187,206 ---- set reg_display_list {} set regnames [gdb_regnames] set i 1 foreach r $regnames { ! set name [lindex $r 0] ! set rn [lindex $r 1] ! set reg_display($rn,name) $name ! set format [pref getd gdb/reg/$name-format] if {$format == ""} { set format x } set reg_display($rn,format) $format ! if {$args != "" && [pref getd gdb/reg/$name] == "no"} { set reg_display($rn,line) 0 } else { set reg_display($rn,line) $i lappend reg_display_list $rn incr i } } set num_regs [expr {$i - 1}] set max_regs $rn >From kettenis@wins.uva.nl Sat Apr 01 00:00:00 2000 From: Mark Kettenis To: gdb-patches@sourceware.cygnus.com Cc: ac131313@cygnus.com Subject: [PATCH] Fix for target.c:do_target_signal_to_host() Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200002142116.e1ELGrL06391@delius.kettenis.local> X-SW-Source: 2000-q1/msg00147.html Content-length: 1054 Hi, I noticed that under Linux, if I send a RT signal N to the program I'm debugging, GDB actually sends signal N - 1, e.g. if you continue with signal SIG35 GDB will tell you that the program terminated with SIG34. The appended patch fixes this. Mark 2000-02-14 Mark Kettenis * target.c (do_target_signal_to_host): Do not use REALTIME_LO in the conversion of the signal number. TARGET_SIGNAL_REALTIME_33 is 33 by definition, whereas REALTIME_LO might be 32 on systems that have SIG32 such as Linux. Index: gdb/target.c =================================================================== RCS file: /cvs/src/src/gdb/target.c,v retrieving revision 1.2 diff -u -r1.2 target.c --- gdb/target.c 2000/02/09 08:52:47 1.2 +++ gdb/target.c 2000/02/14 21:09:27 @@ -2061,7 +2061,7 @@ && oursig <= TARGET_SIGNAL_REALTIME_63) { int retsig = - (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + REALTIME_LO; + (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33; if (retsig < REALTIME_HI) return retsig; } >From eliz@delorie.com Sat Apr 01 00:00:00 2000 From: Eli Zaretskii To: hjl@lucon.org Cc: gdb@sourceware.cygnus.com, gdb-patches@sourceware.cygnus.com Subject: Re: Problems with hardware watchpoint on ia32. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003091211.HAA19860@indy.delorie.com> References: <20000307132401.A20282@valinux.com> <200003081008.FAA16481@indy.delorie.com> <20000308084304.A3150@lucon.org> X-SW-Source: 2000-q1/msg00613.html Content-length: 1704 Problem no.2: Read watchpoints break when they shouldn't. Example (slightly modified test program posted by H.J. Lu): $ cat wp.c int a1; int a2; int a3; int a4; int a5; int a6; unsigned long long ulla1 = 0; double da2 = 0; int main (void) { a2 = 12; a3 = 13; a4 = 14; a5 = 15; a6 = 16; a1 = 11; a2 = a4; ulla1 = 0x00000000ffffffffLL; da2 = 12; ulla1 = 0xffffffff00000000LL; return 0; } $ gcc -g -o wp wp.c $ gdb wp (gdb) watch a5 Hardware watchpoint 2: a5 (gdb) rwatch a5 Hardware read watchpoint 3: a5 (gdb) run Starting program g:/gdbsnap/gdb-0222/gdb/wp Hardware watchpoint 2: a5 Old value = 0 New value = 15 Hardware read watchpoint 3: a5 Value = 15 main () at wp.c: 16 16 a5 = 15; (gdb) Now, it might seem like a strange idea to put two watchpoints on the same variable, but it is a very useful feature when each watchpoint has a different condition. Here's the patch: 2000-03-08 Eli Zaretskii * breakpoint.c (bpstat_stop_status): Don't stop if a read watchpoint appears to break, but the watched value changed. --- gdb/breakpoint.c~2 Wed Mar 8 19:20:28 2000 +++ gdb/breakpoint.c Wed Mar 8 20:02:20 2000 @@ -2620,6 +2620,17 @@ bpstat_stop_status (pc, not_a_breakpoint /* Stop. */ break; case WP_VALUE_CHANGED: + if (b->type == bp_read_watchpoint) + { + /* Don't stop: read watchpoints shouldn't fire if + the value has changed. This is for targets which + cannot set read-only watchpoints. */ + bs->print_it = print_it_noop; + bs->stop = 0; + continue; + } + ++(b->hit_count); + break; case WP_VALUE_NOT_CHANGED: /* Stop. */ ++(b->hit_count); >From fnasser@cygnus.com Sat Apr 01 00:00:00 2000 From: Fernando Nasser To: gdb-patches@sourceware.cygnus.com Subject: set unwindonsignal (REPOST) Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38A32C86.3737D80D@cygnus.com> References: <38A30E94.F92D0E35@cygnus.com> X-SW-Source: 2000-q1/msg00116.html Content-length: 1499 (Sorry, someone just pointed to me that I said rewind. I meant unwind, not rewind...) We have two groups of users who want different behavior of gdb when a signal is received as a consequence of a "call somefunction()" command. One wants gdb to return to the state it was before and the other wants gdb to stay in the stack frame where the signal was received, as this can be used to debug some situations (note that, depending on the OS and the context, this can result in a state where execution is not possible anymore). The way to get everyone happy is to add a "set unwindonsignal" which, if "on", will cause the stack to be unwound and the context fully restored when a signal happens on the inferior call. It does not affect breakpoints, which do stop in the frame where they occurred (even if inner than a dummy frame). The default will be "off", as the original gdb behavior was to stop inside the frame. I have changed this temporarily in the snapshots due to a few bugs that we are working on, but as the switch will be available for those affected (they can add it to their .gdbinit files), I will revert in time for the next release. If you think this may have any impact on your work please let me know (but remember you can set the switch anyway you want). -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@cygnus.com 2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311 Toronto, Ontario M4P 2C9 Fax: 416-482-6299 >From jimb@zwingli.cygnus.com Sat Apr 01 00:00:00 2000 From: Jim Blandy To: Eli Zaretskii Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH] "OVERLAY ON" does not exist. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: References: <200003191218.HAA08362@indy.delorie.com> X-SW-Source: 2000-q1/msg00827.html Content-length: 1213 > Caught this small glitch while running the test suite. > > Okay to commit? Sure. But I think it should mention both ways to turn it on: Overlay debugging not enabled. Use either the `overlay auto' or the `overlay manual' command. > > 2000-03-16 Eli Zaretskii > > * symfile.c (map_overlay_command, unmap_overlay_command): Fix > error message: there's no "overlay on" command. > > --- gdb/symfile.c~0 Thu Feb 3 06:35:14 2000 > +++ gdb/symfile.c Thu Mar 16 22:57:26 2000 > @@ -2912,7 +2912,7 @@ > asection *bfdsec; > > if (!overlay_debugging) > - error ("Overlay debugging not enabled. Use the 'OVERLAY ON' command."); > + error ("Overlay debugging not enabled. Use the 'OVERLAY AUTO' command."); > > if (args == 0 || *args == 0) > error ("Argument required: name of an overlay section"); > @@ -2962,7 +2962,7 @@ > struct obj_section *sec; > > if (!overlay_debugging) > - error ("Overlay debugging not enabled. Use the 'OVERLAY ON' command."); > + error ("Overlay debugging not enabled. Use the 'OVERLAY AUTO' command."); > > if (args == 0 || *args == 0) > error ("Argument required: name of an overlay section"); > >From ac131313@cygnus.com Sat Apr 01 00:00:00 2000 From: Andrew Cagney To: Jim Kingdon Cc: gdb-patches@sourceware.cygnus.com Subject: Re: make_cleanup_func elimination Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38D6D79A.6BA38653@cygnus.com> References: <200003192252.RAA14902@devserv.devel.redhat.com> <38D6296A.8595506@cygnus.com> <200003201434.JAA11351@devserv.devel.redhat.com> X-SW-Source: 2000-q1/msg00842.html Content-length: 374 Jim Kingdon wrote: > Now, if you want an opinion, I don't think you should make the person > who takes this on next go to each and every maintainer whose code is > touched. That makes it a daunting job and IMHO isn't needed for this > particular situation. But it is your call rather than mine. FYI, I've added it to my post 5.0 box and will merge it in then. Andrew >From kingdon@redhat.com Sat Apr 01 00:00:00 2000 From: Jim Kingdon To: gdb-patches@sourceware.cygnus.com Subject: Fixes to auto-solib-add documentation. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003120053.TAA08449@devserv.devel.redhat.com> X-SW-Source: 2000-q1/msg00652.html Content-length: 1742 The non-HPUX thing should be self-explanatory. The other one is a response to the problems by which "set auto-solib-add 0" on Linux with threaded programs can be one source of spurious SIGTRAP's. I'd much rather provide a way for GDB to detect this situation and print a warning or something, but I looked at the code a bit and it wasn't clear there was a good way to do that. So documenting it is better than nothing. 2000-03-10 Jim Kingdon * gdb.texinfo (Files): document "set auto-solib-add" for non-HPUX and also mention the thing about setting it to 0 in .gdbinit. Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.1.1.14 diff -u -r1.1.1.14 gdb.texinfo --- gdb.texinfo 2000/01/18 00:54:25 1.1.1.14 +++ gdb.texinfo 2000/03/12 00:16:48 @@ -7909,6 +7909,17 @@ Otherwise, symbols must be loaded manually, using the @code{sharedlibrary} command. The default threshold is 100 megabytes. +On non HP-UX systems which support shared libraries, the auto-solib-add +setting still exists, but it is simply zero for manual loading and +nonzero to load libraries automatically. + +Note that setting manual loading can sometimes have unexpected +consequences, since @value{GDBN} itself may be looking for some of the +symbols to be present to perform its own tasks (including thread +debugging for example). One technique which can help is to set +auto-solib-add to zero only after you have started your program running +and the basic libraries (such as thread libraries) have been loaded. + @kindex show auto-solib-add @item show auto-solib-add Display the current autoloading size threshold, in megabytes. >From gkm@cygnus.com Sat Apr 01 00:00:00 2000 From: gkm@cygnus.com (glen mccready) To: Elena Zannoni , gdb-patches@sourceware.cygnus.com Cc: Fernando Nasser , Chris Faylor Subject: sim/arm/wrapper.c fix. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003222045.MAA03959@cygint.cygnus.com> X-SW-Source: 2000-q1/msg00912.html Content-length: 1457 Index: ChangeLog =================================================================== RCS file: /cvs/cvsfiles/devo/sim/arm/ChangeLog,v retrieving revision 1.77 diff -c -b -r1.77 ChangeLog *** ChangeLog 1998/09/14 17:04:36 1.77 --- ChangeLog 2000/03/22 20:27:15 *************** *** 1,3 **** --- 1,7 ---- + Wed Mar 22 15:24:21 2000 glen mccready + + * wrapper.c (sim_open,sim_close): Copy into myname, free myname + Mon Sep 14 09:00:05 1998 Nick Clifton * wrapper.c (sim_open): Set endianness according to BFD or command Index: wrapper.c =================================================================== RCS file: /cvs/cvsfiles/devo/sim/arm/wrapper.c,v retrieving revision 1.24 diff -c -b -r1.24 wrapper.c *** wrapper.c 1998/09/14 17:04:36 1.24 --- wrapper.c 2000/03/22 20:27:15 *************** *** 347,353 **** char **argv; { sim_kind = kind; ! myname = argv[0]; sim_callback = ptr; /* Decide upon the endian-ness of the processor. --- 347,354 ---- char **argv; { sim_kind = kind; ! if (myname) free(myname); ! myname = xstrdup(argv[0]); sim_callback = ptr; /* Decide upon the endian-ness of the processor. *************** *** 405,411 **** SIM_DESC sd; int quitting; { ! /* nothing to do */ } SIM_RC --- 406,413 ---- SIM_DESC sd; int quitting; { ! if (myname) free(myname); ! myname = 0; } SIM_RC >From kevinb@cygnus.com Sat Apr 01 00:00:00 2000 From: Kevin Buettner To: gdb-patches@sourceware.cygnus.com Subject: [PATCH RFA] Makefile.in, configure.tgt changes for linux/ppc Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <1000221204205.ZM8213@ocotillo.lan> X-SW-Source: 2000-q1/msg00287.html Content-length: 3418 Most of the changes below are for linux/ppc. While editing Makefile.in, I noticed that there were a couple of files which depend on $(language_h) which is undefined. So I changed these to language.h instead. I request approval for committing these changes. * Makefile.in (ppc-linux-nat.o, ppc-linux-tdep.o): New files. (ppc-linux-nat.o, ppc-linux-tdep.o): Add dependencies. (m68klinux-nat.o, varobj.o): Depend on language.h, not $(language_h). * configure.tgt (powerpc-*-linux*): Separate from powerpc-*-eabi and like targets. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.3 diff -u -p -r1.3 Makefile.in --- Makefile.in 2000/02/09 08:52:44 1.3 +++ Makefile.in 2000/02/21 20:22:16 @@ -1048,6 +1048,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 2 nindy-share/ttyflush.c nindy-tdep.c \ ns32k-tdep.c ns32km3-nat.c osfsolib.c \ somread.c somsolib.c $(HPREAD_SOURCE) \ + ppc-linux-nat.c ppc-linux-tdep.c \ procfs.c pyr-tdep.c pyr-xdep.c \ remote-adapt.c remote-array.c remote-bug.c remote-e7000.c remote-eb.c \ remote-es.c remote-hms.c remote-mips.c \ @@ -1418,7 +1419,7 @@ m68k-tdep.o: m68k-tdep.c $(defs_h) $(fra m68kly-nat.o: m68kly-nat.c $(defs_h) $(frame_h) $(inferior_h) target.h m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ - $(language_h) $(gdbcore_h) $(floatformat_h) target.h + $(gdbcore_h) $(floatformat_h) language.h target.h m88k-nat.o: m88k-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) @@ -1528,6 +1529,12 @@ ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore $(inferior_h) $(bfd_h) symfile.h target.h gdb_wait.h $(gdbcmd_h) \ objfiles.h gdb-stabs.h serial.h ocd.h +ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdbcore_h) $(frame_h) \ + $(inferior_h) target.h + +ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + target.h + ppcbug-rom.o: ppcbug-rom.c monitor.h $(bfd_h) gdb_wait.h $(defs_h) $(gdbcmd_h) \ $(inferior_h) target.h serial.h terminal.h @@ -1855,7 +1862,7 @@ gdb-events.o: gdb-events.c gdb-events.h ui-out.o: ui-out.c $(defs_h) $(ui_out_h) expression.h language.h cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h) varobj.o: varobj.c $(defs_h) $(frame_h) $(value_h) \ - $(language_h) valprint.h varobj.h + language.h valprint.h varobj.h $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $< wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) wrapper.h Index: configure.tgt =================================================================== RCS file: /cvs/src/src/gdb/configure.tgt,v retrieving revision 1.2 diff -u -p -r1.2 configure.tgt --- configure.tgt 2000/02/13 01:06:57 1.2 +++ configure.tgt 2000/02/21 20:22:17 @@ -224,7 +224,7 @@ powerpc-*-netware*) gdb_target=ppc-nw powerpc-*-aix*) gdb_target=aix ;; powerpcle-*-cygwin*) gdb_target=cygwin ;; powerpcle-*-solaris*) gdb_target=solaris ;; -powerpc-*-eabi* | powerpc-*-linux* | powerpc-*-sysv* | powerpc-*-elf*) +powerpc-*-eabi* | powerpc-*-sysv* | powerpc-*-elf*) if test -f ../sim/ppc/Makefile; then gdb_target=ppc-sim else @@ -236,6 +236,7 @@ powerpcle-*-eabi* | powerpcle-*-sysv* | else gdb_target=ppcle-eabi fi ;; +powerpc-*-linux*) gdb_target=linux ;; powerpc-*-vxworks*) gdb_target=vxworks ;; # OBSOLETE pyramid-*-*) gdb_target=pyramid ;; -- Kevin Buettner kev@primenet.com, kevinb@redhat.com >From fnasser@cygnus.com Sat Apr 01 00:00:00 2000 From: Fernando Nasser To: msnyder@cygnus.com Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH]: swat warnings in wrapper.c Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <38E3ADDC.71C74B87@cygnus.com> References: <200003240133.RAA21744@seadog.cygnus.com> X-SW-Source: 2000-q1/msg01129.html Content-length: 4880 Good catch. Looks OK to me. Fernando msnyder@cygnus.com wrote: > > This module uses a struct to pass multiple arguments between > wrapper functions. At various times it casts pointers to ints > and vice versa. I've modified it to use a union, so that we > don't get warnings when pointer and int are of different size. > > 2000-03-23 Michael Snyder > > * wrapper.[ch] (struct gdb_wrapper_arguments): change fields into > unions, since they are all used to hold both pointers and ints > at various times. Casting pointer to int and vice versa gives > warnings (and is not safe) if they are not the same size. > > Index: ChangeLog > =================================================================== > RCS file: /cvs/src/src/gdb/ChangeLog,v > retrieving revision 1.170 > diff -r1.170 ChangeLog > 0a1,7 > > 2000-03-23 Michael Snyder > > > > * wrapper.[ch] (struct gdb_wrapper_arguments): change fields into > > unions, since they are all used to hold both pointers and ints > > at various times. Casting pointer to int and vice versa gives > > warnings (and is not safe) if they are not the same size. > > > Index: wrapper.c > =================================================================== > RCS file: /cvs/src/src/gdb/wrapper.c,v > retrieving revision 1.2 > diff -r1.2 wrapper.c > 24c24 > < /* Use this struct used to pass arguments to wrapper routines. We assume > --- > > /* Use this struct to pass arguments to wrapper routines. We assume > 30c30,35 > < char *result; > --- > > union wrapper_results > > { > > int integer; > > void *pointer; > > } result; > > > 33c38,42 > < char *args[10]; > --- > > union wrapper_args > > { > > int integer; > > void *pointer; > > } args[10]; > 60,62c69,71 > < args.args[0] = (char *) stringptr; > < args.args[1] = (char *) block; > < args.args[2] = (char *) comma; > --- > > args.args[0].pointer = stringptr; > > args.args[1].pointer = block; > > args.args[2].integer = comma; > 71c80 > < *expression = (struct expression *) args.result; > --- > > *expression = (struct expression *) args.result.pointer; > 82,84c91,93 > < args->result = (char *) parse_exp_1((char **) args->args[0], > < (struct block *) args->args[1], > < (int) args->args[2]); > --- > > args->result.pointer = parse_exp_1((char **) args->args[0].pointer, > > (struct block *) args->args[1].pointer, > > args->args[2].integer); > 94c103 > < args.args[0] = (char *) exp; > --- > > args.args[0].pointer = exp; > 103c112 > < *value = (value_ptr) args.result; > --- > > *value = (value_ptr) args.result.pointer; > 113,114c122,123 > < (args)->result = > < (char *) evaluate_expression ((struct expression *) (args)->args[0]); > --- > > (args)->result.pointer = > > (char *) evaluate_expression ((struct expression *) args->args[0].pointer); > 124c133 > < args.args[0] = (char *) value; > --- > > args.args[0].pointer = value; > 135c144 > < value_fetch_lazy ((value_ptr) (args)->args[0]); > --- > > value_fetch_lazy ((value_ptr) (args)->args[0].pointer); > 147,148c156,157 > < args.args[0] = (char *) val1; > < args.args[1] = (char *) val2; > --- > > args.args[0].pointer = val1; > > args.args[1].pointer = val2; > 157c166 > < *result = (int) args.result; > --- > > *result = args.result.integer; > 168,169c177,178 > < val1 = (value_ptr) (args)->args[0]; > < val2 = (value_ptr) (args)->args[1]; > --- > > val1 = (value_ptr) (args)->args[0].pointer; > > val2 = (value_ptr) (args)->args[1].pointer; > 171c180 > < (args)->result = (char *) value_equal (val1, val2); > --- > > (args)->result.integer = value_equal (val1, val2); > 182c191 > < args.args[0] = (char *) val; > --- > > args.args[0].pointer = val; > 191c200 > < *rval = (value_ptr) args.result; > --- > > *rval = (value_ptr) args.result.pointer; > 202,203c211,212 > < val = (value_ptr) (args)->args[0]; > < (args)->result = (char *) value_ind (val); > --- > > val = (value_ptr) (args)->args[0].pointer; > > (args)->result.pointer = value_ind (val); > Index: wrapper.h > =================================================================== > RCS file: /cvs/src/src/gdb/wrapper.h,v > retrieving revision 1.2 > diff -r1.2 wrapper.h > 22c22 > < /* Use this struct used to pass arguments to wrapper routines. */ > --- > > /* Use this struct to pass arguments to wrapper routines. */ -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@cygnus.com 2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311 Toronto, Ontario M4P 2C9 Fax: 416-482-6299 >From kettenis@wins.uva.nl Sat Apr 01 00:00:00 2000 From: Mark Kettenis To: hjl@lucon.org Cc: gdb-patches@sourceware.cygnus.com, gdb@sourceware.cygnus.com Subject: Re: A revised patch for dlclose Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003080119.e281Jul00524@delius.kettenis.local> References: <20000307120800.A27315@valinux.com> <200003080058.e280wga00453@delius.kettenis.local> <20000307170321.A884@lucon.org> X-SW-Source: 2000-q1/msg00576.html Content-length: 737 Date: Tue, 7 Mar 2000 17:03:21 -0800 From: "H . J . Lu" Cc: gdb-patches@sourceware.cygnus.com, gdb@sourceware.cygnus.com Content-Type: text/plain; charset=us-ascii > HJ, please stop wasting your time pushing this patch. The patch has > several bad points, that you cannot fix without considerable changes > to the way solib.c handles and caches the link map. I just pointed out gdb needed to check the unloaded DSOs when handling the BPSTAT_WHAT_CHECK_SHLIBS and BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK events. It is a serious bug to me and it should be fixed in 5.0. I don't care how it is fixed. But I, and I hope most of the other GDB maintainers, do care how it is fixed! Mark >From ian@zembu.com Sat Apr 01 00:00:00 2000 From: Ian Lance Taylor To: eliz@delorie.com Cc: binutils@sourceware.cygnus.com, gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH] libopcodes on MS-DOS Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <20000227160820.12913.qmail@daffy.airs.com> References: <200002270903.EAA25069@indy.delorie.com> X-SW-Source: 2000-q1/msg00380.html Content-length: 826 Date: Sun, 27 Feb 2000 04:03:13 -0500 (EST) From: Eli Zaretskii The following changes handle two problems with building libbfd on 8+3 (a.k.a. DOS) filesystems. They get in the way when building with DJGPP tools. I found this while building the latest snapshot of GDB. 2000-02-26 Eli Zaretskii * aclocal.m4 (AC_SYS_NM_PARSE): Use mconftest.$objext, not conftestm.$objext, since the latter overwrites conftest.$objext on 8+3 filesystems. aclocal.m4 is a generated file, so patching it has no long term effect. This particular macro comes from libtool. This should be fixed in libtool, not in the binutils. Actually, I set that that macro is no longer in libtool 1.3, so really what we need to do is upgrade to a newer version of libtool. Ian >From jimb@cygnus.com Sat Apr 01 00:00:00 2000 From: Jim Blandy To: David Taylor , Andrew Cagney Cc: gdb-patches@sourceware.cygnus.com Subject: RFA: put COERCE_FLOAT_TO_DOUBLE under gdbarch's control Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200002182240.RAA27442@zwingli.cygnus.com> X-SW-Source: 2000-q1/msg00246.html Content-length: 22781 For this, I need approval from: - David Taylor, for the changes to valops.c and value.h - Andrew Cagney, for the changes to gdbarch.{sh,c,h} (which you've seen before), and to mips-tdep.c (you haven't seen those before). The changes to the eight target-specific files are trivial, so I don't think we need approval from those port maintainers. It still compiles and runs for MIPS and D10V (which are multi-arched targets) and for Solaris UltraSPARC (which isn't). gdb/ChangeLog: 2000-02-18 Jim Blandy * gdbarch.sh: Make the `default' field really default to zero, as documented. Bring COERCE_FLOAT_TO_DOUBLE under gdbarch's control. * valops.c (COERCE_FLOAT_TO_DOUBLE): Rework definition to be more function-like. (default_coerce_float_to_double, standard_coerce_float_to_double): New functions. * value.h (default_coerce_float_to_double, standard_coerce_float_to_double): New declarations for the above. * gdbarch.sh (coerce_float_to_double): New entry, replacing macro. * gdbarch.c, gdbarch.h: Regenerated. * tm-alpha.h, tm-fr30.h, tm-m32r.h, tm-mips.h, tm-hppa.h, tm-rs6000.h, tm-sh.h, tm-sparc.h (COERCE_FLOAT_TO_DOUBLE): Change definitions. * mips-tdep.c (mips_coerce_float_to_double): Supply our own custom function here. (mips_gdbarch_init): Install that as our coerce_float_to_double function. gdb/doc/ChangeLog: 2000-02-18 Jim Blandy * gdbint.texinfo: Document COERCE_FLOAT_TO_DOUBLE --- the new form. Index: valops.c =================================================================== RCS file: /cvs/src/src/gdb/valops.c,v retrieving revision 1.1.1.11 diff -c -r1.1.1.11 valops.c *** valops.c 2000/02/01 03:19:12 1.1.1.11 --- valops.c 2000/02/18 22:29:53 *************** *** 34,48 **** #include #include "gdb_string.h" - /* Default to coercing float to double in function calls only when there is - no prototype. Otherwise on targets where the debug information is incorrect - for either the prototype or non-prototype case, we can force it by defining - COERCE_FLOAT_TO_DOUBLE in the target configuration file. */ - - #ifndef COERCE_FLOAT_TO_DOUBLE - #define COERCE_FLOAT_TO_DOUBLE (param_type == NULL) - #endif - /* Flag indicating HP compilers were used; needed to correctly handle some value operations with HP aCC code/runtime. */ extern int hp_som_som_object_present; --- 34,39 ---- *************** *** 1124,1129 **** --- 1115,1156 ---- } + /* If we have no definition for this macro, either from the target or + from gdbarch, provide a default. */ + #ifndef COERCE_FLOAT_TO_DOUBLE + #define COERCE_FLOAT_TO_DOUBLE(formal, actual) \ + (default_coerce_float_to_double ((formal), (actual))) + #endif + + + /* A default function for COERCE_FLOAT_TO_DOUBLE: do the coercion only + when we don't have any type for the argument at hand. This occurs + when we have no debug info, or when passing varargs. + + This is an annoying default: the rule the compiler follows is to do + the standard promotions whenever there is no prototype in scope, + and almost all targets want this behavior. But there are some old + architectures which want this odd behavior. If you want to go + through them all and fix them, please do. Modern gdbarch-style + targets may find it convenient to use standard_coerce_float_to_double. */ + int + default_coerce_float_to_double (struct type *formal, struct type *actual) + { + return formal == NULL; + } + + + /* Always coerce floats to doubles when there is no prototype in scope. + If your architecture follows the standard type promotion rules for + calling unprototyped functions, your gdbarch init function can pass + this function to set_gdbarch_coerce_float_to_double to use its logic. */ + int + standard_coerce_float_to_double (struct type *formal, struct type *actual) + { + return 1; + } + + /* Perform the standard coercions that are specified for arguments to be passed to C functions. *************** *** 1171,1177 **** non-prototyped case. As many debugging formats include no information about prototyping, we have to live with COERCE_FLOAT_TO_DOUBLE for now. */ ! if (!is_prototyped && COERCE_FLOAT_TO_DOUBLE) { if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double)) type = builtin_type_double; --- 1198,1204 ---- non-prototyped case. As many debugging formats include no information about prototyping, we have to live with COERCE_FLOAT_TO_DOUBLE for now. */ ! if (!is_prototyped && COERCE_FLOAT_TO_DOUBLE (param_type, arg_type)) { if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_double)) type = builtin_type_double; Index: value.h =================================================================== RCS file: /cvs/src/src/gdb/value.h,v retrieving revision 1.1.1.10 diff -c -r1.1.1.10 value.h *** value.h 2000/02/02 00:21:11 1.1.1.10 --- value.h 2000/02/18 22:29:54 *************** *** 549,554 **** --- 549,558 ---- extern value_ptr call_function_by_hand PARAMS ((value_ptr, int, value_ptr *)); + extern int default_coerce_float_to_double (struct type *, struct type *); + + extern int standard_coerce_float_to_double (struct type *, struct type *); + extern value_ptr value_literal_complex PARAMS ((value_ptr, value_ptr, struct type *)); extern void find_rt_vbase_offset PARAMS ((struct type *, struct type *, char *, int, int *, int *)); Index: gdbarch.sh =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.sh,v retrieving revision 1.1.1.5 diff -c -r1.1.1.5 gdbarch.sh *** gdbarch.sh 1999/12/14 01:05:30 1.1.1.5 --- gdbarch.sh 2000/02/18 22:29:55 *************** *** 180,185 **** --- 180,186 ---- # v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::0:::::# v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::0:::::# + f:2:COERCE_FLOAT_TO_DOUBLE:int:coerce_float_to_double:struct type *formal, struct type *actual:formal, actual:::default_coerce_float_to_double f:1:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval::generic_get_saved_register:0 # f:1:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr::0:0 *************** *** 881,887 **** function_list | while eval read $read do case "${class}" in ! "i" ) echo " ${default}," ;; esac done cat <call_dummy_length = -1; gdbarch->call_dummy_p = -1; gdbarch->call_dummy_stack_adjust_p = -1; + gdbarch->coerce_float_to_double = default_coerce_float_to_double; gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; gdbarch->decr_pc_after_break = -1; *************** *** 488,493 **** --- 491,499 ---- if ((GDB_MULTI_ARCH >= 2) && (gdbarch->fix_call_dummy == 0)) internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid"); + if ((GDB_MULTI_ARCH >= 2) + && (gdbarch->coerce_float_to_double == default_coerce_float_to_double)) + internal_error ("gdbarch: verify_gdbarch: coerce_float_to_double invalid"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->get_saved_register == 0)) internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid"); *************** *** 770,775 **** --- 776,785 ---- (long) BELIEVE_PCC_PROMOTION_TYPE); #endif fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n", + (long) current_gdbarch->coerce_float_to_double + /*COERCE_FLOAT_TO_DOUBLE ()*/); + fprintf_unfiltered (gdb_stdlog, "gdbarch_update: GET_SAVED_REGISTER = 0x%08lx\n", (long) current_gdbarch->get_saved_register /*GET_SAVED_REGISTER ()*/); *************** *** 1730,1735 **** --- 1740,1763 ---- int believe_pcc_promotion_type) { gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type; + } + + int + gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual) + { + if (gdbarch->coerce_float_to_double == 0) + internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid"); + if (gdbarch_debug >= 2) + /* FIXME: gdb_std??? */ + fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n"); + return gdbarch->coerce_float_to_double (formal, actual); + } + + void + set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, + gdbarch_coerce_float_to_double_ftype coerce_float_to_double) + { + gdbarch->coerce_float_to_double = coerce_float_to_double; } void Index: gdbarch.h =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.h,v retrieving revision 1.1.1.15 diff -c -r1.1.1.15 gdbarch.h *** gdbarch.h 1999/12/14 01:05:30 1.1.1.15 --- gdbarch.h 2000/02/18 22:29:57 *************** *** 465,470 **** --- 465,479 ---- #endif #endif + typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual); + extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual); + extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double); + #if GDB_MULTI_ARCH + #if (GDB_MULTI_ARCH > 1) || !defined (COERCE_FLOAT_TO_DOUBLE) + #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual)) + #endif + #endif + typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register); Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.1.1.14 diff -c -r1.1.1.14 mips-tdep.c *** mips-tdep.c 1999/12/22 21:45:05 1.1.1.14 --- mips-tdep.c 2000/02/18 22:29:59 *************** *** 3639,3645 **** --- 3639,3663 ---- } + /* If the current gcc for for this target does not produce correct debugging + information for float parameters, both prototyped and unprototyped, then + define this macro. This forces gdb to always assume that floats are + passed as doubles and then converted in the callee. + + For the mips chip, it appears that the debug info marks the parameters as + floats regardless of whether the function is prototyped, but the actual + values are passed as doubles for the non-prototyped case and floats for + the prototyped case. Thus we choose to make the non-prototyped case work + for C and break the prototyped case, since the non-prototyped case is + probably much more common. (FIXME). */ + static int + mips_coerce_float_to_double (struct type *formal, struct type *actual) + { + return current_language->la_language == language_c; + } + + static gdbarch_init_ftype mips_gdbarch_init; static struct gdbarch * mips_gdbarch_init (info, arches) *************** *** 3835,3840 **** --- 3853,3859 ---- set_gdbarch_push_return_address (gdbarch, mips_push_return_address); set_gdbarch_push_arguments (gdbarch, mips_push_arguments); set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); + set_gdbarch_coerce_float_to_double (gdbarch, mips_coerce_float_to_double); set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid); set_gdbarch_get_saved_register (gdbarch, default_get_saved_register); Index: doc/gdbint.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v retrieving revision 1.1.1.21 diff -c -r1.1.1.21 gdbint.texinfo *** gdbint.texinfo 2000/02/01 03:19:13 1.1.1.21 --- gdbint.texinfo 2000/02/18 22:30:02 *************** *** 1307,1312 **** --- 1307,1335 ---- Currently only implemented correctly for native Sparc configurations? + @item COERCE_FLOAT_TO_DOUBLE (@var{formal}, @var{actual}) + If we are calling a function by hand, and the function was declared + (according to the debug info) without a prototype, should we + automatically promote floats to doubles? This macro must evaluate to + non-zero if we should, or zero if we should leave the value alone. + + The argument @var{actual} is the type of the value we want to pass to + the function. The argument @var{formal} is the type of this argument, + as it appears in the function's definition. Note that @var{formal} may + be zero if we have no debugging information for the function, or if + we're passing more arguments than are officially declared (for example, + varargs). This macro is never invoked if the function definitely has a + prototype. + + The default behavior is to promote only when we have no type information + for the formal parameter. This is different from the obvious behavior, + which would be to promote whenever we have no prototype, just as the + compiler does. It's annoying, but some older targets rely on this. If + you want GDB to follow the typical compiler behavior --- to always + promote when there is no prototype in scope --- your gdbarch init + function can call @code{set_gdbarch_coerce_float_to_double} and select + the @code{standard_coerce_float_to_double} function. + @item CPLUS_MARKER Define this to expand into the character that G++ uses to distinguish compiler-generated identifiers from programmer-specified identifiers. Index: config/alpha/tm-alpha.h =================================================================== RCS file: /cvs/src/src/gdb/config/alpha/tm-alpha.h,v retrieving revision 1.1.1.7 diff -c -r1.1.1.7 tm-alpha.h *** tm-alpha.h 1999/09/08 23:59:48 1.1.1.7 --- tm-alpha.h 2000/02/18 22:30:02 *************** *** 445,451 **** values are always passed in as doubles. Thus by setting this to 1, both types of calls will work. */ ! #define COERCE_FLOAT_TO_DOUBLE 1 /* Return TRUE if procedure descriptor PROC is a procedure descriptor that refers to a dynamically generated sigtramp function. --- 445,451 ---- values are always passed in as doubles. Thus by setting this to 1, both types of calls will work. */ ! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) /* Return TRUE if procedure descriptor PROC is a procedure descriptor that refers to a dynamically generated sigtramp function. Index: config/fr30/tm-fr30.h =================================================================== RCS file: /cvs/src/src/gdb/config/fr30/tm-fr30.h,v retrieving revision 1.1.1.7 diff -c -r1.1.1.7 tm-fr30.h *** tm-fr30.h 1999/12/14 01:05:40 1.1.1.7 --- tm-fr30.h 2000/02/18 22:30:02 *************** *** 234,237 **** should be true on any system where you can rely on the prototyping information. When this is true, value_arg_coerce will promote floats to doubles iff the function is not prototyped. */ ! #define COERCE_FLOAT_TO_DOUBLE 1 --- 234,237 ---- should be true on any system where you can rely on the prototyping information. When this is true, value_arg_coerce will promote floats to doubles iff the function is not prototyped. */ ! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) Index: config/m32r/tm-m32r.h =================================================================== RCS file: /cvs/src/src/gdb/config/m32r/tm-m32r.h,v retrieving revision 1.1.1.8 diff -c -r1.1.1.8 tm-m32r.h *** tm-m32r.h 1999/12/14 01:05:41 1.1.1.8 --- tm-m32r.h 2000/02/18 22:30:03 *************** *** 166,172 **** /* mvs_no_check FRAME_NUM_ARGS */ #define FRAME_NUM_ARGS(fi) (-1) ! #define COERCE_FLOAT_TO_DOUBLE 1 extern void m32r_write_sp (CORE_ADDR val); #define TARGET_WRITE_SP m32r_write_sp --- 166,172 ---- /* mvs_no_check FRAME_NUM_ARGS */ #define FRAME_NUM_ARGS(fi) (-1) ! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) extern void m32r_write_sp (CORE_ADDR val); #define TARGET_WRITE_SP m32r_write_sp Index: config/mips/tm-mips.h =================================================================== RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v retrieving revision 1.1.1.11 diff -c -r1.1.1.11 tm-mips.h *** tm-mips.h 1999/12/22 21:45:14 1.1.1.11 --- tm-mips.h 2000/02/18 22:30:03 *************** *** 500,505 **** --- 500,506 ---- #define ECOFF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32) + #if !GDB_MULTI_ARCH /* If the current gcc for for this target does not produce correct debugging information for float parameters, both prototyped and unprototyped, then define this macro. This forces gdb to always assume that floats are *************** *** 512,518 **** for C and break the prototyped case, since the non-prototyped case is probably much more common. (FIXME). */ ! #define COERCE_FLOAT_TO_DOUBLE (current_language -> la_language == language_c) /* Select the default mips disassembler */ --- 513,520 ---- for C and break the prototyped case, since the non-prototyped case is probably much more common. (FIXME). */ ! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (current_language -> la_language == language_c) ! #endif /* Select the default mips disassembler */ Index: config/pa/tm-hppa.h =================================================================== RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v retrieving revision 1.1.1.12 diff -c -r1.1.1.12 tm-hppa.h *** tm-hppa.h 2000/02/02 00:21:14 1.1.1.12 --- tm-hppa.h 2000/02/18 22:30:04 *************** *** 793,799 **** for C and break the prototyped case, since the non-prototyped case is probably much more common. (FIXME). */ ! #define COERCE_FLOAT_TO_DOUBLE (current_language -> la_language == language_c) /* Here's how to step off a permanent breakpoint. */ #define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint) --- 793,799 ---- for C and break the prototyped case, since the non-prototyped case is probably much more common. (FIXME). */ ! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (current_language -> la_language == language_c) /* Here's how to step off a permanent breakpoint. */ #define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint) Index: config/rs6000/tm-rs6000.h =================================================================== RCS file: /cvs/src/src/gdb/config/rs6000/tm-rs6000.h,v retrieving revision 1.1.1.5 diff -c -r1.1.1.5 tm-rs6000.h *** tm-rs6000.h 1999/08/31 01:07:59 1.1.1.5 --- tm-rs6000.h 2000/02/18 22:30:04 *************** *** 560,563 **** values are always passed in as doubles. Thus by setting this to 1, both types of calls will work. */ ! #define COERCE_FLOAT_TO_DOUBLE 1 --- 560,563 ---- values are always passed in as doubles. Thus by setting this to 1, both types of calls will work. */ ! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) Index: config/sh/tm-sh.h =================================================================== RCS file: /cvs/src/src/gdb/config/sh/tm-sh.h,v retrieving revision 1.1.1.8 diff -c -r1.1.1.8 tm-sh.h *** tm-sh.h 1999/12/14 01:05:42 1.1.1.8 --- tm-sh.h 2000/02/18 22:30:04 *************** *** 269,275 **** #define REGISTER_SIZE 4 ! #define COERCE_FLOAT_TO_DOUBLE 1 #define BELIEVE_PCC_PROMOTION 1 --- 269,275 ---- #define REGISTER_SIZE 4 ! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) #define BELIEVE_PCC_PROMOTION 1 Index: config/sparc/tm-sparc.h =================================================================== RCS file: /cvs/src/src/gdb/config/sparc/tm-sparc.h,v retrieving revision 1.1.1.7 diff -c -r1.1.1.7 tm-sparc.h *** tm-sparc.h 1999/09/09 00:00:06 1.1.1.7 --- tm-sparc.h 2000/02/18 22:30:05 *************** *** 569,575 **** define this macro. This forces gdb to always assume that floats are passed as doubles and then converted in the callee. */ ! #define COERCE_FLOAT_TO_DOUBLE 1 /* Select the sparc disassembler */ --- 569,575 ---- define this macro. This forces gdb to always assume that floats are passed as doubles and then converted in the callee. */ ! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) /* Select the sparc disassembler */ >From taylor@cygnus.com Sat Apr 01 00:00:00 2000 From: David Taylor To: Michael Snyder Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH]: Allow struct compare in expressions. Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200003222057.PAA23063@texas.cygnus.com> X-SW-Source: 2000-q1/msg00915.html Content-length: 5148 From: Michael Snyder Date: Wed, 22 Mar 2000 12:43:56 -0800 (PST) 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 * 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. Approved. 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 + + * 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 * 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 *));