Don Beusee wrote: > > Ugh!! That is too much work. If you will not accept this email as agreement to transfer copyright control over to FSF, then forget it. I am not going through all that hastle just to submit a few very minor enhancements. I'm sorry Don, but them's the rules. If you won't fill out a copywrite assignment, then we cannot accept any gdb patch from you thats bigger than ten lines or so. Anything beyond a few spelling corrections, in other words. These are not our rules, they are the Free Software Foundation's, and they have been in place pretty much since the beginning. From fnasser@cygnus.com Thu Nov 30 15:54:00 2000 From: Fernando Nasser To: Don Beusee Cc: gdb-patches@sourceware.cygnus.com Subject: Re: small enhancements to gdb here.. Date: Thu, 30 Nov 2000 15:54:00 -0000 Message-id: <3A26E89C.52E5D981@cygnus.com> References: <200011302326.eAUNQHT28760@dbeusee.us.oracle.com> X-SW-Source: 2000-11/msg00406.html Content-length: 2185 Don Beusee wrote: > > Ugh!! That is too much work. If you will not accept this email as agreement to transfer copyright control over to FSF, then forget it. I am not going through all that hastle just to submit a few very minor enhancements. > > I gave you the patch already. It is yours to do freely as you wish. I do NOT retain any copyright to it, nor does my company, since it only exists on my workstation and I am the only person who knows about it and using it. > > If these enhancements should appear in the next release of gdb, I will be able to delete the patch & sources from my system. > > I really hope this email is enough for you to accept such a small patch. If it is not, that's too bad... > First of all, it is not for me to decide. GDB was created and is owned by the FSF. The assignment is not for me (I can do nothing with it), but to the FSF. They receive this things, review and file it and them post so we know from who we can accept patches. Second, I believe we all agree with you that it is somewhat of a hassle to have to get an assignment to be able to contribute to Free Software. I have even heard that the FSF hates having to deal with this. However, there are crazy proprietary software companies out there, with loads of highly-payed money-seeking lawyers that would love an opportunity to make GNU software unavailable based on some Intellectual Property claim. To protect Free Software, we must collect assignments. Although I agree it is some extra work, it is really not that bad and it is a one time thing. Once you give them your assignment and they add it to the file you don't need to make another for its validity (you only need another when you change employers, or if you made it specific to a certain change). Lots of people have done that and it doesn't seem to be that bad. It will be a shame if this small step prevents you to contribute to Free Software. It seems that you have good ideas and it would be nice to have you around. Think about it. Regards, Feranndo -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 From shebs@apple.com Thu Nov 30 16:17:00 2000 From: Stan Shebs To: Michael Snyder Cc: Don Beusee , gdb-patches@sourceware.cygnus.com Subject: Re: small enhancements to gdb here.. Date: Thu, 30 Nov 2000 16:17:00 -0000 Message-id: <3A26EE22.81272799@apple.com> References: <200011302326.eAUNQHT28760@dbeusee.us.oracle.com> <3A26E500.1FE1@redhat.com> X-SW-Source: 2000-11/msg00407.html Content-length: 1410 Michael Snyder wrote: > > Don Beusee wrote: > > > > Ugh!! That is too much work. If you will not accept this email as agreement to transfer copyright control over to FSF, then forget it. I am not going through all that hastle just to submit a few very minor enhancements. > > I'm sorry Don, but them's the rules. If you won't fill out > a copywrite assignment, then we cannot accept any gdb patch > from you thats bigger than ten lines or so. Anything beyond > a few spelling corrections, in other words. These are not > our rules, they are the Free Software Foundation's, and they > have been in place pretty much since the beginning. I looked over this patch, and if it were up to me, I would accept it without copyright assignment. It looks big because it gloms together several different changes, and obviously we shouldn't say a submission is "too big" just because the contributor didn't make it as three separate additions. When evaluating changes that are right on the edge of assignability, it's a good idea to evaluate according to the purpose of the policy, which is to ensure that the FSF clearly owns all of the code in GNU. The "10-line" rule is just a guideline, and must be applied with some intelligence - a 1-line version of Cisco's core routing algorithm must definitely have a copyright assignment, while 1000 lines of prototypes and beautification does not need anything. Stan From fnasser@cygnus.com Thu Nov 30 16:22:00 2000 From: Fernando Nasser To: gdb-patches@sources.redhat.com Subject: [patch] CLI separation, take #2 completer.[ch] Date: Thu, 30 Nov 2000 16:22:00 -0000 Message-id: <3A26EF00.C50AD2AC@cygnus.com> X-SW-Source: 2000-11/msg00408.html Content-length: 56406 This is the small part. The big one is coming. I added the linespec.h file Andrew asked for in the first pass (or was it Elena?). The completer still needs a touch-up to be useful for generic code. I rather move the code first and do the changes afterwards so things are properly documented in CVS. I am checking this in soon, so please use "cvs update -d" to get the new files. Fernando 2000-11-30 Fernando Nasser * linespec.h: New file. Declarations for linespec.c. * linespec.c, alpha-tdep.c, breakpoint.c, parse.c, source.c, symtab.c, tracepoint.c: Include the above. * completer.c: New file. Line completion stuff for GDB. (get_gdb_completer_word_break_characters, get_gdb_completer_quote_characters): New functions. Accessors for useful completer internal data. (filename_completer, line_completion_function, skip_quoted): Moved here from top.c. * completer.h: New file. Declarations for the above. * linespec.c (decode_line_1): Use get_gdb_completer_word_break_characters and get_gdb_completer_quote_characters. * top.c: Include completer.h. (filename_completer, line_completion_function, skip_quoted): Moved to completer.c. * corefile.c, exec.c, source.c, symfile.c, linespec.c: Include completer.h. * Makefile.in (SFILES): Add completer.c. (COMMON_OBS): Add completer.o. (completer.o): New target. (linespec.o, alpha-tdep.o, breakpoint.o, parse.o, source.o, symtab.o, tracepoint.o): Add linespec.h to dependencies list. (corefile.o, exec.o, source.o, symfile.o, linespec.o): Add completer.h to dependencies list. Index: linespec.h =================================================================== RCS file: linespec.h diff -N linespec.h *** /dev/null Tue May 5 13:32:27 1998 --- linespec.h Thu Nov 30 16:15:23 2000 *************** *** 0 **** --- 1,27 ---- + /* Header for GDB line completion. + Copyright 2000 Free Software Foundation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #if !defined (LINESPEC_H) + #define LINESPEC_H 1 + + extern struct symtabs_and_lines + decode_line_1 (char **argptr, int funfirstline, + struct symtab *default_symtab, int default_line, + char ***canonical); + + #endif /* defined (LINESPEC_H) */ Index: completer.c =================================================================== RCS file: completer.c diff -N completer.c *** /dev/null Tue May 5 13:32:27 1998 --- completer.c Thu Nov 30 16:15:23 2000 *************** *** 0 **** --- 1,470 ---- + /* Line completion stuff for GDB, the GNU debugger. + Copyright 2000 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #include "defs.h" + #include "symtab.h" + #include "gdbtypes.h" + #include "expression.h" + + /* FIXME: This is needed because of lookup_cmd_1(). + We should be calling a hook instead so we eliminate the CLI dependency. */ + #include "gdbcmd.h" + + /* Needed for rl_completer_word_break_characters() */ + #include + + /* readline defines this. */ + #undef savestring + + #include "completer.h" + + /* Prototypes for local functions */ + + /* readline uses the word breaks for two things: + (1) In figuring out where to point the TEXT parameter to the + rl_completion_entry_function. Since we don't use TEXT for much, + it doesn't matter a lot what the word breaks are for this purpose, but + it does affect how much stuff M-? lists. + (2) If one of the matches contains a word break character, readline + will quote it. That's why we switch between + gdb_completer_word_break_characters and + gdb_completer_command_word_break_characters. I'm not sure when + we need this behavior (perhaps for funky characters in C++ symbols?). */ + + /* Variables which are necessary for fancy command line editing. */ + static char *gdb_completer_word_break_characters = + " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-"; + + /* When completing on command names, we remove '-' from the list of + word break characters, since we use it in command names. If the + readline library sees one in any of the current completion strings, + it thinks that the string needs to be quoted and automatically supplies + a leading quote. */ + static char *gdb_completer_command_word_break_characters = + " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,"; + + /* When completing on file names, we remove from the list of word + break characters any characters that are commonly used in file + names, such as '-', '+', '~', etc. Otherwise, readline displays + incorrect completion candidates. */ + static char *gdb_completer_file_name_break_characters = " \t\n*|\"';:?/><"; + + /* Characters that can be used to quote completion strings. Note that we + can't include '"' because the gdb C parser treats such quoted sequences + as strings. */ + static char *gdb_completer_quote_characters = "'"; + + /* Accessor for some completer data that may interest other files. */ + + char * + get_gdb_completer_word_break_characters (void) + { + return gdb_completer_word_break_characters; + } + + char * + get_gdb_completer_quote_characters (void) + { + return gdb_completer_quote_characters; + } + + /* Complete on filenames. */ + char ** + filename_completer (char *text, char *word) + { + /* From readline. */ + extern char *filename_completion_function (char *, int); + int subsequent_name; + char **return_val; + int return_val_used; + int return_val_alloced; + + return_val_used = 0; + /* Small for testing. */ + return_val_alloced = 1; + return_val = (char **) xmalloc (return_val_alloced * sizeof (char *)); + + subsequent_name = 0; + while (1) + { + char *p; + p = filename_completion_function (text, subsequent_name); + if (return_val_used >= return_val_alloced) + { + return_val_alloced *= 2; + return_val = + (char **) xrealloc (return_val, + return_val_alloced * sizeof (char *)); + } + if (p == NULL) + { + return_val[return_val_used++] = p; + break; + } + /* We need to set subsequent_name to a non-zero value before the + continue line below, because otherwise, if the first file seen + by GDB is a backup file whose name ends in a `~', we will loop + indefinitely. */ + subsequent_name = 1; + /* Like emacs, don't complete on old versions. Especially useful + in the "source" command. */ + if (p[strlen (p) - 1] == '~') + continue; + + { + char *q; + if (word == text) + /* Return exactly p. */ + return_val[return_val_used++] = p; + else if (word > text) + { + /* Return some portion of p. */ + q = xmalloc (strlen (p) + 5); + strcpy (q, p + (word - text)); + return_val[return_val_used++] = q; + free (p); + } + else + { + /* Return some of TEXT plus p. */ + q = xmalloc (strlen (p) + (text - word) + 5); + strncpy (q, word, text - word); + q[text - word] = '\0'; + strcat (q, p); + return_val[return_val_used++] = q; + free (p); + } + } + } + #if 0 + /* There is no way to do this just long enough to affect quote inserting + without also affecting the next completion. This should be fixed in + readline. FIXME. */ + /* Insure that readline does the right thing + with respect to inserting quotes. */ + rl_completer_word_break_characters = ""; + #endif + return return_val; + } + + /* Here are some useful test cases for completion. FIXME: These should + be put in the test suite. They should be tested with both M-? and TAB. + + "show output-" "radix" + "show output" "-radix" + "p" ambiguous (commands starting with p--path, print, printf, etc.) + "p " ambiguous (all symbols) + "info t foo" no completions + "info t " no completions + "info t" ambiguous ("info target", "info terminal", etc.) + "info ajksdlfk" no completions + "info ajksdlfk " no completions + "info" " " + "info " ambiguous (all info commands) + "p \"a" no completions (string constant) + "p 'a" ambiguous (all symbols starting with a) + "p b-a" ambiguous (all symbols starting with a) + "p b-" ambiguous (all symbols) + "file Make" "file" (word break hard to screw up here) + "file ../gdb.stabs/we" "ird" (needs to not break word at slash) + */ + + /* Generate completions one by one for the completer. Each time we are + called return another potential completion to the caller. + line_completion just completes on commands or passes the buck to the + command's completer function, the stuff specific to symbol completion + is in make_symbol_completion_list. + + TEXT is the caller's idea of the "word" we are looking at. + + MATCHES is the number of matches that have currently been collected from + calling this completion function. When zero, then we need to initialize, + otherwise the initialization has already taken place and we can just + return the next potential completion string. + + LINE_BUFFER is available to be looked at; it contains the entire text + of the line. POINT is the offset in that line of the cursor. You + should pretend that the line ends at POINT. + + Returns NULL if there are no more completions, else a pointer to a string + which is a possible completion, it is the caller's responsibility to + free the string. */ + + char * + line_completion_function (char *text, int matches, char *line_buffer, int point) + { + static char **list = (char **) NULL; /* Cache of completions */ + static int index; /* Next cached completion */ + char *output = NULL; + char *tmp_command, *p; + /* Pointer within tmp_command which corresponds to text. */ + char *word; + struct cmd_list_element *c, *result_list; + + if (matches == 0) + { + /* The caller is beginning to accumulate a new set of completions, so + we need to find all of them now, and cache them for returning one at + a time on future calls. */ + + if (list) + { + /* Free the storage used by LIST, but not by the strings inside. + This is because rl_complete_internal () frees the strings. */ + free ((PTR) list); + } + list = 0; + index = 0; + + /* Choose the default set of word break characters to break completions. + If we later find out that we are doing completions on command strings + (as opposed to strings supplied by the individual command completer + functions, which can be any string) then we will switch to the + special word break set for command strings, which leaves out the + '-' character used in some commands. */ + + rl_completer_word_break_characters = + gdb_completer_word_break_characters; + + /* Decide whether to complete on a list of gdb commands or on symbols. */ + tmp_command = (char *) alloca (point + 1); + p = tmp_command; + + strncpy (tmp_command, line_buffer, point); + tmp_command[point] = '\0'; + /* Since text always contains some number of characters leading up + to point, we can find the equivalent position in tmp_command + by subtracting that many characters from the end of tmp_command. */ + word = tmp_command + point - strlen (text); + + if (point == 0) + { + /* An empty line we want to consider ambiguous; that is, it + could be any command. */ + c = (struct cmd_list_element *) -1; + result_list = 0; + } + else + { + c = lookup_cmd_1 (&p, cmdlist, &result_list, 1); + } + + /* Move p up to the next interesting thing. */ + while (*p == ' ' || *p == '\t') + { + p++; + } + + if (!c) + { + /* It is an unrecognized command. So there are no + possible completions. */ + list = NULL; + } + else if (c == (struct cmd_list_element *) -1) + { + char *q; + + /* lookup_cmd_1 advances p up to the first ambiguous thing, but + doesn't advance over that thing itself. Do so now. */ + q = p; + while (*q && (isalnum (*q) || *q == '-' || *q == '_')) + ++q; + if (q != tmp_command + point) + { + /* There is something beyond the ambiguous + command, so there are no possible completions. For + example, "info t " or "info t foo" does not complete + to anything, because "info t" can be "info target" or + "info terminal". */ + list = NULL; + } + else + { + /* We're trying to complete on the command which was ambiguous. + This we can deal with. */ + if (result_list) + { + list = complete_on_cmdlist (*result_list->prefixlist, p, + word); + } + else + { + list = complete_on_cmdlist (cmdlist, p, word); + } + /* Insure that readline does the right thing with respect to + inserting quotes. */ + rl_completer_word_break_characters = + gdb_completer_command_word_break_characters; + } + } + else + { + /* We've recognized a full command. */ + + if (p == tmp_command + point) + { + /* There is no non-whitespace in the line beyond the command. */ + + if (p[-1] == ' ' || p[-1] == '\t') + { + /* The command is followed by whitespace; we need to complete + on whatever comes after command. */ + if (c->prefixlist) + { + /* It is a prefix command; what comes after it is + a subcommand (e.g. "info "). */ + list = complete_on_cmdlist (*c->prefixlist, p, word); + + /* Insure that readline does the right thing + with respect to inserting quotes. */ + rl_completer_word_break_characters = + gdb_completer_command_word_break_characters; + } + else if (c->enums) + { + list = complete_on_enum (c->enums, p, word); + rl_completer_word_break_characters = + gdb_completer_command_word_break_characters; + } + else + { + /* It is a normal command; what comes after it is + completed by the command's completer function. */ + list = (*c->completer) (p, word); + if (c->completer == filename_completer) + rl_completer_word_break_characters = + gdb_completer_file_name_break_characters; + } + } + else + { + /* The command is not followed by whitespace; we need to + complete on the command itself. e.g. "p" which is a + command itself but also can complete to "print", "ptype" + etc. */ + char *q; + + /* Find the command we are completing on. */ + q = p; + while (q > tmp_command) + { + if (isalnum (q[-1]) || q[-1] == '-' || q[-1] == '_') + --q; + else + break; + } + + list = complete_on_cmdlist (result_list, q, word); + + /* Insure that readline does the right thing + with respect to inserting quotes. */ + rl_completer_word_break_characters = + gdb_completer_command_word_break_characters; + } + } + else + { + /* There is non-whitespace beyond the command. */ + + if (c->prefixlist && !c->allow_unknown) + { + /* It is an unrecognized subcommand of a prefix command, + e.g. "info adsfkdj". */ + list = NULL; + } + else if (c->enums) + { + list = complete_on_enum (c->enums, p, word); + } + else + { + /* It is a normal command. */ + list = (*c->completer) (p, word); + if (c->completer == filename_completer) + rl_completer_word_break_characters = + gdb_completer_file_name_break_characters; + } + } + } + } + + /* If we found a list of potential completions during initialization then + dole them out one at a time. The vector of completions is NULL + terminated, so after returning the last one, return NULL (and continue + to do so) each time we are called after that, until a new list is + available. */ + + if (list) + { + output = list[index]; + if (output) + { + index++; + } + } + + #if 0 + /* Can't do this because readline hasn't yet checked the word breaks + for figuring out whether to insert a quote. */ + if (output == NULL) + /* Make sure the word break characters are set back to normal for the + next time that readline tries to complete something. */ + rl_completer_word_break_characters = + gdb_completer_word_break_characters; + #endif + + return (output); + } + /* Skip over a possibly quoted word (as defined by the quote characters + and word break characters the completer uses). Returns pointer to the + location after the "word". */ + + char * + skip_quoted (char *str) + { + char quote_char = '\0'; + char *scan; + + for (scan = str; *scan != '\0'; scan++) + { + if (quote_char != '\0') + { + /* Ignore everything until the matching close quote char */ + if (*scan == quote_char) + { + /* Found matching close quote. */ + scan++; + break; + } + } + else if (strchr (gdb_completer_quote_characters, *scan)) + { + /* Found start of a quoted string. */ + quote_char = *scan; + } + else if (strchr (gdb_completer_word_break_characters, *scan)) + { + break; + } + } + return (scan); + } + Index: completer.h =================================================================== RCS file: completer.h diff -N completer.h *** /dev/null Tue May 5 13:32:27 1998 --- completer.h Thu Nov 30 16:15:23 2000 *************** *** 0 **** --- 1,34 ---- + /* Header for GDB line completion. + Copyright 2000 Free Software Foundation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + + #if !defined (COMPLETER_H) + #define COMPLETER_H 1 + + extern char *line_completion_function (char *, int, char *, int); + + extern char **filename_completer (char *, char *); + + extern char *get_gdb_completer_word_break_characters (void); + + extern char *get_gdb_completer_quote_characters (void); + + /* Exported to linespec.c */ + + extern char *skip_quoted (char *str); + + #endif /* defined (COMPLETER_H) */ Index: gdb/Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.47 diff -c -p -r1.47 Makefile.in *** Makefile.in 2000/11/10 23:02:56 1.47 --- Makefile.in 2000/11/30 23:30:46 *************** TARGET_FLAGS_TO_PASS = \ *** 477,483 **** SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \ ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \ ! command.c complaints.c corefile.c cp-valprint.c dbxread.c \ demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \ event-loop.c event-top.c \ expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \ --- 477,483 ---- SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \ ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \ ! command.c complaints.c completer.c corefile.c cp-valprint.c dbxread.c \ demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \ event-loop.c event-top.c \ expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \ *************** COMMON_OBS = version.o blockframe.o brea *** 623,629 **** source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o command.o \ expprint.o environ.o stack.o thread.o \ ! event-loop.o event-top.o inf-loop.o \ gdbarch.o arch-utils.o gdbtypes.o copying.o $(DEPFILES) \ mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \ kod.o kod-cisco.o \ --- 623,629 ---- source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o command.o \ expprint.o environ.o stack.o thread.o \ ! event-loop.o event-top.o inf-loop.o completer.o \ gdbarch.o arch-utils.o gdbtypes.o copying.o $(DEPFILES) \ mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \ kod.o kod-cisco.o \ *************** a68v-nat.o: a68v-nat.c $(defs_h) $(gdbco *** 1148,1154 **** alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h alpha-tdep.o: alpha-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ ! $(inferior_h) $(symtab_h) $(dis-asm.h) gdb_string.h # OBSOLETE altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) --- 1148,1154 ---- alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h alpha-tdep.o: alpha-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ ! $(inferior_h) $(symtab_h) $(dis-asm.h) gdb_string.h linespec.h # OBSOLETE altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h) *************** blockframe.o: blockframe.c $(defs_h) $(g *** 1170,1176 **** breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ $(inferior_h) language.h target.h gdbthread.h gdb_string.h \ ! gdb-events.h buildsym.o: buildsym.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ objfiles.h symfile.h $(symtab_h) gdb_string.h --- 1170,1176 ---- breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ $(inferior_h) language.h target.h gdbthread.h gdb_string.h \ ! gdb-events.h linespec.h buildsym.o: buildsym.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ objfiles.h symfile.h $(symtab_h) gdb_string.h *************** core-regset.o: core-regset.c $(command_h *** 1238,1244 **** $(inferior_h) target.h gdb_string.h corefile.o: corefile.c $(dis-asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ ! $(inferior_h) target.h language.h gdb_string.h corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ target.h gdbthread.h gdb_string.h --- 1238,1244 ---- $(inferior_h) target.h gdb_string.h corefile.o: corefile.c $(dis-asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ ! $(inferior_h) target.h language.h gdb_string.h completer.h corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ target.h gdbthread.h gdb_string.h *************** inf-loop.o: inf-loop.c $(defs_h) $(infer *** 1292,1298 **** $(event_top_h) exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ ! target.h language.h gdb_string.h expprint.o: expprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ language.h parser-defs.h $(symtab_h) $(value_h) --- 1292,1298 ---- $(event_top_h) exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ ! target.h language.h gdb_string.h completer.h expprint.o: expprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ language.h parser-defs.h $(symtab_h) $(value_h) *************** v850-tdep.o: v850-tdep.c $(defs_h) $(fra *** 1396,1402 **** tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(tracepoint_h) \ $(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) target.h \ ! language.h gdb_string.h $(readline_headers) $(remote_h) gdbarch.o: gdbarch.c $(defs_h) $(bfd_h) $(gdbcmd_h) --- 1396,1402 ---- tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(tracepoint_h) \ $(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) target.h \ ! language.h gdb_string.h $(readline_headers) $(remote_h) linespec.h gdbarch.o: gdbarch.c $(defs_h) $(bfd_h) $(gdbcmd_h) *************** hp-symtab-read.o: hp-symtab-read.c hprea *** 1652,1658 **** parse.o: parse.c $(command_h) $(defs_h) $(expression_h) $(frame_h) \ $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ ! gdb_string.h ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) gdb_string.h $(frame_h) \ $(inferior_h) $(bfd_h) symfile.h target.h gdb_wait.h $(gdbcmd_h) \ --- 1652,1658 ---- parse.o: parse.c $(command_h) $(defs_h) $(expression_h) $(frame_h) \ $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ ! gdb_string.h linespec.h ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) gdb_string.h $(frame_h) \ $(inferior_h) $(bfd_h) symfile.h target.h gdb_wait.h $(gdbcmd_h) \ *************** solib-svr4.o: solib.c $(command_h) $(def *** 1848,1854 **** source.o: source.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \ $(gdbcore_h) language.h objfiles.h gnu-regex.h symfile.h $(symtab_h) \ ! gdb_string.h source.h sparc-nat.o: sparc-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(gdbcore_h) \ target.h --- 1848,1854 ---- source.o: source.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \ $(gdbcore_h) language.h objfiles.h gnu-regex.h symfile.h $(symtab_h) \ ! gdb_string.h source.h completer.h linespec.h sparc-nat.o: sparc-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(gdbcore_h) \ target.h *************** sun386-nat.o: sun386-nat.c $(defs_h) $(i *** 1884,1890 **** symfile.o: symfile.c $(breakpoint_h) complaints.h $(defs_h) \ $(expression_h) $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) \ language.h objfiles.h symfile.h $(symtab_h) target.h \ ! gdb_string.h symm-tdep.o: symm-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) --- 1884,1890 ---- symfile.o: symfile.c $(breakpoint_h) complaints.h $(defs_h) \ $(expression_h) $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) \ language.h objfiles.h symfile.h $(symtab_h) target.h \ ! gdb_string.h completer.h symm-tdep.o: symm-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) *************** symmisc.o: symmisc.c $(bfd_h) $(breakpoi *** 1897,1906 **** symtab.o: symtab.c call-cmds.h $(defs_h) $(expression_h) $(frame_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h objfiles.h \ gnu-regex.h symfile.h $(symtab_h) target.h $(value_h) \ ! gdb_string.h ! linespec.o: linespec.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) objfiles.h \ ! symfile.h $(symtab_h) $(INCLUDE_DIR)/demangle.h inferior.h # OBSOLETE tahoe-tdep.o: tahoe-tdep.c $(OP_INCLUDE)/tahoe.h $(defs_h) \ # OBSOLETE $(symtab_h) --- 1897,1907 ---- symtab.o: symtab.c call-cmds.h $(defs_h) $(expression_h) $(frame_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h objfiles.h \ gnu-regex.h symfile.h $(symtab_h) target.h $(value_h) \ ! gdb_string.h linespec.h ! linespec.o: linespec.c linespec.h $(defs_h) $(frame_h) $(value_h) \ ! objfiles.h symfile.h completer.h $(symtab_h) \ ! $(INCLUDE_DIR)/demangle.h command.h # OBSOLETE tahoe-tdep.o: tahoe-tdep.c $(OP_INCLUDE)/tahoe.h $(defs_h) \ # OBSOLETE $(symtab_h) *************** target.o: target.c $(bfd_h) $(defs_h) $( *** 1912,1920 **** thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \ $(defs_h) $(gdbcmd_h) $(inferior_h) language.h signals.h \ ! $(remote_utils_h) gdb_string.h $(event_loop_h) $(event_top_h) $(version_h) typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \ --- 1913,1925 ---- thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h + completer.o: completer.c completer.h $(gdbtypes_h) $(symtab_h) \ + $(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers) + top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \ $(defs_h) $(gdbcmd_h) $(inferior_h) language.h signals.h \ ! $(remote_utils_h) gdb_string.h $(event_loop_h) $(event_top_h) \ ! completer.h $(version_h) typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \ Index: gdb/alpha-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/alpha-tdep.c,v retrieving revision 1.4 diff -c -p -r1.4 alpha-tdep.c *** alpha-tdep.c 2000/08/03 02:48:09 1.4 --- alpha-tdep.c 2000/11/30 23:30:46 *************** *** 29,34 **** --- 29,35 ---- #include "symfile.h" #include "objfiles.h" #include "gdb_string.h" + #include "linespec.h" /* FIXME: Some of this code should perhaps be merged with mips-tdep.c. */ Index: gdb/breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.20 diff -c -p -r1.20 breakpoint.c *** breakpoint.c 2000/11/27 02:18:44 1.20 --- breakpoint.c 2000/11/30 23:30:48 *************** *** 39,44 **** --- 39,45 ---- #include "annotate.h" #include "symfile.h" #include "objfiles.h" + #include "linespec.h" #ifdef UI_OUT #include "ui-out.h" #endif Index: gdb/corefile.c =================================================================== RCS file: /cvs/src/src/gdb/corefile.c,v retrieving revision 1.7 diff -c -p -r1.7 corefile.c *** corefile.c 2000/08/10 00:58:09 1.7 --- corefile.c 2000/11/30 23:30:48 *************** *** 37,42 **** --- 37,43 ---- #include "gdb_stat.h" #include "symfile.h" #include "objfiles.h" + #include "completer.h" /* Local function declarations. */ Index: gdb/exec.c =================================================================== RCS file: /cvs/src/src/gdb/exec.c,v retrieving revision 1.6 diff -c -p -r1.6 exec.c *** exec.c 2000/07/30 01:48:25 1.6 --- exec.c 2000/11/30 23:30:49 *************** *** 27,32 **** --- 27,33 ---- #include "language.h" #include "symfile.h" #include "objfiles.h" + #include "completer.h" #ifdef USG #include Index: gdb/linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.2 diff -c -p -r1.2 linespec.c *** linespec.c 2000/11/19 17:27:38 1.2 --- linespec.c 2000/11/30 23:30:49 *************** *** 21,32 **** #include "defs.h" #include "symtab.h" ! #include "gdbtypes.h" #include "symfile.h" #include "objfiles.h" - #include "gdbcmd.h" #include "demangle.h" ! #include "inferior.h" /* Prototype for one function in parser-defs.h, instead of including that entire file. */ --- 21,33 ---- #include "defs.h" #include "symtab.h" ! #include "frame.h" ! #include "command.h" #include "symfile.h" #include "objfiles.h" #include "demangle.h" ! #include "value.h" ! #include "completer.h" /* Prototype for one function in parser-defs.h, instead of including that entire file. */ *************** decode_line_1 (char **argptr, int funfir *** 573,579 **** /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */ is_quoted = (**argptr ! && strchr (gdb_completer_quote_characters, **argptr) != NULL); has_parens = ((pp = strchr (*argptr, '(')) != NULL && (pp = strrchr (pp, ')')) != NULL); --- 574,581 ---- /* Maybe arg is FILE : LINENUM or FILE : FUNCTION */ is_quoted = (**argptr ! && strchr (get_gdb_completer_quote_characters (), ! **argptr) != NULL); has_parens = ((pp = strchr (*argptr, '(')) != NULL && (pp = strrchr (pp, ')')) != NULL); *************** decode_line_1 (char **argptr, int funfir *** 727,733 **** /* Arg token is not digits => try it as a function name Find the next token(everything up to end or next blank). */ if (**argptr ! && strchr (gdb_completer_quote_characters, **argptr) != NULL) { p = skip_quoted (*argptr); *argptr = *argptr + 1; --- 729,736 ---- /* Arg token is not digits => try it as a function name Find the next token(everything up to end or next blank). */ if (**argptr ! && strchr (get_gdb_completer_quote_characters (), ! **argptr) != NULL) { p = skip_quoted (*argptr); *argptr = *argptr + 1; *************** decode_line_1 (char **argptr, int funfir *** 766,772 **** copy[p - *argptr] = '\0'; if (p != *argptr && copy[p - *argptr - 1] ! && strchr (gdb_completer_quote_characters, copy[p - *argptr - 1]) != NULL) copy[p - *argptr - 1] = '\0'; } --- 769,775 ---- copy[p - *argptr] = '\0'; if (p != *argptr && copy[p - *argptr - 1] ! && strchr (get_gdb_completer_quote_characters (), copy[p - *argptr - 1]) != NULL) copy[p - *argptr - 1] = '\0'; } *************** decode_line_1 (char **argptr, int funfir *** 1097,1103 **** if (p != *argptr && copy[0] && copy[0] == copy[p - *argptr - 1] ! && strchr (gdb_completer_quote_characters, copy[0]) != NULL) { copy[p - *argptr - 1] = '\0'; copy++; --- 1100,1106 ---- if (p != *argptr && copy[0] && copy[0] == copy[p - *argptr - 1] ! && strchr (get_gdb_completer_quote_characters (), copy[0]) != NULL) { copy[p - *argptr - 1] = '\0'; copy++; Index: gdb/parse.c =================================================================== RCS file: /cvs/src/src/gdb/parse.c,v retrieving revision 1.9 diff -c -p -r1.9 parse.c *** parse.c 2000/08/07 14:27:36 1.9 --- parse.c 2000/11/30 23:30:49 *************** *** 41,46 **** --- 41,47 ---- #include "command.h" #include "language.h" #include "parser-defs.h" + #include "linespec.h" #include "gdbcmd.h" #include "symfile.h" /* for overlay functions */ #include "inferior.h" /* for NUM_PSEUDO_REGS. NOTE: replace Index: gdb/ser-unix.c =================================================================== RCS file: /cvs/src/src/gdb/ser-unix.c,v retrieving revision 1.8 diff -c -p -r1.8 ser-unix.c *** ser-unix.c 2000/10/30 21:50:57 1.8 --- ser-unix.c 2000/11/30 23:30:50 *************** do_unix_readchar (serial_t scb, int time *** 920,930 **** someone else might have freed it. The ui_loop_hook signals that we should exit by returning 1. */ ! if (ui_loop_hook) ! { ! if (ui_loop_hook (0)) ! return SERIAL_TIMEOUT; ! } status = ser_unix_wait_for (scb, delta); if (timeout > 0) --- 920,934 ---- someone else might have freed it. The ui_loop_hook signals that we should exit by returning 1. */ ! /* NOTE: To prevent GUI commands to be issued while we are executing ! a previous one, we just call the GUI hook when we have an infinite ! timeout (that means that our target is running). FN */ ! ! if (ui_loop_hook && (timeout < 0)) ! { ! if (ui_loop_hook (0)) ! return SERIAL_TIMEOUT; ! } status = ser_unix_wait_for (scb, delta); if (timeout > 0) Index: gdb/source.c =================================================================== RCS file: /cvs/src/src/gdb/source.c,v retrieving revision 1.4 diff -c -p -r1.4 source.c *** source.c 2000/07/30 01:48:27 1.4 --- source.c 2000/11/30 23:30:51 *************** *** 38,43 **** --- 38,45 ---- #include "objfiles.h" #include "annotate.h" #include "gdbtypes.h" + #include "linespec.h" + #include "completer.h" #ifdef UI_OUT #include "ui-out.h" #endif Index: gdb/symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.20 diff -c -p -r1.20 symfile.c *** symfile.c 2000/10/27 15:02:42 1.20 --- symfile.c 2000/11/30 23:30:52 *************** *** 36,41 **** --- 36,42 ---- #include "inferior.h" /* for write_pc */ #include "gdb-stabs.h" #include "obstack.h" + #include "completer.h" #include #include Index: gdb/symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.23 diff -c -p -r1.23 symtab.c *** symtab.c 2000/11/19 17:27:38 1.23 --- symtab.c 2000/11/30 23:30:52 *************** *** 35,40 **** --- 35,41 ---- #include "language.h" #include "demangle.h" #include "inferior.h" + #include "linespec.h" #include "obstack.h" Index: gdb/top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.22 diff -c -p -r1.22 top.c *** top.c 2000/11/27 02:18:44 1.22 --- top.c 2000/11/30 23:30:55 *************** *** 32,37 **** --- 32,38 ---- #include "language.h" #include "terminal.h" /* For job_control. */ #include "annotate.h" + #include "completer.h" #include "top.h" #include "version.h" *************** static void init_signals (void); *** 69,76 **** static void stop_sig (int); #endif - static char *line_completion_function (char *, int, char *, int); - static char *readline_line_completion_function (char *, int); static void while_command (char *, int); --- 70,75 ---- *************** noop_completer (char *text, char *prefix *** 1832,2186 **** return NULL; } - /* Complete on filenames. */ - char ** - filename_completer (char *text, char *word) - { - /* From readline. */ - extern char *filename_completion_function (char *, int); - int subsequent_name; - char **return_val; - int return_val_used; - int return_val_alloced; - - return_val_used = 0; - /* Small for testing. */ - return_val_alloced = 1; - return_val = (char **) xmalloc (return_val_alloced * sizeof (char *)); - - subsequent_name = 0; - while (1) - { - char *p; - p = filename_completion_function (text, subsequent_name); - if (return_val_used >= return_val_alloced) - { - return_val_alloced *= 2; - return_val = - (char **) xrealloc (return_val, - return_val_alloced * sizeof (char *)); - } - if (p == NULL) - { - return_val[return_val_used++] = p; - break; - } - /* We need to set subsequent_name to a non-zero value before the - continue line below, because otherwise, if the first file seen - by GDB is a backup file whose name ends in a `~', we will loop - indefinitely. */ - subsequent_name = 1; - /* Like emacs, don't complete on old versions. Especially useful - in the "source" command. */ - if (p[strlen (p) - 1] == '~') - continue; - - { - char *q; - if (word == text) - /* Return exactly p. */ - return_val[return_val_used++] = p; - else if (word > text) - { - /* Return some portion of p. */ - q = xmalloc (strlen (p) + 5); - strcpy (q, p + (word - text)); - return_val[return_val_used++] = q; - free (p); - } - else - { - /* Return some of TEXT plus p. */ - q = xmalloc (strlen (p) + (text - word) + 5); - strncpy (q, word, text - word); - q[text - word] = '\0'; - strcat (q, p); - return_val[return_val_used++] = q; - free (p); - } - } - } - #if 0 - /* There is no way to do this just long enough to affect quote inserting - without also affecting the next completion. This should be fixed in - readline. FIXME. */ - /* Insure that readline does the right thing - with respect to inserting quotes. */ - rl_completer_word_break_characters = ""; - #endif - return return_val; - } - - /* Here are some useful test cases for completion. FIXME: These should - be put in the test suite. They should be tested with both M-? and TAB. - - "show output-" "radix" - "show output" "-radix" - "p" ambiguous (commands starting with p--path, print, printf, etc.) - "p " ambiguous (all symbols) - "info t foo" no completions - "info t " no completions - "info t" ambiguous ("info target", "info terminal", etc.) - "info ajksdlfk" no completions - "info ajksdlfk " no completions - "info" " " - "info " ambiguous (all info commands) - "p \"a" no completions (string constant) - "p 'a" ambiguous (all symbols starting with a) - "p b-a" ambiguous (all symbols starting with a) - "p b-" ambiguous (all symbols) - "file Make" "file" (word break hard to screw up here) - "file ../gdb.stabs/we" "ird" (needs to not break word at slash) - */ - - /* Generate completions one by one for the completer. Each time we are - called return another potential completion to the caller. - line_completion just completes on commands or passes the buck to the - command's completer function, the stuff specific to symbol completion - is in make_symbol_completion_list. - - TEXT is the caller's idea of the "word" we are looking at. - - MATCHES is the number of matches that have currently been collected from - calling this completion function. When zero, then we need to initialize, - otherwise the initialization has already taken place and we can just - return the next potential completion string. - - LINE_BUFFER is available to be looked at; it contains the entire text - of the line. POINT is the offset in that line of the cursor. You - should pretend that the line ends at POINT. - - Returns NULL if there are no more completions, else a pointer to a string - which is a possible completion, it is the caller's responsibility to - free the string. */ - - static char * - line_completion_function (char *text, int matches, char *line_buffer, int point) - { - static char **list = (char **) NULL; /* Cache of completions */ - static int index; /* Next cached completion */ - char *output = NULL; - char *tmp_command, *p; - /* Pointer within tmp_command which corresponds to text. */ - char *word; - struct cmd_list_element *c, *result_list; - - if (matches == 0) - { - /* The caller is beginning to accumulate a new set of completions, so - we need to find all of them now, and cache them for returning one at - a time on future calls. */ - - if (list) - { - /* Free the storage used by LIST, but not by the strings inside. - This is because rl_complete_internal () frees the strings. */ - free ((PTR) list); - } - list = 0; - index = 0; - - /* Choose the default set of word break characters to break completions. - If we later find out that we are doing completions on command strings - (as opposed to strings supplied by the individual command completer - functions, which can be any string) then we will switch to the - special word break set for command strings, which leaves out the - '-' character used in some commands. */ - - rl_completer_word_break_characters = - gdb_completer_word_break_characters; - - /* Decide whether to complete on a list of gdb commands or on symbols. */ - tmp_command = (char *) alloca (point + 1); - p = tmp_command; - - strncpy (tmp_command, line_buffer, point); - tmp_command[point] = '\0'; - /* Since text always contains some number of characters leading up - to point, we can find the equivalent position in tmp_command - by subtracting that many characters from the end of tmp_command. */ - word = tmp_command + point - strlen (text); - - if (point == 0) - { - /* An empty line we want to consider ambiguous; that is, it - could be any command. */ - c = (struct cmd_list_element *) -1; - result_list = 0; - } - else - { - c = lookup_cmd_1 (&p, cmdlist, &result_list, 1); - } - - /* Move p up to the next interesting thing. */ - while (*p == ' ' || *p == '\t') - { - p++; - } - - if (!c) - { - /* It is an unrecognized command. So there are no - possible completions. */ - list = NULL; - } - else if (c == (struct cmd_list_element *) -1) - { - char *q; - - /* lookup_cmd_1 advances p up to the first ambiguous thing, but - doesn't advance over that thing itself. Do so now. */ - q = p; - while (*q && (isalnum (*q) || *q == '-' || *q == '_')) - ++q; - if (q != tmp_command + point) - { - /* There is something beyond the ambiguous - command, so there are no possible completions. For - example, "info t " or "info t foo" does not complete - to anything, because "info t" can be "info target" or - "info terminal". */ - list = NULL; - } - else - { - /* We're trying to complete on the command which was ambiguous. - This we can deal with. */ - if (result_list) - { - list = complete_on_cmdlist (*result_list->prefixlist, p, - word); - } - else - { - list = complete_on_cmdlist (cmdlist, p, word); - } - /* Insure that readline does the right thing with respect to - inserting quotes. */ - rl_completer_word_break_characters = - gdb_completer_command_word_break_characters; - } - } - else - { - /* We've recognized a full command. */ - - if (p == tmp_command + point) - { - /* There is no non-whitespace in the line beyond the command. */ - - if (p[-1] == ' ' || p[-1] == '\t') - { - /* The command is followed by whitespace; we need to complete - on whatever comes after command. */ - if (c->prefixlist) - { - /* It is a prefix command; what comes after it is - a subcommand (e.g. "info "). */ - list = complete_on_cmdlist (*c->prefixlist, p, word); - - /* Insure that readline does the right thing - with respect to inserting quotes. */ - rl_completer_word_break_characters = - gdb_completer_command_word_break_characters; - } - else if (c->enums) - { - list = complete_on_enum (c->enums, p, word); - rl_completer_word_break_characters = - gdb_completer_command_word_break_characters; - } - else - { - /* It is a normal command; what comes after it is - completed by the command's completer function. */ - list = (*c->completer) (p, word); - if (c->completer == filename_completer) - rl_completer_word_break_characters = - gdb_completer_file_name_break_characters; - } - } - else - { - /* The command is not followed by whitespace; we need to - complete on the command itself. e.g. "p" which is a - command itself but also can complete to "print", "ptype" - etc. */ - char *q; - - /* Find the command we are completing on. */ - q = p; - while (q > tmp_command) - { - if (isalnum (q[-1]) || q[-1] == '-' || q[-1] == '_') - --q; - else - break; - } - - list = complete_on_cmdlist (result_list, q, word); - - /* Insure that readline does the right thing - with respect to inserting quotes. */ - rl_completer_word_break_characters = - gdb_completer_command_word_break_characters; - } - } - else - { - /* There is non-whitespace beyond the command. */ - - if (c->prefixlist && !c->allow_unknown) - { - /* It is an unrecognized subcommand of a prefix command, - e.g. "info adsfkdj". */ - list = NULL; - } - else if (c->enums) - { - list = complete_on_enum (c->enums, p, word); - } - else - { - /* It is a normal command. */ - list = (*c->completer) (p, word); - if (c->completer == filename_completer) - rl_completer_word_break_characters = - gdb_completer_file_name_break_characters; - } - } - } - } - - /* If we found a list of potential completions during initialization then - dole them out one at a time. The vector of completions is NULL - terminated, so after returning the last one, return NULL (and continue - to do so) each time we are called after that, until a new list is - available. */ - - if (list) - { - output = list[index]; - if (output) - { - index++; - } - } - - #if 0 - /* Can't do this because readline hasn't yet checked the word breaks - for figuring out whether to insert a quote. */ - if (output == NULL) - /* Make sure the word break characters are set back to normal for the - next time that readline tries to complete something. */ - rl_completer_word_break_characters = - gdb_completer_word_break_characters; - #endif - - return (output); - } - /* Line completion interface function for readline. */ static char * --- 1831,1836 ---- *************** readline_line_completion_function (char *** 2189,2230 **** return line_completion_function (text, matches, rl_line_buffer, rl_point); } - /* Skip over a possibly quoted word (as defined by the quote characters - and word break characters the completer uses). Returns pointer to the - location after the "word". */ - - char * - skip_quoted (char *str) - { - char quote_char = '\0'; - char *scan; - - for (scan = str; *scan != '\0'; scan++) - { - if (quote_char != '\0') - { - /* Ignore everything until the matching close quote char */ - if (*scan == quote_char) - { - /* Found matching close quote. */ - scan++; - break; - } - } - else if (strchr (gdb_completer_quote_characters, *scan)) - { - /* Found start of a quoted string. */ - quote_char = *scan; - } - else if (strchr (gdb_completer_word_break_characters, *scan)) - { - break; - } - } - return (scan); - } - #ifdef STOP_SIGNAL static void stop_sig (int signo) --- 1839,1845 ---- Index: gdb/tracepoint.c =================================================================== RCS file: /cvs/src/src/gdb/tracepoint.c,v retrieving revision 1.13 diff -c -p -r1.13 tracepoint.c *** tracepoint.c 2000/11/16 14:51:49 1.13 --- tracepoint.c 2000/11/30 23:30:56 *************** *** 31,36 **** --- 31,37 ---- #include "inferior.h" #include "tracepoint.h" #include "remote.h" + #include "linespec.h" #include "ax.h" #include "ax-gdb.h" -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 From fnasser@cygnus.com Thu Nov 30 16:48:00 2000 From: Fernando Nasser To: gdb-patches@sources.redhat.com Subject: Heads up: cli subdirectory check in tonight Date: Thu, 30 Nov 2000 16:48:00 -0000 Message-id: <3A26F542.A3092A70@cygnus.com> X-SW-Source: 2000-11/msg00409.html Content-length: 1160 The take #3 of the CLI separation is the move of the CLI code to its own directory, into proper files. I did this over the weekend and it has been working nicely since then. I have run the testusuite many times with no regression so it is time to check it in. Again, I've tried to keep the changes to a minimum, basically only moving code that was scattered (I only tackled top.c and commands.c this time) so that the changes are properly documented. This means that the file cli/cli-cmds.c will change a lot in the future, but not now (I also want to post a RFC for that). It also means that I left both the old and the new CLI command loop behind. That has to go in a different patch (it is time to get rid of the old code that has not been used for over an year anyway). The new files will be (for now): cli/cli-decode.c cli/cli-decode.h cli/cli-cmds.c cli/cli-cmds.h cli/cli-script.c cli/cli-script.h cli/cli-setshow.c cli/cli-setshow.h Don't forget to use "-d" to get the new files when updating. -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 From meissner@cygnus.com Thu Nov 30 19:12:00 2000 From: Michael Meissner To: Fernando Nasser Cc: gdb-patches@sources.redhat.com Subject: Re: Heads up: cli subdirectory check in tonight Date: Thu, 30 Nov 2000 19:12:00 -0000 Message-id: <20001130221231.23114@cse.cygnus.com> References: <3A26F542.A3092A70@cygnus.com> X-SW-Source: 2000-11/msg00410.html Content-length: 1412 On Fri, Dec 01, 2000 at 12:48:02AM +0000, Fernando Nasser wrote: > The take #3 of the CLI separation is the move of the CLI code to its > own directory, into proper files. > > I did this over the weekend and it has been working nicely since then. > I have run the testusuite many times with no regression so it is time > to check it in. > > Again, I've tried to keep the changes to a minimum, basically only moving > code that was scattered (I only tackled top.c and commands.c this time) > so that the changes are properly documented. > > This means that the file cli/cli-cmds.c will change a lot in the future, > but not now (I also want to post a RFC for that). > > It also means that I left both the old and the new CLI command loop behind. > That has to go in a different patch (it is time to get rid of the old code > that has not been used for over an year anyway). > > The new files will be (for now): > > cli/cli-decode.c > cli/cli-decode.h > cli/cli-cmds.c > cli/cli-cmds.h > cli/cli-script.c > cli/cli-script.h > cli/cli-setshow.c > cli/cli-setshow.h It seems weird to have cli/cli-. I would think moving them to a new subdirectory, you could rename them to cli/. -- Michael Meissner, Red Hat, Inc. PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA Work: meissner@redhat.com phone: +1 978-486-9304 Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482 From fnasser@cygnus.com Thu Nov 30 19:54:00 2000 From: Fernando Nasser To: Michael Meissner Cc: gdb-patches@sources.redhat.com Subject: Re: Heads up: cli subdirectory check in tonight Date: Thu, 30 Nov 2000 19:54:00 -0000 Message-id: <3A2720A6.31A50745@cygnus.com> References: <3A26F542.A3092A70@cygnus.com> <20001130221231.23114@cse.cygnus.com> X-SW-Source: 2000-11/msg00411.html Content-length: 1963 Michael Meissner wrote: > > On Fri, Dec 01, 2000 at 12:48:02AM +0000, Fernando Nasser wrote: > > The take #3 of the CLI separation is the move of the CLI code to its > > own directory, into proper files. > > > > I did this over the weekend and it has been working nicely since then. > > I have run the testusuite many times with no regression so it is time > > to check it in. > > > > Again, I've tried to keep the changes to a minimum, basically only moving > > code that was scattered (I only tackled top.c and commands.c this time) > > so that the changes are properly documented. > > > > This means that the file cli/cli-cmds.c will change a lot in the future, > > but not now (I also want to post a RFC for that). > > > > It also means that I left both the old and the new CLI command loop behind. > > That has to go in a different patch (it is time to get rid of the old code > > that has not been used for over an year anyway). > > > > The new files will be (for now): > > > > cli/cli-decode.c > > cli/cli-decode.h > > cli/cli-cmds.c > > cli/cli-cmds.h > > cli/cli-script.c > > cli/cli-script.h > > cli/cli-setshow.c > > cli/cli-setshow.h > > It seems weird to have cli/cli-. I would think moving them to a new > subdirectory, you could rename them to cli/. > Yes, I had the same doubts. I believe I posted the question and I got only only reply in favor of "cli-foo". And we do currently have both mi and gdbtk subdirectories following the "keep the prefix" rule. I personally had no preferences but I admit this way prevents name clashes, specially in these UI directories. You see, these possible gdb dialects like the CLI, the MI, some GUILE interface, our Tcl code etc may tend to have things like "parser", "cmds", "cmdloop" etc. This would not make sense in other contexts though. -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 From meissner@cygnus.com Thu Nov 30 19:56:00 2000 From: Michael Meissner To: Fernando Nasser Cc: Michael Meissner , gdb-patches@sources.redhat.com Subject: Re: Heads up: cli subdirectory check in tonight Date: Thu, 30 Nov 2000 19:56:00 -0000 Message-id: <20001130225617.31565@cse.cygnus.com> References: <3A26F542.A3092A70@cygnus.com> <20001130221231.23114@cse.cygnus.com> <3A2720A6.31A50745@cygnus.com> X-SW-Source: 2000-11/msg00412.html Content-length: 1159 On Fri, Dec 01, 2000 at 03:53:10AM +0000, Fernando Nasser wrote: > > It seems weird to have cli/cli-. I would think moving them to a new > > subdirectory, you could rename them to cli/. > > > > Yes, I had the same doubts. I believe I posted the question and I got only > only reply in favor of "cli-foo". > > And we do currently have both mi and gdbtk subdirectories following the > "keep the prefix" rule. > > I personally had no preferences but I admit this way prevents name clashes, > specially in these UI directories. You see, these possible gdb dialects > like the CLI, the MI, some GUILE interface, our Tcl code etc may tend to > have things like "parser", "cmds", "cmdloop" etc. > > This would not make sense in other contexts though. The problem is if you still have to worry about the old DOS 8.3 limit or the System V.[12] limit of 14 characters total, having a prefix greatly cuts down on the available names. -- Michael Meissner, Red Hat, Inc. PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA Work: meissner@redhat.com phone: +1 978-486-9304 Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482 From fnasser@cygnus.com Thu Nov 30 20:14:00 2000 From: Fernando Nasser To: Michael Meissner Cc: gdb-patches@sources.redhat.com Subject: Re: Heads up: cli subdirectory check in tonight Date: Thu, 30 Nov 2000 20:14:00 -0000 Message-id: <3A272584.5B04684C@cygnus.com> References: <3A26F542.A3092A70@cygnus.com> <20001130221231.23114@cse.cygnus.com> <3A2720A6.31A50745@cygnus.com> <20001130225617.31565@cse.cygnus.com> X-SW-Source: 2000-11/msg00413.html Content-length: 1749 Michael Meissner wrote: > > On Fri, Dec 01, 2000 at 03:53:10AM +0000, Fernando Nasser wrote: > > > It seems weird to have cli/cli-. I would think moving them to a new > > > subdirectory, you could rename them to cli/. > > > > > > > Yes, I had the same doubts. I believe I posted the question and I got only > > only reply in favor of "cli-foo". > > > > And we do currently have both mi and gdbtk subdirectories following the > > "keep the prefix" rule. > > > > I personally had no preferences but I admit this way prevents name clashes, > > specially in these UI directories. You see, these possible gdb dialects > > like the CLI, the MI, some GUILE interface, our Tcl code etc may tend to > > have things like "parser", "cmds", "cmdloop" etc. > > > > This would not make sense in other contexts though. > > The problem is if you still have to worry about the old DOS 8.3 limit or the > System V.[12] limit of 14 characters total, having a prefix greatly cuts down > on the available names. > I followed the 14 characters limit. I lost 4 to the prefix, as you pointed out, and 2 are for the ".c". This left me with the 8 characters I had to cope with for years (I may have given away my age :-) ). It is not that bad. But as I said, I am not picky about this. But again, we should also go and rename (get rid of prefixes) in the mi and gdbtk subdirectories. We can also do this at a later time, when Andrew makes the files reorg that he promised. Then we change everything with the same criteria. I would prefer keeping the current practice for now, for the sake of uniformity. -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 From kevinb@cygnus.com Thu Nov 30 21:44:00 2000 From: Kevin Buettner To: Fernando Nasser , Michael Meissner Cc: gdb-patches@sources.redhat.com Subject: Re: Heads up: cli subdirectory check in tonight Date: Thu, 30 Nov 2000 21:44:00 -0000 Message-id: <1001201054412.ZM7378@ocotillo.lan> References: <3A26F542.A3092A70@cygnus.com> <20001130221231.23114@cse.cygnus.com> <3A2720A6.31A50745@cygnus.com> <20001130225617.31565@cse.cygnus.com> <3A272584.5B04684C@cygnus.com> X-SW-Source: 2000-11/msg00414.html Content-length: 609 On Dec 1, 4:13am, Fernando Nasser wrote: > But as I said, I am not picky about this. But again, we should also go > and rename (get rid of prefixes) in the mi and gdbtk subdirectories. > > We can also do this at a later time, when Andrew makes the files reorg that > he promised. Then we change everything with the same criteria. > I would prefer keeping the current practice for now, for the sake of > uniformity. I agree that uniformity is a good thing, but... If we come to agree that the prefixes should go, we might as well start now in order to reduce the amount of work needed later on. Kevin From pavel@eazel.com Thu Nov 30 22:47:00 2000 From: Pavel Cisler To: gdb-patches@sourceware.cygnus.com Cc: kevinb@cygnus.com Subject: Re: [PATCH RFA] process/thread/lwp identifier mega-patch Date: Thu, 30 Nov 2000 22:47:00 -0000 Message-id: <3A2748DF.206B4418@eazel.com> References: <1001003083922.ZM18831@ocotillo.lan> <3A196C0E.B28DA29@cygnus.com> <1001120185800.ZM17272@ocotillo.lan> <3A1E4BE8.866BCBED@cygnus.com> X-SW-Source: 2000-11/msg00415.html Content-length: 604 Hi, I was wondering if there any plans to proceed with Kevin's patch that fixes the problem with pids overflowing the 16 bit precision they currently use. We've been using it in at Eazel since mid-october. Without it gdb 5.0 is pretty much unusable for debugging code that uses threads liberally (the case of our file manager, Nautilus), a serious degradation from the older versions of gdb that didn't manifest this problem. I understand the current thinking is to set up a separate branch on which the bug fix will be driven to completion, if there is one we would be delighted to help test. Pavel From ac131313@cygnus.com Fri Dec 01 00:16:00 2000 From: Andrew Cagney To: Michael Meissner Cc: Fernando Nasser , gdb-patches@sources.redhat.com Subject: Re: Heads up: cli subdirectory check in tonight Date: Fri, 01 Dec 2000 00:16:00 -0000 Message-id: <3A275C39.8E04EEF5@cygnus.com> References: <3A26F542.A3092A70@cygnus.com> <20001130221231.23114@cse.cygnus.com> X-SW-Source: 2000-12/msg00000.html Content-length: 575 Michael Meissner wrote: > > The new files will be (for now): > > > > cli/cli-decode.c > > cli/cli-decode.h > > cli/cli-cmds.c > > cli/cli-cmds.h > > cli/cli-script.c > > cli/cli-script.h > > cli/cli-setshow.c > > cli/cli-setshow.h > > It seems weird to have cli/cli-. I would think moving them to a new > subdirectory, you could rename them to cli/. The decision, while pretty arbitrary (1), is consistent with the way the other directories are structured (namely mi/mi-*.[hc]) (just ignore the TUI directory). enjoy, Andrew (The coin toss came up tails). From ac131313@cygnus.com Fri Dec 01 00:26:00 2000 From: Andrew Cagney To: Kevin Buettner Cc: Fernando Nasser , Michael Meissner , gdb-patches@sources.redhat.com Subject: Re: Heads up: cli subdirectory check in tonight Date: Fri, 01 Dec 2000 00:26:00 -0000 Message-id: <3A275EB7.A9C8D8F@cygnus.com> References: <3A26F542.A3092A70@cygnus.com> <20001130221231.23114@cse.cygnus.com> <3A2720A6.31A50745@cygnus.com> <20001130225617.31565@cse.cygnus.com> <3A272584.5B04684C@cygnus.com> <1001201054412.ZM7378@ocotillo.lan> X-SW-Source: 2000-12/msg00001.html Content-length: 896 Kevin Buettner wrote: > > On Dec 1, 4:13am, Fernando Nasser wrote: > > > But as I said, I am not picky about this. But again, we should also go > > and rename (get rid of prefixes) in the mi and gdbtk subdirectories. > > > > We can also do this at a later time, when Andrew makes the files reorg that > > he promised. Then we change everything with the same criteria. > > I would prefer keeping the current practice for now, for the sake of > > uniformity. > > I agree that uniformity is a good thing, but... If we come to agree > that the prefixes should go, we might as well start now in order to > reduce the amount of work needed later on. I think fernando has enough things to contend with without also having to go through the pain of trying to determine an acceptable way to completely re-arange GDB's file structure :-) That can happen in its own good time :-) enjoy, Andrew From ac131313@cygnus.com Fri Dec 01 03:31:00 2000 From: Andrew Cagney To: GDB Patches Subject: [rfc] add __FILE__ and __LINE__ to internal_error() Date: Fri, 01 Dec 2000 03:31:00 -0000 Message-id: <3A2789DD.ABA82A16@cygnus.com> X-SW-Source: 2000-12/msg00002.html Content-length: 130051 FYI, This is part one of a two step process to completly eliminate all remaining abort() calls in GDB. Part two involves replacing abort() with ``internal_error (__FILE__, __LINE__, "legacy call to abort()");''. Look ok? Andrew Fri Dec 1 21:03:31 2000 Andrew Cagney * defs.h (internal_error, internal_verror): Add ``file'' and ``line'' parameters. (internal_error): Add ATTR_FORMAT to declaration. * utils.c (internal_verror): Print ``file'' and ``line''. (internal_error): Update. * gdb_assert.h (gdb_assert_fail), command.c (do_setshow_command), v850-tdep.c (v850_target_architecture_hook), i386-tdep.c (i386_extract_return_value), language.c (longest_local_hex_string_custom), solib-svr4.c (default_svr4_fetch_link_map_offsets), rs6000-nat.c (set_host_arch), remote-vx.c (vx_wait), remote-mips.c (mips_request), solib.c (info_sharedlibrary_command), m68k-tdep.c (m68k_get_longjmp_target), infptrace.c (_initialize_kernel_u_addr), i386-linux-nat.c (fetch_inferior_registers, store_inferior_registers), mn10300-tdep.c (mn10300_gdbarch_init), hppah-nat.c (store_inferior_registers, fetch_register), ia64-tdep.c (read_sigcontext_register), m3-nat.c (catch_exception_raise, mach3_exception_actions, setup_notify_port, _initialize_m3_nat), mips-tdep.c (mips_mask_address_p, show_mask_address), sh-tdep.c (sh_do_pseudo_register, sh_print_register), sparc-tdep.c (setup_arbitrary_frame, sparc_frame_find_saved_regs), symm-nat.c (child_wait, _initialize_symm_nat), go32-nat.c (go32_fetch_registers, go32_fetch_registers, store_register, go32_create_inferior, init_go32_ops), f-lang.c (get_bf_for_fcn), dsrec.c (make_srec), d30v-tdep.c (print_insn), event-loop.c (add_file_handler, add_file_handler, create_file_handler, delete_file_handler, handle_file_event, gdb_wait_for_event, poll_timers), d10v-tdep.c (print_insn, d10v_gdbarch_init), a29k-tdep.c (setup_arbitrary_frame), ui-file.c (ui_file_data, mem_file_delete, mem_file_rewind, mem_file_put, mem_file_write, stdio_file_delete, stdio_file_flush, stdio_file_write, stdio_file_fputs, stdio_file_isatty), utils.c (free_current_contents, nomem, xvasprintf, host_pointer_to_address, address_to_host_pointer), top.c (arg_cleanup), serial.c (serial_readchar, deprecated_serial_fd), ui-out.c (ui_out_table_begin, ui_out_table_body, ui_out_table_end, ui_out_table_header, ui_out_list_begin, ui_out_list_end, verify_field_proper_position, verify_field_alignment), ch-exp.c (peek_token_, pushback_token, require, ch_lex), dwarf2read.c (read_comp_unit_head, read_address, read_offset), elfread.c (elf_symtab_read, elf_symtab_read), maint.c (maintenance_internal_error), objfiles.c (unlink_objfile), remote-sim.c (gdbsim_store_register, gdbsim_open), ax-gdb.c (gen_fetch, gen_fetch, gen_var_ref, gen_deref, find_field, gen_bitfield_ref, gen_expr), objfiles.h (SECT_OFF_DATA, SECT_OFF_RODATA, SECT_OFF_TEXT), remote.c (packet_ok, remote_threads_extra_info, remote_write_bytes, watchpoint_to_Z_packet, remote_insert_watchpoint, remote_remove_watchpoint, remote_insert_hw_breakpoint, remote_remove_hw_breakpoint, remote_async), arch-utils.c (legacy_register_name, default_float_format, default_double_format, set_endian, set_endian_from_file, arch_ok, set_arch, set_architecture_from_arch_mach, set_architecture_from_file, set_architecture, initialize_current_architecture), command.c (do_setshow_command), target.h (SOFTWARE_SINGLE_STEP), infrun.c (follow_inferior_fork, print_stop_reason, normal_stop), infcmd.c (finish_command_continuation, finish_command), symtab.h (ANOFFSET), source.c (select_source_symtab), regcache.c (generic_target_read_pc, generic_target_write_pc, generic_target_read_sp, generic_target_write_sp, generic_target_read_fp, generic_target_write_fp), findvar.c (extract_typed_address, store_typed_address, value_of_register, value_from_register), breakpoint.c (print_bp_stop_message, print_one_breakpoint, check_duplicates, delete_breakpoint): Update. * gdbarch.sh: Update * gdbarch.h, gdbarch.c: Regenerate. * TODO: Update. Index: TODO =================================================================== RCS file: /cvs/src/src/gdb/TODO,v retrieving revision 1.55 diff -p -r1.55 TODO *** TODO 2000/11/27 00:37:19 1.55 --- TODO 2000/12/01 11:15:52 *************** an error status. *** 432,441 **** -- - Add __LINE__ and __FILE__ to internal_error(). - - -- - GDB probably doesn't build on FreeBSD pre 2.2.x http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00378.html --- 432,437 ---- Index: a29k-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/a29k-tdep.c,v retrieving revision 1.2 diff -p -r1.2 a29k-tdep.c *** a29k-tdep.c 2000/07/30 01:48:24 1.2 --- a29k-tdep.c 2000/12/01 11:15:57 *************** setup_arbitrary_frame (int argc, CORE_AD *** 892,898 **** frame = create_new_frame (argv[0], argv[1]); if (!frame) ! internal_error ("create_new_frame returned invalid frame id"); /* Creating a new frame munges the `frame' value from the current GR1, so we restore it again here. FIXME, untangle all this --- 892,899 ---- frame = create_new_frame (argv[0], argv[1]); if (!frame) ! internal_error (__FILE__, __LINE__, ! "create_new_frame returned invalid frame id"); /* Creating a new frame munges the `frame' value from the current GR1, so we restore it again here. FIXME, untangle all this Index: arch-utils.c =================================================================== RCS file: /cvs/src/src/gdb/arch-utils.c,v retrieving revision 1.16 diff -p -r1.16 arch-utils.c *** arch-utils.c 2000/10/27 19:17:56 1.16 --- arch-utils.c 2000/12/01 11:15:57 *************** legacy_register_name (int i) *** 117,123 **** else return names[i]; #else ! internal_error ("legacy_register_name: called."); return NULL; #endif } --- 117,124 ---- else return names[i]; #else ! internal_error (__FILE__, __LINE__, ! "legacy_register_name: called."); return NULL; #endif } *************** default_float_format (struct gdbarch *gd *** 180,186 **** case LITTLE_ENDIAN: return &floatformat_ieee_single_little; default: ! internal_error ("default_float_format: bad byte order"); } } --- 181,188 ---- case LITTLE_ENDIAN: return &floatformat_ieee_single_little; default: ! internal_error (__FILE__, __LINE__, ! "default_float_format: bad byte order"); } } *************** default_double_format (struct gdbarch *g *** 200,206 **** case LITTLE_ENDIAN: return &floatformat_ieee_double_little; default: ! internal_error ("default_double_format: bad byte order"); } } --- 202,209 ---- case LITTLE_ENDIAN: return &floatformat_ieee_double_little; default: ! internal_error (__FILE__, __LINE__, ! "default_double_format: bad byte order"); } } *************** set_endian (char *ignore_args, int from_ *** 334,340 **** } } else ! internal_error ("set_endian: bad value"); show_endian (NULL, from_tty); } --- 337,344 ---- } } else ! internal_error (__FILE__, __LINE__, ! "set_endian: bad value"); show_endian (NULL, from_tty); } *************** static void *** 344,350 **** set_endian_from_file (bfd *abfd) { if (GDB_MULTI_ARCH) ! internal_error ("set_endian_from_file: not for multi-arch"); if (TARGET_BYTE_ORDER_SELECTABLE_P) { int want; --- 348,355 ---- set_endian_from_file (bfd *abfd) { if (GDB_MULTI_ARCH) ! internal_error (__FILE__, __LINE__, ! "set_endian_from_file: not for multi-arch"); if (TARGET_BYTE_ORDER_SELECTABLE_P) { int want; *************** static int *** 390,396 **** arch_ok (const struct bfd_arch_info *arch) { if (GDB_MULTI_ARCH) ! internal_error ("arch_ok: not multi-arched"); /* Should be performing the more basic check that the binary is compatible with GDB. */ /* Check with the target that the architecture is valid. */ --- 395,402 ---- arch_ok (const struct bfd_arch_info *arch) { if (GDB_MULTI_ARCH) ! internal_error (__FILE__, __LINE__, ! "arch_ok: not multi-arched"); /* Should be performing the more basic check that the binary is compatible with GDB. */ /* Check with the target that the architecture is valid. */ *************** set_arch (const struct bfd_arch_info *ar *** 403,409 **** enum set_arch type) { if (GDB_MULTI_ARCH) ! internal_error ("set_arch: not multi-arched"); switch (type) { case set_arch_auto: --- 409,416 ---- enum set_arch type) { if (GDB_MULTI_ARCH) ! internal_error (__FILE__, __LINE__, ! "set_arch: not multi-arched"); switch (type) { case set_arch_auto: *************** set_architecture_from_arch_mach (enum bf *** 437,447 **** { const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach); if (GDB_MULTI_ARCH) ! internal_error ("set_architecture_from_arch_mach: not multi-arched"); if (wanted != NULL) set_arch (wanted, set_arch_manual); else ! internal_error ("gdbarch: hardwired architecture/machine not recognized"); } /* Set the architecture from a BFD (deprecated) */ --- 444,456 ---- { const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach); if (GDB_MULTI_ARCH) ! internal_error (__FILE__, __LINE__, ! "set_architecture_from_arch_mach: not multi-arched"); if (wanted != NULL) set_arch (wanted, set_arch_manual); else ! internal_error (__FILE__, __LINE__, ! "gdbarch: hardwired architecture/machine not recognized"); } /* Set the architecture from a BFD (deprecated) */ *************** set_architecture_from_file (bfd *abfd) *** 451,457 **** { const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd); if (GDB_MULTI_ARCH) ! internal_error ("set_architecture_from_file: not multi-arched"); if (target_architecture_auto) { set_arch (wanted, set_arch_auto); --- 460,467 ---- { const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd); if (GDB_MULTI_ARCH) ! internal_error (__FILE__, __LINE__, ! "set_architecture_from_file: not multi-arched"); if (target_architecture_auto) { set_arch (wanted, set_arch_auto); *************** set_architecture (char *ignore_args, int *** 496,502 **** memset (&info, 0, sizeof info); info.bfd_arch_info = bfd_scan_arch (set_architecture_string); if (info.bfd_arch_info == NULL) ! internal_error ("set_architecture: bfd_scan_arch failed"); if (gdbarch_update_p (info)) target_architecture_auto = 0; else --- 506,513 ---- memset (&info, 0, sizeof info); info.bfd_arch_info = bfd_scan_arch (set_architecture_string); if (info.bfd_arch_info == NULL) ! internal_error (__FILE__, __LINE__, ! "set_architecture: bfd_scan_arch failed"); if (gdbarch_update_p (info)) target_architecture_auto = 0; else *************** set_architecture (char *ignore_args, int *** 508,514 **** const struct bfd_arch_info *arch = bfd_scan_arch (set_architecture_string); if (arch == NULL) ! internal_error ("set_architecture: bfd_scan_arch failed"); set_arch (arch, set_arch_manual); } show_architecture (NULL, from_tty); --- 519,526 ---- const struct bfd_arch_info *arch = bfd_scan_arch (set_architecture_string); if (arch == NULL) ! internal_error (__FILE__, __LINE__, ! "set_architecture: bfd_scan_arch failed"); set_arch (arch, set_arch_manual); } show_architecture (NULL, from_tty); *************** initialize_current_architecture (void) *** 612,621 **** chosen = *arch; } if (chosen == NULL) ! internal_error ("initialize_current_architecture: No arch"); info.bfd_arch_info = bfd_scan_arch (chosen); if (info.bfd_arch_info == NULL) ! internal_error ("initialize_current_architecture: Arch not found"); } /* take several guesses at a byte order. */ --- 624,635 ---- chosen = *arch; } if (chosen == NULL) ! internal_error (__FILE__, __LINE__, ! "initialize_current_architecture: No arch"); info.bfd_arch_info = bfd_scan_arch (chosen); if (info.bfd_arch_info == NULL) ! internal_error (__FILE__, __LINE__, ! "initialize_current_architecture: Arch not found"); } /* take several guesses at a byte order. */ *************** initialize_current_architecture (void) *** 657,663 **** { if (! gdbarch_update_p (info)) { ! internal_error ("initialize_current_architecture: Selection of initial architecture failed"); } } --- 671,678 ---- { if (! gdbarch_update_p (info)) { ! internal_error (__FILE__, __LINE__, ! "initialize_current_architecture: Selection of initial architecture failed"); } } Index: ax-gdb.c =================================================================== RCS file: /cvs/src/src/gdb/ax-gdb.c,v retrieving revision 1.7 diff -p -r1.7 ax-gdb.c *** ax-gdb.c 2000/10/30 21:15:56 1.7 --- ax-gdb.c 2000/12/01 11:16:04 *************** gen_fetch (struct agent_expr *ax, struct *** 409,415 **** implementing something we should be (this code's fault). In any case, it's a bug the user shouldn't see. */ default: ! internal_error ("ax-gdb.c (gen_fetch): strange size"); } gen_sign_extend (ax, type); --- 409,416 ---- implementing something we should be (this code's fault). In any case, it's a bug the user shouldn't see. */ default: ! internal_error (__FILE__, __LINE__, ! "gen_fetch: strange size"); } gen_sign_extend (ax, type); *************** gen_fetch (struct agent_expr *ax, struct *** 420,426 **** pointer (other code's fault), or we're not implementing something we should be (this code's fault). In any case, it's a bug the user shouldn't see. */ ! internal_error ("ax-gdb.c (gen_fetch): bad type code"); } } --- 421,428 ---- pointer (other code's fault), or we're not implementing something we should be (this code's fault). In any case, it's a bug the user shouldn't see. */ ! internal_error (__FILE__, __LINE__, ! "gen_fetch: bad type code"); } } *************** gen_var_ref (struct agent_expr *ax, stru *** 530,536 **** break; case LOC_CONST_BYTES: ! internal_error ("ax-gdb.c (gen_var_ref): LOC_CONST_BYTES symbols are not supported"); /* Variable at a fixed location in memory. Easy. */ case LOC_STATIC: --- 532,539 ---- break; case LOC_CONST_BYTES: ! internal_error (__FILE__, __LINE__, ! "gen_var_ref: LOC_CONST_BYTES symbols are not supported"); /* Variable at a fixed location in memory. Easy. */ case LOC_STATIC: *************** gen_deref (struct agent_expr *ax, struct *** 1088,1094 **** /* The caller should check the type, because several operators use this, and we don't know what error message to generate. */ if (value->type->code != TYPE_CODE_PTR) ! internal_error ("ax-gdb.c (gen_deref): expected a pointer"); /* We've got an rvalue now, which is a pointer. We want to yield an lvalue, whose address is exactly that pointer. So we don't --- 1091,1098 ---- /* The caller should check the type, because several operators use this, and we don't know what error message to generate. */ if (value->type->code != TYPE_CODE_PTR) ! internal_error (__FILE__, __LINE__, ! "gen_deref: expected a pointer"); /* We've got an rvalue now, which is a pointer. We want to yield an lvalue, whose address is exactly that pointer. So we don't *************** find_field (struct type *type, char *nam *** 1143,1149 **** /* Make sure this isn't C++. */ if (TYPE_N_BASECLASSES (type) != 0) ! internal_error ("ax-gdb.c (find_field): derived classes supported"); for (i = 0; i < TYPE_NFIELDS (type); i++) { --- 1147,1154 ---- /* Make sure this isn't C++. */ if (TYPE_N_BASECLASSES (type) != 0) ! internal_error (__FILE__, __LINE__, ! "find_field: derived classes supported"); for (i = 0; i < TYPE_NFIELDS (type); i++) { *************** find_field (struct type *type, char *nam *** 1153,1159 **** return i; if (this_name[0] == '\0') ! internal_error ("ax-gdb.c (find_field): anonymous unions not supported"); } error ("Couldn't find member named `%s' in struct/union `%s'", --- 1158,1165 ---- return i; if (this_name[0] == '\0') ! internal_error (__FILE__, __LINE__, ! "find_field: anonymous unions not supported"); } error ("Couldn't find member named `%s' in struct/union `%s'", *************** gen_bitfield_ref (struct agent_expr *ax, *** 1225,1231 **** /* Can we fetch the number of bits requested at all? */ if ((end - start) > ((1 << num_ops) * 8)) ! internal_error ("ax-gdb.c (gen_bitfield_ref): bitfield too wide"); /* Note that we know here that we only need to try each opcode once. That may not be true on machines with weird byte sizes. */ --- 1231,1238 ---- /* Can we fetch the number of bits requested at all? */ if ((end - start) > ((1 << num_ops) * 8)) ! internal_error (__FILE__, __LINE__, ! "gen_bitfield_ref: bitfield too wide"); /* Note that we know here that we only need to try each opcode once. That may not be true on machines with weird byte sizes. */ *************** gen_expr (union exp_element **pc, struct *** 1535,1541 **** default: /* We should only list operators in the outer case statement that we actually handle in the inner case statement. */ ! internal_error ("ax-gdb.c (gen_expr): op case sets don't match"); } break; --- 1542,1549 ---- default: /* We should only list operators in the outer case statement that we actually handle in the inner case statement. */ ! internal_error (__FILE__, __LINE__, ! "gen_expr: op case sets don't match"); } break; *************** gen_expr (union exp_element **pc, struct *** 1610,1616 **** the given type, and dereference it. */ if (value->kind != axs_rvalue) /* This would be weird. */ ! internal_error ("ax-gdb.c (gen_expr): OP_MEMVAL operand isn't an rvalue???"); value->type = type; value->kind = axs_lvalue_memory; } --- 1618,1625 ---- the given type, and dereference it. */ if (value->kind != axs_rvalue) /* This would be weird. */ ! internal_error (__FILE__, __LINE__, ! "gen_expr: OP_MEMVAL operand isn't an rvalue???"); value->type = type; value->kind = axs_lvalue_memory; } *************** gen_expr (union exp_element **pc, struct *** 1678,1684 **** else /* If this `if' chain doesn't handle it, then the case list shouldn't mention it, and we shouldn't be here. */ ! internal_error ("ax-gdb.c (gen_expr): unhandled struct case"); } break; --- 1687,1694 ---- else /* If this `if' chain doesn't handle it, then the case list shouldn't mention it, and we shouldn't be here. */ ! internal_error (__FILE__, __LINE__, ! "gen_expr: unhandled struct case"); } break; Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.21 diff -p -r1.21 breakpoint.c *** breakpoint.c 2000/12/01 00:41:27 1.21 --- breakpoint.c 2000/12/01 11:16:33 *************** print_bp_stop_message (bpstat bs) *** 2182,2188 **** return print_it_typical (bs); break; default: ! internal_error ("print_bp_stop_message: unrecognized enum value"); break; } } --- 2182,2189 ---- return print_it_typical (bs); break; default: ! internal_error (__FILE__, __LINE__, ! "print_bp_stop_message: unrecognized enum value"); break; } } *************** print_one_breakpoint (struct breakpoint *** 3131,3137 **** annotate_field (1); if (((int) b->type > (sizeof (bptypes) / sizeof (bptypes[0]))) || ((int) b->type != bptypes[(int) b->type].type)) ! internal_error ("bptypes table does not describe type #%d.", (int) b->type); #ifdef UI_OUT ui_out_field_string (uiout, "type", bptypes[(int) b->type].description); --- 3132,3139 ---- annotate_field (1); if (((int) b->type > (sizeof (bptypes) / sizeof (bptypes[0]))) || ((int) b->type != bptypes[(int) b->type].type)) ! internal_error (__FILE__, __LINE__, ! "bptypes table does not describe type #%d.", (int) b->type); #ifdef UI_OUT ui_out_field_string (uiout, "type", bptypes[(int) b->type].description); *************** print_one_breakpoint (struct breakpoint *** 3163,3169 **** switch (b->type) { case bp_none: ! internal_error ("print_one_breakpoint: bp_none encountered\n"); break; case bp_watchpoint: --- 3165,3172 ---- switch (b->type) { case bp_none: ! internal_error (__FILE__, __LINE__, ! "print_one_breakpoint: bp_none encountered\n"); break; case bp_watchpoint: *************** check_duplicates (CORE_ADDR address, ase *** 3750,3763 **** /* Permanent breakpoint should always be inserted. */ if (! perm_bp->inserted) ! internal_error ("allegedly permanent breakpoint is not " "actually inserted"); ALL_BREAKPOINTS (b) if (b != perm_bp) { if (b->inserted) ! internal_error ("another breakpoint was inserted on top of " "a permanent breakpoint"); if (b->enable != disabled --- 3753,3768 ---- /* Permanent breakpoint should always be inserted. */ if (! perm_bp->inserted) ! internal_error (__FILE__, __LINE__, ! "allegedly permanent breakpoint is not " "actually inserted"); ALL_BREAKPOINTS (b) if (b != perm_bp) { if (b->inserted) ! internal_error (__FILE__, __LINE__, ! "another breakpoint was inserted on top of " "a permanent breakpoint"); if (b->enable != disabled *************** delete_breakpoint (struct breakpoint *bp *** 6782,6788 **** If there is a permanent breakpoint somewhere, it should always be the only one inserted. */ if (b->enable == permanent) ! internal_error ("another breakpoint was inserted on top of " "a permanent breakpoint"); if (b->type == bp_hardware_breakpoint) --- 6787,6794 ---- If there is a permanent breakpoint somewhere, it should always be the only one inserted. */ if (b->enable == permanent) ! internal_error (__FILE__, __LINE__, ! "another breakpoint was inserted on top of " "a permanent breakpoint"); if (b->type == bp_hardware_breakpoint) Index: ch-exp.c =================================================================== RCS file: /cvs/src/src/gdb/ch-exp.c,v retrieving revision 1.5 diff -p -r1.5 ch-exp.c *** ch-exp.c 2000/08/07 03:07:59 1.5 --- ch-exp.c 2000/12/01 11:16:35 *************** static enum ch_terminal *** 216,222 **** peek_token_ (int i) { if (i > MAX_LOOK_AHEAD) ! internal_error ("ch-exp.c - too much lookahead"); if (terminal_buffer[i] == TOKEN_NOT_READ) { terminal_buffer[i] = ch_lex (); --- 216,223 ---- peek_token_ (int i) { if (i > MAX_LOOK_AHEAD) ! internal_error (__FILE__, __LINE__, ! "too much lookahead"); if (terminal_buffer[i] == TOKEN_NOT_READ) { terminal_buffer[i] = ch_lex (); *************** pushback_token (enum ch_terminal code, Y *** 232,238 **** { int i; if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ) ! internal_error ("ch-exp.c - cannot pushback token"); for (i = MAX_LOOK_AHEAD; i > 0; i--) { terminal_buffer[i] = terminal_buffer[i - 1]; --- 233,240 ---- { int i; if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ) ! internal_error (__FILE__, __LINE__, ! "cannot pushback token"); for (i = MAX_LOOK_AHEAD; i > 0; i--) { terminal_buffer[i] = terminal_buffer[i - 1]; *************** require (enum ch_terminal token) *** 265,271 **** { if (PEEK_TOKEN () != token) { ! internal_error ("ch-exp.c - expected token %d", (int) token); } FORWARD_TOKEN (); } --- 267,274 ---- { if (PEEK_TOKEN () != token) { ! internal_error (__FILE__, __LINE__, ! "expected token %d", (int) token); } FORWARD_TOKEN (); } *************** ch_lex (void) *** 2177,2183 **** error ("Symbol \"%s\" names no location.", inputname); break; default: ! internal_error ("unhandled SYMBOL_CLASS in ch_lex()"); break; } } --- 2180,2187 ---- error ("Symbol \"%s\" names no location.", inputname); break; default: ! internal_error (__FILE__, __LINE__, ! "unhandled SYMBOL_CLASS in ch_lex()"); break; } } Index: command.c =================================================================== RCS file: /cvs/src/src/gdb/command.c,v retrieving revision 1.20 diff -p -r1.20 command.c *** command.c 2000/11/06 22:44:34 1.20 --- command.c 2000/12/01 11:16:40 *************** do_setshow_command (char *arg, int from_ *** 1774,1780 **** fputs_filtered ("auto", stb->stream); break; default: ! internal_error ("do_setshow_command: invalid var_auto_boolean"); break; } break; --- 1774,1781 ---- fputs_filtered ("auto", stb->stream); break; default: ! internal_error (__FILE__, __LINE__, ! "do_setshow_command: invalid var_auto_boolean"); break; } break; *************** do_setshow_command (char *arg, int from_ *** 1844,1850 **** fputs_filtered ("auto", gdb_stdout); break; default: ! internal_error ("do_setshow_command: invalid var_auto_boolean"); break; } break; --- 1845,1852 ---- fputs_filtered ("auto", gdb_stdout); break; default: ! internal_error (__FILE__, __LINE__, ! "do_setshow_command: invalid var_auto_boolean"); break; } break; Index: d10v-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/d10v-tdep.c,v retrieving revision 1.12 diff -p -r1.12 d10v-tdep.c *** d10v-tdep.c 2000/09/01 23:45:13 1.12 --- d10v-tdep.c 2000/12/01 11:16:42 *************** print_insn (CORE_ADDR memaddr, struct ui *** 1271,1277 **** { /* If there's no disassembler, something is very wrong. */ if (tm_print_insn == NULL) ! internal_error ("print_insn: no disassembler"); if (TARGET_BYTE_ORDER == BIG_ENDIAN) tm_print_insn_info.endian = BFD_ENDIAN_BIG; --- 1271,1278 ---- { /* If there's no disassembler, something is very wrong. */ if (tm_print_insn == NULL) ! internal_error (__FILE__, __LINE__, ! "print_insn: no disassembler"); if (TARGET_BYTE_ORDER == BIG_ENDIAN) tm_print_insn_info.endian = BFD_ENDIAN_BIG; *************** d10v_gdbarch_init (struct gdbarch_info i *** 1535,1541 **** set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_little); break; default: ! internal_error ("d10v_gdbarch_init: bad byte order for float format"); } set_gdbarch_use_generic_dummy_frames (gdbarch, 1); --- 1536,1543 ---- set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_little); break; default: ! internal_error (__FILE__, __LINE__, ! "d10v_gdbarch_init: bad byte order for float format"); } set_gdbarch_use_generic_dummy_frames (gdbarch, 1); Index: d30v-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/d30v-tdep.c,v retrieving revision 1.5 diff -p -r1.5 d30v-tdep.c *** d30v-tdep.c 2000/08/13 01:22:17 1.5 --- d30v-tdep.c 2000/12/01 11:16:47 *************** print_insn (CORE_ADDR memaddr, struct ui *** 1146,1152 **** { /* If there's no disassembler, something is very wrong. */ if (tm_print_insn == NULL) ! internal_error ("print_insn: no disassembler"); if (TARGET_BYTE_ORDER == BIG_ENDIAN) tm_print_insn_info.endian = BFD_ENDIAN_BIG; --- 1146,1153 ---- { /* If there's no disassembler, something is very wrong. */ if (tm_print_insn == NULL) ! internal_error (__FILE__, __LINE__, ! "print_insn: no disassembler"); if (TARGET_BYTE_ORDER == BIG_ENDIAN) tm_print_insn_info.endian = BFD_ENDIAN_BIG; Index: defs.h =================================================================== RCS file: /cvs/src/src/gdb/defs.h,v retrieving revision 1.32 diff -p -r1.32 defs.h *** defs.h 2000/11/20 02:06:18 1.32 --- defs.h 2000/12/01 11:16:49 *************** extern NORETURN void error_stream (struc *** 867,875 **** message. */ extern char *error_last_message (void); ! extern NORETURN void internal_verror (const char *, va_list ap) ATTR_NORETURN; ! extern NORETURN void internal_error (char *, ...) ATTR_NORETURN; extern NORETURN void nomem (long) ATTR_NORETURN; --- 867,877 ---- message. */ extern char *error_last_message (void); ! extern NORETURN void internal_verror (const char *file, int line, ! const char *, va_list ap) ATTR_NORETURN; ! extern NORETURN void internal_error (const char *file, int line, ! const char *, ...) ATTR_NORETURN ATTR_FORMAT (printf, 3, 4); extern NORETURN void nomem (long) ATTR_NORETURN; Index: dsrec.c =================================================================== RCS file: /cvs/src/src/gdb/dsrec.c,v retrieving revision 1.5 diff -p -r1.5 dsrec.c *** dsrec.c 2000/08/21 17:30:58 1.5 --- dsrec.c 2000/12/01 11:16:49 *************** make_srec (char *srec, CORE_ADDR targ_ad *** 250,256 **** else if (tmp & SREC_4_BYTE_ADDR) addr_size = 4; else ! internal_error ("make_srec: Bad address (0x%x), or bad flags (0x%x).", targ_addr, flags); /* Now that we know the address size, we can figure out how much --- 250,257 ---- else if (tmp & SREC_4_BYTE_ADDR) addr_size = 4; else ! internal_error (__FILE__, __LINE__, ! "make_srec: Bad address (0x%x), or bad flags (0x%x).", targ_addr, flags); /* Now that we know the address size, we can figure out how much Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.18 diff -p -r1.18 dwarf2read.c *** dwarf2read.c 2000/11/08 02:50:51 1.18 --- dwarf2read.c 2000/12/01 11:17:01 *************** read_comp_unit_head (struct comp_unit_he *** 944,950 **** info_ptr += 1; signed_addr = bfd_get_sign_extend_vma (abfd); if (signed_addr < 0) ! internal_error ("read_comp_unit_head: dwarf from non elf file"); cu_header->signed_addr_p = signed_addr; return info_ptr; } --- 944,951 ---- info_ptr += 1; signed_addr = bfd_get_sign_extend_vma (abfd); if (signed_addr < 0) ! internal_error (__FILE__, __LINE__, ! "read_comp_unit_head: dwarf from non elf file"); cu_header->signed_addr_p = signed_addr; return info_ptr; } *************** read_address (bfd *abfd, char *buf, cons *** 3463,3469 **** retval = bfd_get_signed_64 (abfd, (bfd_byte *) buf); break; default: ! internal_error ("read_address: bad switch, signed"); } } else --- 3464,3471 ---- retval = bfd_get_signed_64 (abfd, (bfd_byte *) buf); break; default: ! internal_error (__FILE__, __LINE__, ! "read_address: bad switch, signed"); } } else *************** read_address (bfd *abfd, char *buf, cons *** 3480,3486 **** retval = bfd_get_64 (abfd, (bfd_byte *) buf); break; default: ! internal_error ("read_address: bad switch, unsigned"); } } --- 3482,3489 ---- retval = bfd_get_64 (abfd, (bfd_byte *) buf); break; default: ! internal_error (__FILE__, __LINE__, ! "read_address: bad switch, unsigned"); } } *************** read_offset (bfd *abfd, char *buf, const *** 3565,3571 **** *bytes_read = 8; break; default: ! internal_error ("read_offset: bad switch"); } return retval; --- 3568,3575 ---- *bytes_read = 8; break; default: ! internal_error (__FILE__, __LINE__, ! "read_offset: bad switch"); } return retval; Index: elfread.c =================================================================== RCS file: /cvs/src/src/gdb/elfread.c,v retrieving revision 1.11 diff -p -r1.11 elfread.c *** elfread.c 2000/08/07 15:02:48 1.11 --- elfread.c 2000/12/01 11:17:03 *************** elf_symtab_read (struct objfile *objfile *** 483,489 **** } } else ! internal_error ("Section index uninitialized."); /* Bfd symbols are section relative. */ symaddr = sym->value + sym->section->vma; /* Relocate non-absolute symbols by the section offset. */ --- 483,490 ---- } } else ! internal_error (__FILE__, __LINE__, ! "Section index uninitialized."); /* Bfd symbols are section relative. */ symaddr = sym->value + sym->section->vma; /* Relocate non-absolute symbols by the section offset. */ *************** elf_symtab_read (struct objfile *objfile *** 494,500 **** if (index != -1) sectinfo->sections[index] = symaddr; else ! internal_error ("Section index uninitialized."); /* The special local symbols don't go in the minimal symbol table, so ignore this one. */ continue; --- 495,502 ---- if (index != -1) sectinfo->sections[index] = symaddr; else ! internal_error (__FILE__, __LINE__, ! "Section index uninitialized."); /* The special local symbols don't go in the minimal symbol table, so ignore this one. */ continue; Index: event-loop.c =================================================================== RCS file: /cvs/src/src/gdb/event-loop.c,v retrieving revision 1.8 diff -p -r1.8 event-loop.c *** event-loop.c 2000/09/01 23:52:09 1.8 --- event-loop.c 2000/12/01 11:17:05 *************** add_file_handler (int fd, handler_func * *** 484,490 **** if (poll (&fds, 1, 0) == 1 && (fds.revents & POLLNVAL)) use_poll = 0; #else ! internal_error ("event-loop.c : use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } if (use_poll) --- 484,491 ---- if (poll (&fds, 1, 0) == 1 && (fds.revents & POLLNVAL)) use_poll = 0; #else ! internal_error (__FILE__, __LINE__, ! "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } if (use_poll) *************** add_file_handler (int fd, handler_func * *** 492,498 **** #ifdef HAVE_POLL create_file_handler (fd, POLLIN, proc, client_data); #else ! internal_error ("event-loop.c : use_poll without HAVE_POLL"); #endif } else --- 493,500 ---- #ifdef HAVE_POLL create_file_handler (fd, POLLIN, proc, client_data); #else ! internal_error (__FILE__, __LINE__, ! "use_poll without HAVE_POLL"); #endif } else *************** create_file_handler (int fd, int mask, h *** 552,558 **** (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask; (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0; #else ! internal_error ("event-loop.c : use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else --- 554,561 ---- (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask; (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0; #else ! internal_error (__FILE__, __LINE__, ! "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else *************** delete_file_handler (int fd) *** 624,630 **** gdb_notifier.poll_fds = new_poll_fds; gdb_notifier.num_fds--; #else ! internal_error ("event-loop.c : use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else --- 627,634 ---- gdb_notifier.poll_fds = new_poll_fds; gdb_notifier.num_fds--; #else ! internal_error (__FILE__, __LINE__, ! "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else *************** handle_file_event (int event_file_desc) *** 725,731 **** else file_ptr->error = 0; #else ! internal_error ("event-loop.c : use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else --- 729,736 ---- else file_ptr->error = 0; #else ! internal_error (__FILE__, __LINE__, ! "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else *************** gdb_wait_for_event (void) *** 786,792 **** if (num_found == -1 && errno != EINTR) perror_with_name ("Poll"); #else ! internal_error ("event-loop.c : use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else --- 791,798 ---- if (num_found == -1 && errno != EINTR) perror_with_name ("Poll"); #else ! internal_error (__FILE__, __LINE__, ! "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else *************** gdb_wait_for_event (void) *** 847,853 **** file_ptr->ready_mask = (gdb_notifier.poll_fds + i)->revents; } #else ! internal_error ("event-loop.c : use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else --- 853,860 ---- file_ptr->ready_mask = (gdb_notifier.poll_fds + i)->revents; } #else ! internal_error (__FILE__, __LINE__, ! "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else *************** poll_timers (void) *** 1167,1173 **** #ifdef HAVE_POLL gdb_notifier.poll_timeout = delta.tv_sec * 1000; #else ! internal_error ("event-loop.c : use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else --- 1174,1181 ---- #ifdef HAVE_POLL gdb_notifier.poll_timeout = delta.tv_sec * 1000; #else ! internal_error (__FILE__, __LINE__, ! "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else Index: f-lang.c =================================================================== RCS file: /cvs/src/src/gdb/f-lang.c,v retrieving revision 1.5 diff -p -r1.5 f-lang.c *** f-lang.c 2000/08/11 01:02:35 1.5 --- f-lang.c 2000/12/01 11:17:07 *************** get_bf_for_fcn (long the_function) *** 896,902 **** item at the head of the queue is the one you want) */ if (saved_bf_list == NULL) ! internal_error ("cannot get .bf node off empty list"); if (current_head_bf_list != NULL) if (current_head_bf_list->symnum_fcn == the_function) --- 896,903 ---- item at the head of the queue is the one you want) */ if (saved_bf_list == NULL) ! internal_error (__FILE__, __LINE__, ! "cannot get .bf node off empty list"); if (current_head_bf_list != NULL) if (current_head_bf_list->symnum_fcn == the_function) Index: findvar.c =================================================================== RCS file: /cvs/src/src/gdb/findvar.c,v retrieving revision 1.15 diff -p -r1.15 findvar.c *** findvar.c 2000/07/30 01:48:25 1.15 --- findvar.c 2000/12/01 11:17:08 *************** extract_typed_address (void *buf, struct *** 190,196 **** { if (TYPE_CODE (type) != TYPE_CODE_PTR && TYPE_CODE (type) != TYPE_CODE_REF) ! internal_error ("findvar.c (extract_typed_address): " "type is not a pointer or reference"); return POINTER_TO_ADDRESS (type, buf); --- 190,197 ---- { if (TYPE_CODE (type) != TYPE_CODE_PTR && TYPE_CODE (type) != TYPE_CODE_REF) ! internal_error (__FILE__, __LINE__, ! "extract_typed_address: " "type is not a pointer or reference"); return POINTER_TO_ADDRESS (type, buf); *************** store_typed_address (void *buf, struct t *** 276,282 **** { if (TYPE_CODE (type) != TYPE_CODE_PTR && TYPE_CODE (type) != TYPE_CODE_REF) ! internal_error ("findvar.c (store_typed_address): " "type is not a pointer or reference"); ADDRESS_TO_POINTER (type, buf, addr); --- 277,284 ---- { if (TYPE_CODE (type) != TYPE_CODE_PTR && TYPE_CODE (type) != TYPE_CODE_REF) ! internal_error (__FILE__, __LINE__, ! "store_typed_address: " "type is not a pointer or reference"); ADDRESS_TO_POINTER (type, buf, addr); *************** value_of_register (int regnum) *** 415,421 **** memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer, REGISTER_RAW_SIZE (regnum)); else ! internal_error ("Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size", REGISTER_NAME (regnum), regnum, REGISTER_RAW_SIZE (regnum), --- 417,424 ---- memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer, REGISTER_RAW_SIZE (regnum)); else ! internal_error (__FILE__, __LINE__, ! "Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size", REGISTER_NAME (regnum), regnum, REGISTER_RAW_SIZE (regnum), *************** value_from_register (struct type *type, *** 874,880 **** VALUE_ADDRESS (v) = first_addr; } else ! internal_error ("value_from_register: Value not stored anywhere!"); VALUE_OPTIMIZED_OUT (v) = optim; --- 877,884 ---- VALUE_ADDRESS (v) = first_addr; } else ! internal_error (__FILE__, __LINE__, ! "value_from_register: Value not stored anywhere!"); VALUE_OPTIMIZED_OUT (v) = optim; Index: gdb_assert.h =================================================================== RCS file: /cvs/src/src/gdb/gdb_assert.h,v retrieving revision 1.1 diff -p -r1.1 gdb_assert.h *** gdb_assert.h 2000/09/03 17:19:41 1.1 --- gdb_assert.h 2000/12/01 11:17:08 *************** *** 43,50 **** /* This prints an "Assertion failed" message, aksing the user if they want to continue, dump core, or just exit. */ #define gdb_assert_fail(assertion, file, line, function) \ ! internal_error ("%s:%u: %s%sAssertion `%s' failed.", \ ! file, line, \ function ? function : "", function ? ": " : "", \ assertion) --- 43,49 ---- /* This prints an "Assertion failed" message, aksing the user if they want to continue, dump core, or just exit. */ #define gdb_assert_fail(assertion, file, line, function) \ ! internal_error (file, line, "%s%sAssertion `%s' failed.", \ function ? function : "", function ? ": " : "", \ assertion) Index: gdbarch.sh =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.sh,v retrieving revision 1.48 diff -p -r1.48 gdbarch.sh *** gdbarch.sh 2000/11/08 23:58:46 1.48 --- gdbarch.sh 2000/12/01 11:17:21 *************** do *** 665,671 **** printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n" if [ "${fallbackdefault}" = "0" ] then ! printf "#define ${macro}(${actual}) (internal_error (\"${macro}\"), 0)\n" else # FIXME: Should be passing current_gdbarch through! echo "#define ${macro}(${actual}) (${fallbackdefault} (${actual}))" \ --- 665,671 ---- printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n" if [ "${fallbackdefault}" = "0" ] then ! printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n" else # FIXME: Should be passing current_gdbarch through! echo "#define ${macro}(${actual}) (${fallbackdefault} (${actual}))" \ *************** extern disassemble_info tm_print_insn_in *** 969,975 **** /* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ #ifndef EXTRACT_STRUCT_VALUE_ADDRESS #define EXTRACT_STRUCT_VALUE_ADDRESS_P (0) ! #define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) #else #ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P #define EXTRACT_STRUCT_VALUE_ADDRESS_P (1) --- 969,975 ---- /* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ #ifndef EXTRACT_STRUCT_VALUE_ADDRESS #define EXTRACT_STRUCT_VALUE_ADDRESS_P (0) ! #define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error (__FILE__, __LINE__, "gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) #else #ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P #define EXTRACT_STRUCT_VALUE_ADDRESS_P (1) *************** verify_gdbarch (struct gdbarch *gdbarch) *** 1244,1252 **** return; /* fundamental */ if (gdbarch->byte_order == 0) ! internal_error ("verify_gdbarch: byte-order unset"); if (gdbarch->bfd_arch_info == NULL) ! internal_error ("verify_gdbarch: bfd_arch_info unset"); /* Check those that need to be defined for the given multi-arch level. */ EOF function_list | while do_read --- 1244,1254 ---- return; /* fundamental */ if (gdbarch->byte_order == 0) ! internal_error (__FILE__, __LINE__, ! "verify_gdbarch: byte-order unset"); if (gdbarch->bfd_arch_info == NULL) ! internal_error (__FILE__, __LINE__, ! "verify_gdbarch: bfd_arch_info unset"); /* Check those that need to be defined for the given multi-arch level. */ EOF function_list | while do_read *************** do *** 1276,1287 **** then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (${invalid_p}))\n" ! printf " internal_error (\"gdbarch: verify_gdbarch: ${function} invalid\");\n" elif [ "${predefault}" ] then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (gdbarch->${function} == ${predefault}))\n" ! printf " internal_error (\"gdbarch: verify_gdbarch: ${function} invalid\");\n" fi fi done --- 1278,1291 ---- then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (${invalid_p}))\n" ! printf " internal_error (__FILE__, __LINE__,\n" ! printf " \"gdbarch: verify_gdbarch: ${function} invalid\");\n" elif [ "${predefault}" ] then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (gdbarch->${function} == ${predefault}))\n" ! printf " internal_error (__FILE__, __LINE__,\n" ! printf " \"gdbarch: verify_gdbarch: ${function} invalid\");\n" fi fi done *************** do *** 1406,1412 **** fi printf "{\n" printf " if (gdbarch->${function} == 0)\n" ! printf " internal_error (\"gdbarch: gdbarch_${function} invalid\");\n" printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" test "${actual}" = "-" && actual="" --- 1410,1417 ---- fi printf "{\n" printf " if (gdbarch->${function} == 0)\n" ! printf " internal_error (__FILE__, __LINE__,\n" ! printf " \"gdbarch: gdbarch_${function} invalid\");\n" printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" test "${actual}" = "-" && actual="" *************** do *** 1436,1446 **** elif [ "${invalid_p}" ] then printf " if (${invalid_p})\n" ! printf " internal_error (\"gdbarch: gdbarch_${function} invalid\");\n" elif [ "${predefault}" ] then printf " if (gdbarch->${function} == ${predefault})\n" ! printf " internal_error (\"gdbarch: gdbarch_${function} invalid\");\n" fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" --- 1441,1453 ---- elif [ "${invalid_p}" ] then printf " if (${invalid_p})\n" ! printf " internal_error (__FILE__, __LINE__,\n" ! printf " \"gdbarch: gdbarch_${function} invalid\");\n" elif [ "${predefault}" ] then printf " if (gdbarch->${function} == ${predefault})\n" ! printf " internal_error (__FILE__, __LINE__,\n" ! printf " \"gdbarch: gdbarch_${function} invalid\");\n" fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" *************** void * *** 1537,1543 **** gdbarch_data (struct gdbarch_data *data) { if (data->index >= current_gdbarch->nr_data) ! internal_error ("gdbarch_data: request for non-existant data."); return current_gdbarch->data[data->index]; } --- 1544,1551 ---- gdbarch_data (struct gdbarch_data *data) { if (data->index >= current_gdbarch->nr_data) ! internal_error (__FILE__, __LINE__, ! "gdbarch_data: request for non-existant data."); return current_gdbarch->data[data->index]; } *************** gdbarch_printable_names (void) *** 1671,1677 **** const struct bfd_arch_info *ap; ap = bfd_lookup_arch (rego->bfd_architecture, 0); if (ap == NULL) ! internal_error ("gdbarch_architecture_names: multi-arch unknown"); do { append_name (&arches, &nr_arches, ap->printable_name); --- 1679,1686 ---- const struct bfd_arch_info *ap; ap = bfd_lookup_arch (rego->bfd_architecture, 0); if (ap == NULL) ! internal_error (__FILE__, __LINE__, ! "gdbarch_architecture_names: multi-arch unknown"); do { append_name (&arches, &nr_arches, ap->printable_name); *************** gdbarch_register (enum bfd_architecture *** 1700,1706 **** bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); if (bfd_arch_info == NULL) { ! internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture); } /* Check that we haven't seen this architecture before */ for (curr = &gdbarch_registry; --- 1709,1717 ---- bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); if (bfd_arch_info == NULL) { ! internal_error (__FILE__, __LINE__, ! "gdbarch: Attempt to register unknown architecture (%d)", ! bfd_architecture); } /* Check that we haven't seen this architecture before */ for (curr = &gdbarch_registry; *************** gdbarch_register (enum bfd_architecture *** 1708,1715 **** curr = &(*curr)->next) { if (bfd_architecture == (*curr)->bfd_architecture) ! internal_error ("gdbarch: Duplicate registraration of architecture (%s)", ! bfd_arch_info->printable_name); } /* log it */ if (gdbarch_debug) --- 1719,1727 ---- curr = &(*curr)->next) { if (bfd_architecture == (*curr)->bfd_architecture) ! internal_error (__FILE__, __LINE__, ! "gdbarch: Duplicate registraration of architecture (%s)", ! bfd_arch_info->printable_name); } /* log it */ if (gdbarch_debug) Index: go32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/go32-nat.c,v retrieving revision 1.6 diff -p -r1.6 go32-nat.c *** go32-nat.c 2000/08/06 07:19:38 1.6 --- go32-nat.c 2000/12/01 11:17:23 *************** go32_fetch_registers (int regno) *** 488,500 **** ((char *) &npx + regno_mapping[regno].tss_ofs); break; default: ! internal_error ("\ Invalid native size for register no. %d in go32_fetch_register.", regno); } supply_register (regno, (char *) ®val); } else ! internal_error ("Invalid register no. %d in go32_fetch_register.", regno); } } --- 488,501 ---- ((char *) &npx + regno_mapping[regno].tss_ofs); break; default: ! internal_error (__FILE__, __LINE__, "\ Invalid native size for register no. %d in go32_fetch_register.", regno); } supply_register (regno, (char *) ®val); } else ! internal_error (__FILE__, __LINE__, ! "Invalid register no. %d in go32_fetch_register.", regno); } } *************** store_register (int regno) *** 512,518 **** else if (regno < 32) rp = (char *) &npx + regno_mapping[regno].tss_ofs; else ! internal_error ("Invalid register no. %d in store_register.", regno); memcpy (rp, v, regno_mapping[regno].size); if (regno == FOP_REGNUM) *(short *)rp &= 0x07ff; /* strip high 5 bits, in case they added them */ --- 513,520 ---- else if (regno < 32) rp = (char *) &npx + regno_mapping[regno].tss_ofs; else ! internal_error (__FILE__, __LINE__, ! "Invalid register no. %d in store_register.", regno); memcpy (rp, v, regno_mapping[regno].size); if (regno == FOP_REGNUM) *(short *)rp &= 0x07ff; /* strip high 5 bits, in case they added them */ *************** go32_create_inferior (char *exec_file, c *** 617,623 **** /* Init command line storage. */ if (redir_debug_init (&child_cmd) == -1) ! internal_error ("Cannot allocate redirection storage: not enough memory.\n"); /* Parse the command line and create redirections. */ if (strpbrk (args, "<>")) --- 619,626 ---- /* Init command line storage. */ if (redir_debug_init (&child_cmd) == -1) ! internal_error (__FILE__, __LINE__, ! "Cannot allocate redirection storage: not enough memory.\n"); /* Parse the command line and create redirections. */ if (strpbrk (args, "<>")) *************** init_go32_ops (void) *** 1242,1248 **** /* Initialize child's command line storage. */ if (redir_debug_init (&child_cmd) == -1) ! internal_error ("Cannot allocate redirection storage: not enough memory.\n"); /* We are always processing GCC-compiled programs. */ processing_gcc_compilation = 2; --- 1245,1252 ---- /* Initialize child's command line storage. */ if (redir_debug_init (&child_cmd) == -1) ! internal_error (__FILE__, __LINE__, ! "Cannot allocate redirection storage: not enough memory.\n"); /* We are always processing GCC-compiled programs. */ processing_gcc_compilation = 2; Index: hppah-nat.c =================================================================== RCS file: /cvs/src/src/gdb/hppah-nat.c,v retrieving revision 1.5 diff -p -r1.5 hppah-nat.c *** hppah-nat.c 2000/09/02 00:07:32 1.5 --- hppah-nat.c 2000/12/01 11:17:25 *************** store_inferior_registers (int regno) *** 106,112 **** addr = (HPPAH_OFFSETOF (save_state_t, ss_narrow) + (REGISTER_BYTE (regno) - REGISTER_BYTE (1))); else ! internal_error ("hppah-nat.c (write_register): unexpected register size"); #ifdef GDB_TARGET_IS_HPPA_20W /* Unbelieveable. The PC head and tail must be written in 64bit hunks --- 106,113 ---- addr = (HPPAH_OFFSETOF (save_state_t, ss_narrow) + (REGISTER_BYTE (regno) - REGISTER_BYTE (1))); else ! internal_error (__FILE__, __LINE__, ! "hppah-nat.c (write_register): unexpected register size"); #ifdef GDB_TARGET_IS_HPPA_20W /* Unbelieveable. The PC head and tail must be written in 64bit hunks *************** fetch_register (int regno) *** 222,228 **** + (REGISTER_BYTE (regno) - REGISTER_BYTE (1))); else ! internal_error ("hppa-nat.c (fetch_register): unexpected register size"); for (i = 0; i < len; i += sizeof (int)) { --- 223,230 ---- + (REGISTER_BYTE (regno) - REGISTER_BYTE (1))); else ! internal_error (__FILE__, __LINE__, ! "hppa-nat.c (fetch_register): unexpected register size"); for (i = 0; i < len; i += sizeof (int)) { Index: i386-linux-nat.c =================================================================== RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v retrieving revision 1.18 diff -p -r1.18 i386-linux-nat.c *** i386-linux-nat.c 2000/09/22 17:45:47 1.18 --- i386-linux-nat.c 2000/12/01 11:17:28 *************** fetch_inferior_registers (int regno) *** 592,598 **** return; } ! internal_error ("Got request for bad register number %d.", regno); } /* Store register REGNO back into the child process. If REGNO is -1, --- 592,599 ---- return; } ! internal_error (__FILE__, __LINE__, ! "Got request for bad register number %d.", regno); } /* Store register REGNO back into the child process. If REGNO is -1, *************** store_inferior_registers (int regno) *** 645,651 **** return; } ! internal_error ("Got request to store bad register number %d.", regno); } --- 646,653 ---- return; } ! internal_error (__FILE__, __LINE__, ! "Got request to store bad register number %d.", regno); } Index: i386-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-tdep.c,v retrieving revision 1.15 diff -p -r1.15 i386-tdep.c *** i386-tdep.c 2000/07/30 01:48:25 1.15 --- i386-tdep.c 2000/12/01 11:17:30 *************** i386_extract_return_value (struct type * *** 770,776 **** ®buf[REGISTER_BYTE (HIGH_RETURN_REGNUM)], len - low_size); } else ! internal_error ("Cannot extract return value of %d bytes long.", len); } } --- 770,777 ---- ®buf[REGISTER_BYTE (HIGH_RETURN_REGNUM)], len - low_size); } else ! internal_error (__FILE__, __LINE__, ! "Cannot extract return value of %d bytes long.", len); } } Index: ia64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ia64-tdep.c,v retrieving revision 1.11 diff -p -r1.11 ia64-tdep.c *** ia64-tdep.c 2000/11/20 23:46:36 1.11 --- ia64-tdep.c 2000/12/01 11:17:37 *************** read_sigcontext_register (struct frame_i *** 324,343 **** CORE_ADDR regaddr; if (frame == NULL) ! internal_error ("read_sigcontext_register: NULL frame"); if (!frame->signal_handler_caller) ! internal_error ( ! "read_sigcontext_register: frame not a signal_handler_caller"); if (SIGCONTEXT_REGISTER_ADDRESS == 0) ! internal_error ( ! "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0"); regaddr = SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regnum); if (regaddr) return read_memory_integer (regaddr, REGISTER_RAW_SIZE (regnum)); else ! internal_error ( ! "read_sigcontext_register: Register %d not in struct sigcontext", regnum); } /* Extract ``len'' bits from an instruction bundle starting at --- 324,344 ---- CORE_ADDR regaddr; if (frame == NULL) ! internal_error (__FILE__, __LINE__, ! "read_sigcontext_register: NULL frame"); if (!frame->signal_handler_caller) ! internal_error (__FILE__, __LINE__, ! "read_sigcontext_register: frame not a signal_handler_caller"); if (SIGCONTEXT_REGISTER_ADDRESS == 0) ! internal_error (__FILE__, __LINE__, ! "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0"); regaddr = SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regnum); if (regaddr) return read_memory_integer (regaddr, REGISTER_RAW_SIZE (regnum)); else ! internal_error (__FILE__, __LINE__, ! "read_sigcontext_register: Register %d not in struct sigcontext", regnum); } /* Extract ``len'' bits from an instruction bundle starting at *************** process_note_abi_tag_sections (bfd *abfd *** 1922,1929 **** *os_ident_ptr = ELFOSABI_SOLARIS; break; default : ! internal_error ( ! "process_note_abi_sections: unknown OS number %d", os_number); break; } } --- 1923,1930 ---- *os_ident_ptr = ELFOSABI_SOLARIS; break; default : ! internal_error (__FILE__, __LINE__, ! "process_note_abi_sections: unknown OS number %d", os_number); break; } } Index: infcmd.c =================================================================== RCS file: /cvs/src/src/gdb/infcmd.c,v retrieving revision 1.13 diff -p -r1.13 infcmd.c *** infcmd.c 2000/11/10 19:27:45 1.13 --- infcmd.c 2000/12/01 11:17:40 *************** finish_command_continuation (struct cont *** 1090,1096 **** value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function)); if (!value_type) ! internal_error ("finish_command: function has no target type"); if (TYPE_CODE (value_type) == TYPE_CODE_VOID) { --- 1090,1097 ---- value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function)); if (!value_type) ! internal_error (__FILE__, __LINE__, ! "finish_command: function has no target type"); if (TYPE_CODE (value_type) == TYPE_CODE_VOID) { *************** finish_command (char *arg, int from_tty) *** 1217,1223 **** value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function)); if (!value_type) ! internal_error ("finish_command: function has no target type"); /* FIXME: Shouldn't we do the cleanups before returning? */ if (TYPE_CODE (value_type) == TYPE_CODE_VOID) --- 1218,1225 ---- value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function)); if (!value_type) ! internal_error (__FILE__, __LINE__, ! "finish_command: function has no target type"); /* FIXME: Shouldn't we do the cleanups before returning? */ if (TYPE_CODE (value_type) == TYPE_CODE_VOID) Index: inferior.h =================================================================== RCS file: /cvs/src/src/gdb/inferior.h,v retrieving revision 1.12 diff -p -r1.12 inferior.h *** inferior.h 2000/11/10 19:27:45 1.12 --- inferior.h 2000/12/01 11:17:40 *************** extern int attach_flag; *** 415,434 **** #endif /* No CALL_DUMMY_LOCATION. */ #if !defined (CALL_DUMMY_ADDRESS) ! #define CALL_DUMMY_ADDRESS() (internal_error ("CALL_DUMMY_ADDRESS"), 0) #endif #if !defined (CALL_DUMMY_START_OFFSET) ! #define CALL_DUMMY_START_OFFSET (internal_error ("CALL_DUMMY_START_OFFSET"), 0) #endif #if !defined (CALL_DUMMY_BREAKPOINT_OFFSET) #define CALL_DUMMY_BREAKPOINT_OFFSET_P (0) ! #define CALL_DUMMY_BREAKPOINT_OFFSET (internal_error ("CALL_DUMMY_BREAKPOINT_OFFSET"), 0) #endif #if !defined CALL_DUMMY_BREAKPOINT_OFFSET_P #define CALL_DUMMY_BREAKPOINT_OFFSET_P (1) #endif #if !defined (CALL_DUMMY_LENGTH) ! #define CALL_DUMMY_LENGTH (internal_error ("CALL_DUMMY_LENGTH"), 0) #endif #if defined (CALL_DUMMY_STACK_ADJUST) --- 415,434 ---- #endif /* No CALL_DUMMY_LOCATION. */ #if !defined (CALL_DUMMY_ADDRESS) ! #define CALL_DUMMY_ADDRESS() (internal_error (__FILE__, __LINE__, "CALL_DUMMY_ADDRESS"), 0) #endif #if !defined (CALL_DUMMY_START_OFFSET) ! #define CALL_DUMMY_START_OFFSET (internal_error (__FILE__, __LINE__, "CALL_DUMMY_START_OFFSET"), 0) #endif #if !defined (CALL_DUMMY_BREAKPOINT_OFFSET) #define CALL_DUMMY_BREAKPOINT_OFFSET_P (0) ! #define CALL_DUMMY_BREAKPOINT_OFFSET (internal_error (__FILE__, __LINE__, "CALL_DUMMY_BREAKPOINT_OFFSET"), 0) #endif #if !defined CALL_DUMMY_BREAKPOINT_OFFSET_P #define CALL_DUMMY_BREAKPOINT_OFFSET_P (1) #endif #if !defined (CALL_DUMMY_LENGTH) ! #define CALL_DUMMY_LENGTH (internal_error (__FILE__, __LINE__, "CALL_DUMMY_LENGTH"), 0) #endif #if defined (CALL_DUMMY_STACK_ADJUST) *************** extern int attach_flag; *** 437,443 **** #endif #endif #if !defined (CALL_DUMMY_STACK_ADJUST) ! #define CALL_DUMMY_STACK_ADJUST (internal_error ("CALL_DUMMY_STACK_ADJUST"), 0) #endif #if !defined (CALL_DUMMY_STACK_ADJUST_P) #define CALL_DUMMY_STACK_ADJUST_P (0) --- 437,443 ---- #endif #endif #if !defined (CALL_DUMMY_STACK_ADJUST) ! #define CALL_DUMMY_STACK_ADJUST (internal_error (__FILE__, __LINE__, "CALL_DUMMY_STACK_ADJUST"), 0) #endif #if !defined (CALL_DUMMY_STACK_ADJUST_P) #define CALL_DUMMY_STACK_ADJUST_P (0) *************** extern int attach_flag; *** 455,469 **** #endif #if !defined PUSH_DUMMY_FRAME ! #define PUSH_DUMMY_FRAME (internal_error ("PUSH_DUMMY_FRAME"), 0) #endif #if !defined FIX_CALL_DUMMY ! #define FIX_CALL_DUMMY(a1,a2,a3,a4,a5,a6,a7) (internal_error ("FIX_CALL_DUMMY"), 0) #endif #if !defined STORE_STRUCT_RETURN ! #define STORE_STRUCT_RETURN(a1,a2) (internal_error ("STORE_STRUCT_RETURN"), 0) #endif --- 455,469 ---- #endif #if !defined PUSH_DUMMY_FRAME ! #define PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "PUSH_DUMMY_FRAME"), 0) #endif #if !defined FIX_CALL_DUMMY ! #define FIX_CALL_DUMMY(a1,a2,a3,a4,a5,a6,a7) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0) #endif #if !defined STORE_STRUCT_RETURN ! #define STORE_STRUCT_RETURN(a1,a2) (internal_error (__FILE__, __LINE__, "STORE_STRUCT_RETURN"), 0) #endif Index: infptrace.c =================================================================== RCS file: /cvs/src/src/gdb/infptrace.c,v retrieving revision 1.6 diff -p -r1.6 infptrace.c *** infptrace.c 2000/09/09 01:38:49 1.6 --- infptrace.c 2000/12/01 11:17:42 *************** _initialize_kernel_u_addr (void) *** 340,346 **** if (nlist ("/vmunix", names) == 0) kernel_u_addr = names[0].n_value; else ! internal_error ("Unable to get kernel u area address."); #endif /* KERNEL_U_ADDR_BSD. */ } --- 340,347 ---- if (nlist ("/vmunix", names) == 0) kernel_u_addr = names[0].n_value; else ! internal_error (__FILE__, __LINE__, ! "Unable to get kernel u area address."); #endif /* KERNEL_U_ADDR_BSD. */ } Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.22 diff -p -r1.22 infrun.c *** infrun.c 2000/11/10 19:27:45 1.22 --- infrun.c 2000/12/01 11:17:53 *************** follow_inferior_fork (int parent_pid, in *** 473,479 **** /* Or, did the user not know, and want us to ask? */ if (follow_fork_mode_string == follow_fork_mode_ask) { ! internal_error ("follow_inferior_fork: \"ask\" mode not implemented"); /* follow_mode = follow_fork_mode_...; */ } --- 473,480 ---- /* Or, did the user not know, and want us to ask? */ if (follow_fork_mode_string == follow_fork_mode_ask) { ! internal_error (__FILE__, __LINE__, ! "follow_inferior_fork: \"ask\" mode not implemented"); /* follow_mode = follow_fork_mode_...; */ } *************** print_stop_reason (enum inferior_stop_re *** 3382,3388 **** #endif break; default: ! internal_error ("print_stop_reason: unrecognized enum value"); break; } } --- 3383,3390 ---- #endif break; default: ! internal_error (__FILE__, __LINE__, ! "print_stop_reason: unrecognized enum value"); break; } } *************** and/or watchpoints.\n"); *** 3518,3524 **** do_frame_printing = 0; break; default: ! internal_error ("Unknown value."); } #ifdef UI_OUT /* For mi, have the same behavior every time we stop: --- 3520,3527 ---- do_frame_printing = 0; break; default: ! internal_error (__FILE__, __LINE__, ! "Unknown value."); } #ifdef UI_OUT /* For mi, have the same behavior every time we stop: Index: language.c =================================================================== RCS file: /cvs/src/src/gdb/language.c,v retrieving revision 1.10 diff -p -r1.10 language.c *** language.c 2000/09/15 07:08:11 1.10 --- language.c 2000/12/01 11:17:56 *************** longest_local_hex_string_custom (LONGEST *** 721,727 **** if (strlen (local_hex_format_prefix ()) + num_len + num_pad_chars < RESULT_BUF_LEN) /* paranoia */ ! internal_error ("longest_local_hex_string_custom: insufficient space to store result"); strcpy (res2, local_hex_format_prefix ()); if (pad_on_left) --- 721,728 ---- if (strlen (local_hex_format_prefix ()) + num_len + num_pad_chars < RESULT_BUF_LEN) /* paranoia */ ! internal_error (__FILE__, __LINE__, ! "longest_local_hex_string_custom: insufficient space to store result"); strcpy (res2, local_hex_format_prefix ()); if (pad_on_left) Index: m3-nat.c =================================================================== RCS file: /cvs/src/src/gdb/m3-nat.c,v retrieving revision 1.6 diff -p -r1.6 m3-nat.c *** m3-nat.c 2000/10/30 21:50:57 1.6 --- m3-nat.c 2000/12/01 11:18:05 *************** catch_exception_raise (mach_port_t port, *** 1637,1643 **** } if (exception < 0 || exception > MAX_EXCEPTION) ! internal_error ("catch_exception_raise: unknown exception code %d thread %d", exception, mid); --- 1637,1644 ---- } if (exception < 0 || exception > MAX_EXCEPTION) ! internal_error (__FILE__, __LINE__, ! "catch_exception_raise: unknown exception code %d thread %d", exception, mid); *************** mach3_exception_actions (WAITTYPE *w, bo *** 3498,3504 **** stop_code); break; default: ! internal_error ("Unknown exception"); } } } --- 3499,3506 ---- stop_code); break; default: ! internal_error (__FILE__, __LINE__, ! "Unknown exception"); } } } *************** setup_notify_port (int create_new) *** 3523,3535 **** MACH_PORT_RIGHT_RECEIVE, &our_notify_port); if (ret != KERN_SUCCESS) ! internal_error ("Creating notify port %s", mach_error_string (ret)); ret = mach_port_move_member (mach_task_self (), our_notify_port, inferior_wait_port_set); if (ret != KERN_SUCCESS) ! internal_error ("initial move member %s", mach_error_string (ret)); } } --- 3525,3539 ---- MACH_PORT_RIGHT_RECEIVE, &our_notify_port); if (ret != KERN_SUCCESS) ! internal_error (__FILE__, __LINE__, ! "Creating notify port %s", mach_error_string (ret)); ret = mach_port_move_member (mach_task_self (), our_notify_port, inferior_wait_port_set); if (ret != KERN_SUCCESS) ! internal_error (__FILE__, __LINE__, ! "initial move member %s", mach_error_string (ret)); } } *************** _initialize_m3_nat (void) *** 4499,4505 **** MACH_PORT_RIGHT_PORT_SET, &inferior_wait_port_set); if (ret != KERN_SUCCESS) ! internal_error ("initial port set %s", mach_error_string (ret)); /* mach_really_wait now waits for this */ currently_waiting_for = inferior_wait_port_set; --- 4503,4510 ---- MACH_PORT_RIGHT_PORT_SET, &inferior_wait_port_set); if (ret != KERN_SUCCESS) ! internal_error (__FILE__, __LINE__, ! "initial port set %s", mach_error_string (ret)); /* mach_really_wait now waits for this */ currently_waiting_for = inferior_wait_port_set; Index: m68k-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/m68k-tdep.c,v retrieving revision 1.9 diff -p -r1.9 m68k-tdep.c *** m68k-tdep.c 2000/11/08 12:26:15 1.9 --- m68k-tdep.c 2000/12/01 11:18:05 *************** m68k_get_longjmp_target (CORE_ADDR *pc) *** 672,678 **** return 1; #else ! internal_error ("m68k_get_longjmp_target: not implemented"); return 0; #endif } --- 672,679 ---- return 1; #else ! internal_error (__FILE__, __LINE__, ! "m68k_get_longjmp_target: not implemented"); return 0; #endif } Index: maint.c =================================================================== RCS file: /cvs/src/src/gdb/maint.c,v retrieving revision 1.11 diff -p -r1.11 maint.c *** maint.c 2000/07/30 01:48:26 1.11 --- maint.c 2000/12/01 11:18:07 *************** maintenance_dump_me (char *args, int fro *** 115,121 **** static void maintenance_internal_error (char *args, int from_tty) { ! internal_error ("internal maintenance"); } /* Someday we should allow demangling for things other than just --- 115,122 ---- static void maintenance_internal_error (char *args, int from_tty) { ! internal_error (__FILE__, __LINE__, ! "internal maintenance"); } /* Someday we should allow demangling for things other than just Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.34 diff -p -r1.34 mips-tdep.c *** mips-tdep.c 2000/10/30 21:50:57 1.34 --- mips-tdep.c 2000/12/01 11:18:23 *************** mips_mask_address_p (void) *** 477,483 **** case CMD_AUTO_BOOLEAN_AUTO: return MIPS_DEFAULT_MASK_ADDRESS_P; default: ! internal_error ("mips_mask_address_p: bad switch"); return -1; } } --- 477,484 ---- case CMD_AUTO_BOOLEAN_AUTO: return MIPS_DEFAULT_MASK_ADDRESS_P; default: ! internal_error (__FILE__, __LINE__, ! "mips_mask_address_p: bad switch"); return -1; } } *************** show_mask_address (char *cmd, int from_t *** 498,504 **** mips_mask_address_p () ? "enabled" : "disabled"); break; default: ! internal_error ("show_mask_address: bad switch"); break; } } --- 499,506 ---- mips_mask_address_p () ? "enabled" : "disabled"); break; default: ! internal_error (__FILE__, __LINE__, ! "show_mask_address: bad switch"); break; } } Index: mn10300-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v retrieving revision 1.5 diff -p -r1.5 mn10300-tdep.c *** mn10300-tdep.c 2000/08/12 03:28:42 1.5 --- mn10300-tdep.c 2000/12/01 11:18:30 *************** mn10300_gdbarch_init (struct gdbarch_inf *** 974,980 **** num_regs = 32; break; default: ! internal_error ("mn10300_gdbarch_init: Unknown mn10300 variant"); return NULL; /* keep GCC happy. */ } --- 974,981 ---- num_regs = 32; break; default: ! internal_error (__FILE__, __LINE__, ! "mn10300_gdbarch_init: Unknown mn10300 variant"); return NULL; /* keep GCC happy. */ } Index: objfiles.c =================================================================== RCS file: /cvs/src/src/gdb/objfiles.c,v retrieving revision 1.11 diff -p -r1.11 objfiles.c *** objfiles.c 2000/11/03 19:00:06 1.11 --- objfiles.c 2000/12/01 11:18:38 *************** unlink_objfile (struct objfile *objfile) *** 370,376 **** } } ! internal_error ("objfiles.c (unlink_objfile): objfile already unlinked"); } --- 370,377 ---- } } ! internal_error (__FILE__, __LINE__, ! "unlink_objfile: objfile already unlinked"); } Index: objfiles.h =================================================================== RCS file: /cvs/src/src/gdb/objfiles.h,v retrieving revision 1.6 diff -p -r1.6 objfiles.h *** objfiles.h 2000/08/07 15:02:48 1.6 --- objfiles.h 2000/12/01 11:18:41 *************** extern int is_in_import_list (char *, st *** 586,601 **** ALL_OBJFILE_OSECTIONS (objfile, osect) #define SECT_OFF_DATA(objfile) \ ! ((objfile->sect_index_data == -1) ? \ ! (internal_error ("sect_index_data not initialized"), -1) : objfile->sect_index_data) #define SECT_OFF_RODATA(objfile) \ ! ((objfile->sect_index_rodata == -1) ? \ ! (internal_error ("sect_index_rodata not initialized"), -1) : objfile->sect_index_rodata) #define SECT_OFF_TEXT(objfile) \ ! ((objfile->sect_index_text == -1) ? \ ! (internal_error ("sect_index_text not initialized"), -1) : objfile->sect_index_text) /* Sometimes the .bss section is missing from the objfile, so we don't want to die here. Let the users of SECT_OFF_BSS deal with an --- 586,604 ---- ALL_OBJFILE_OSECTIONS (objfile, osect) #define SECT_OFF_DATA(objfile) \ ! ((objfile->sect_index_data == -1) \ ! ? (internal_error (__FILE__, __LINE__, "sect_index_data not initialized"), -1) \ ! : objfile->sect_index_data) #define SECT_OFF_RODATA(objfile) \ ! ((objfile->sect_index_rodata == -1) \ ! ? (internal_error (__FILE__, __LINE__, "sect_index_rodata not initialized"), -1) \ ! : objfile->sect_index_rodata) #define SECT_OFF_TEXT(objfile) \ ! ((objfile->sect_index_text == -1) \ ! ? (internal_error (__FILE__, __LINE__, "sect_index_text not initialized"), -1) \ ! : objfile->sect_index_text) /* Sometimes the .bss section is missing from the objfile, so we don't want to die here. Let the users of SECT_OFF_BSS deal with an Index: regcache.c =================================================================== RCS file: /cvs/src/src/gdb/regcache.c,v retrieving revision 1.12 diff -p -r1.12 regcache.c *** regcache.c 2000/11/17 01:30:53 1.12 --- regcache.c 2000/12/01 11:18:44 *************** generic_target_read_pc (int pid) *** 742,748 **** return pc_val; } #endif ! internal_error ("generic_target_read_pc"); return 0; } --- 742,749 ---- return pc_val; } #endif ! internal_error (__FILE__, __LINE__, ! "generic_target_read_pc"); return 0; } *************** generic_target_write_pc (CORE_ADDR pc, i *** 779,785 **** if (NNPC_REGNUM >= 0) write_register_pid (NNPC_REGNUM, pc + 8, pid); #else ! internal_error ("generic_target_write_pc"); #endif } --- 780,787 ---- if (NNPC_REGNUM >= 0) write_register_pid (NNPC_REGNUM, pc + 8, pid); #else ! internal_error (__FILE__, __LINE__, ! "generic_target_write_pc"); #endif } *************** generic_target_read_sp (void) *** 812,818 **** if (SP_REGNUM >= 0) return read_register (SP_REGNUM); #endif ! internal_error ("generic_target_read_sp"); } CORE_ADDR --- 814,821 ---- if (SP_REGNUM >= 0) return read_register (SP_REGNUM); #endif ! internal_error (__FILE__, __LINE__, ! "generic_target_read_sp"); } CORE_ADDR *************** generic_target_write_sp (CORE_ADDR val) *** 831,837 **** return; } #endif ! internal_error ("generic_target_write_sp"); } void --- 834,841 ---- return; } #endif ! internal_error (__FILE__, __LINE__, ! "generic_target_write_sp"); } void *************** generic_target_read_fp (void) *** 847,853 **** if (FP_REGNUM >= 0) return read_register (FP_REGNUM); #endif ! internal_error ("generic_target_read_fp"); } CORE_ADDR --- 851,858 ---- if (FP_REGNUM >= 0) return read_register (FP_REGNUM); #endif ! internal_error (__FILE__, __LINE__, ! "generic_target_read_fp"); } CORE_ADDR *************** generic_target_write_fp (CORE_ADDR val) *** 866,872 **** return; } #endif ! internal_error ("generic_target_write_fp"); } void --- 871,878 ---- return; } #endif ! internal_error (__FILE__, __LINE__, ! "generic_target_write_fp"); } void Index: remote-mips.c =================================================================== RCS file: /cvs/src/src/gdb/remote-mips.c,v retrieving revision 1.10 diff -p -r1.10 remote-mips.c *** remote-mips.c 2000/09/12 17:20:09 1.10 --- remote-mips.c 2000/12/01 11:18:51 *************** mips_request (int cmd, *** 1244,1250 **** if (cmd != '\0') { if (mips_need_reply) ! internal_error ("mips_request: Trying to send command before reply"); sprintf (buff, "0x0 %c 0x%s 0x%s", cmd, paddr_nz (addr), paddr_nz (data)); mips_send_packet (buff, 1); mips_need_reply = 1; --- 1244,1251 ---- if (cmd != '\0') { if (mips_need_reply) ! internal_error (__FILE__, __LINE__, ! "mips_request: Trying to send command before reply"); sprintf (buff, "0x0 %c 0x%s 0x%s", cmd, paddr_nz (addr), paddr_nz (data)); mips_send_packet (buff, 1); mips_need_reply = 1; *************** mips_request (int cmd, *** 1254,1260 **** return 0; if (!mips_need_reply) ! internal_error ("mips_request: Trying to get reply before command"); mips_need_reply = 0; --- 1255,1262 ---- return 0; if (!mips_need_reply) ! internal_error (__FILE__, __LINE__, ! "mips_request: Trying to get reply before command"); mips_need_reply = 0; Index: remote-sim.c =================================================================== RCS file: /cvs/src/src/gdb/remote-sim.c,v retrieving revision 1.8 diff -p -r1.8 remote-sim.c *** remote-sim.c 2000/10/12 21:39:21 1.8 --- remote-sim.c 2000/12/01 11:19:00 *************** gdbsim_store_register (int regno) *** 333,339 **** REGISTER_SIM_REGNO (regno), tmp, REGISTER_RAW_SIZE (regno)); if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno)) ! internal_error ("Register size different to expected"); if (sr_get_debug ()) { printf_filtered ("gdbsim_store_register: %d", regno); --- 333,340 ---- REGISTER_SIM_REGNO (regno), tmp, REGISTER_RAW_SIZE (regno)); if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno)) ! internal_error (__FILE__, __LINE__, ! "Register size different to expected"); if (sr_get_debug ()) { printf_filtered ("gdbsim_store_register: %d", regno); *************** gdbsim_open (char *args, int from_tty) *** 479,485 **** strcat (arg_buf, " -E little"); break; default: ! internal_error ("Value of TARGET_BYTE_ORDER unknown"); } } /* Specify the architecture of the target when it has been --- 480,487 ---- strcat (arg_buf, " -E little"); break; default: ! internal_error (__FILE__, __LINE__, ! "Value of TARGET_BYTE_ORDER unknown"); } } /* Specify the architecture of the target when it has been Index: remote-vx.c =================================================================== RCS file: /cvs/src/src/gdb/remote-vx.c,v retrieving revision 1.9 diff -p -r1.9 remote-vx.c *** remote-vx.c 2000/10/30 21:50:57 1.9 --- remote-vx.c 2000/12/01 11:19:05 *************** vx_wait (int pid_to_wait_for, struct tar *** 976,982 **** sleep_ms (200); /* FIXME Don't kill the network too badly */ } else if (pid != inferior_pid) ! internal_error ("Bad pid for debugged task: %s\n", local_hex_string ((unsigned long) pid)); } while (pid == 0); --- 976,983 ---- sleep_ms (200); /* FIXME Don't kill the network too badly */ } else if (pid != inferior_pid) ! internal_error (__FILE__, __LINE__, ! "Bad pid for debugged task: %s\n", local_hex_string ((unsigned long) pid)); } while (pid == 0); Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.30 diff -p -r1.30 remote.c *** remote.c 2000/11/27 02:18:44 1.30 --- remote.c 2000/12/01 11:19:18 *************** packet_ok (const char *buf, struct packe *** 615,621 **** config->support = PACKET_ENABLE; break; case PACKET_DISABLE: ! internal_error ("packet_ok: attempt to use a disabled packet"); break; case PACKET_ENABLE: break; --- 615,622 ---- config->support = PACKET_ENABLE; break; case PACKET_DISABLE: ! internal_error (__FILE__, __LINE__, ! "packet_ok: attempt to use a disabled packet"); break; case PACKET_ENABLE: break; *************** remote_threads_extra_info (struct thread *** 1681,1687 **** int n = 0; /* position in display_buf */ if (remote_desc == 0) /* paranoia */ ! internal_error ("remote_threads_extra_info"); if (use_threadextra_query) { --- 1682,1689 ---- int n = 0; /* position in display_buf */ if (remote_desc == 0) /* paranoia */ ! internal_error (__FILE__, __LINE__, ! "remote_threads_extra_info"); if (use_threadextra_query) { *************** remote_write_bytes (CORE_ADDR memaddr, c *** 3363,3372 **** todo = min (len, max_buf_size / 2); break; case PACKET_SUPPORT_UNKNOWN: ! internal_error ("%s:%d: remote_write_bytes: bad internal state", ! __FILE__, __LINE__); default: ! internal_error ("%s:%d: bad switch", __FILE__, __LINE__); } /* Append */ --- 3365,3374 ---- todo = min (len, max_buf_size / 2); break; case PACKET_SUPPORT_UNKNOWN: ! internal_error (__FILE__, __LINE__, ! "remote_write_bytes: bad internal state"); default: ! internal_error (__FILE__, __LINE__, "bad switch"); } /* Append */ *************** remote_write_bytes (CORE_ADDR memaddr, c *** 3430,3439 **** *p = '\0'; break; case PACKET_SUPPORT_UNKNOWN: ! internal_error ("%s:%d: remote_write_bytes: bad internal state", ! __FILE__, __LINE__); default: ! internal_error ("%s:%d: bad switch", __FILE__, __LINE__); } putpkt_binary (buf, (int) (p - buf)); --- 3432,3441 ---- *p = '\0'; break; case PACKET_SUPPORT_UNKNOWN: ! internal_error (__FILE__, __LINE__, ! "remote_write_bytes: bad internal state"); default: ! internal_error (__FILE__, __LINE__, "bad switch"); } putpkt_binary (buf, (int) (p - buf)); *************** watchpoint_to_Z_packet (int type) *** 4337,4343 **** return 4; break; default: ! internal_error ("hw_bp_to_z: bad watchpoint type %d", type); } } --- 4339,4346 ---- return 4; break; default: ! internal_error (__FILE__, __LINE__, ! "hw_bp_to_z: bad watchpoint type %d", type); } } *************** remote_insert_watchpoint (CORE_ADDR addr *** 4373,4379 **** case PACKET_OK: return 0; } ! internal_error ("remote_insert_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote --- 4376,4383 ---- case PACKET_OK: return 0; } ! internal_error (__FILE__, __LINE__, ! "remote_insert_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote *************** remote_remove_watchpoint (CORE_ADDR addr *** 4407,4413 **** case PACKET_OK: return 0; } ! internal_error ("remote_remove_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote --- 4411,4418 ---- case PACKET_OK: return 0; } ! internal_error (__FILE__, __LINE__, ! "remote_remove_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote *************** remote_insert_hw_breakpoint (CORE_ADDR a *** 4443,4449 **** case PACKET_OK: return 0; } ! internal_error ("remote_remove_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote --- 4448,4455 ---- case PACKET_OK: return 0; } ! internal_error (__FILE__, __LINE__, ! "remote_remove_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote *************** remote_remove_hw_breakpoint (CORE_ADDR a *** 4479,4485 **** case PACKET_OK: return 0; } ! internal_error ("remote_remove_watchpoint: reached end of function"); } /* Some targets are only capable of doing downloads, and afterwards --- 4485,4492 ---- case PACKET_OK: return 0; } ! internal_error (__FILE__, __LINE__, ! "remote_remove_watchpoint: reached end of function"); } /* Some targets are only capable of doing downloads, and afterwards *************** static void *** 5402,5408 **** remote_async (void (*callback) (enum inferior_event_type event_type, void *context), void *context) { if (current_target.to_async_mask_value == 0) ! internal_error ("Calling remote_async when async is masked"); if (callback != NULL) { --- 5409,5416 ---- remote_async (void (*callback) (enum inferior_event_type event_type, void *context), void *context) { if (current_target.to_async_mask_value == 0) ! internal_error (__FILE__, __LINE__, ! "Calling remote_async when async is masked"); if (callback != NULL) { Index: rs6000-nat.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-nat.c,v retrieving revision 1.11 diff -p -r1.11 rs6000-nat.c *** rs6000-nat.c 2000/11/09 09:49:00 1.11 --- rs6000-nat.c 2000/12/01 11:19:20 *************** set_host_arch (int pid) *** 927,933 **** if (!gdbarch_update_p (info)) { ! internal_error ("set_host_arch: failed to select architecture"); } } --- 927,934 ---- if (!gdbarch_update_p (info)) { ! internal_error (__FILE__, __LINE__, ! "set_host_arch: failed to select architecture"); } } Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.17 diff -p -r1.17 rs6000-tdep.c *** rs6000-tdep.c 2000/11/18 05:50:11 1.17 --- rs6000-tdep.c 2000/12/01 11:19:25 *************** process_note_abi_tag_sections (bfd *abfd *** 2039,2046 **** *os_ident_ptr = ELFOSABI_SOLARIS; break; default : ! internal_error ( ! "process_note_abi_sections: unknown OS number %d", os_number); break; } } --- 2039,2047 ---- *os_ident_ptr = ELFOSABI_SOLARIS; break; default : ! internal_error (__FILE__, __LINE__, ! "process_note_abi_sections: unknown OS number %d", ! os_number); break; } } Index: serial.c =================================================================== RCS file: /cvs/src/src/gdb/serial.c,v retrieving revision 1.4 diff -p -r1.4 serial.c *** serial.c 2000/06/08 00:52:56 1.4 --- serial.c 2000/12/01 11:19:28 *************** serial_readchar (serial_t scb, int timeo *** 347,353 **** /* FIXME: cagney/1999-10-11: Don't enable this check until the ASYNC code is finished. */ if (0 && SERIAL_IS_ASYNC_P (scb) && timeout < 0) ! internal_error ("serial_readchar: blocking read in async mode"); ch = scb->ops->readchar (scb, timeout); if (serial_logfp != NULL) --- 347,354 ---- /* FIXME: cagney/1999-10-11: Don't enable this check until the ASYNC code is finished. */ if (0 && SERIAL_IS_ASYNC_P (scb) && timeout < 0) ! internal_error (__FILE__, __LINE__, ! "serial_readchar: blocking read in async mode"); ch = scb->ops->readchar (scb, timeout); if (serial_logfp != NULL) *************** deprecated_serial_fd (serial_t scb) *** 506,512 **** called? */ if (scb->fd < 0) { ! internal_error ("serial: FD not valid"); } return scb->fd; /* sigh */ } --- 507,514 ---- called? */ if (scb->fd < 0) { ! internal_error (__FILE__, __LINE__, ! "serial: FD not valid"); } return scb->fd; /* sigh */ } Index: sh-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sh-tdep.c,v retrieving revision 1.16 diff -p -r1.16 sh-tdep.c *** sh-tdep.c 2000/10/31 19:35:03 1.16 --- sh-tdep.c 2000/12/01 11:19:31 *************** static void *** 1663,1669 **** sh_do_pseudo_register (int regnum) { if (regnum < NUM_REGS || regnum >= NUM_REGS + NUM_PSEUDO_REGS) ! internal_error ("Invalid pseudo register number %d\n", regnum); else if (regnum >= NUM_REGS && regnum < gdbarch_tdep (current_gdbarch)->FV0_REGNUM) do_dr_register_info (regnum); --- 1663,1670 ---- sh_do_pseudo_register (int regnum) { if (regnum < NUM_REGS || regnum >= NUM_REGS + NUM_PSEUDO_REGS) ! internal_error (__FILE__, __LINE__, ! "Invalid pseudo register number %d\n", regnum); else if (regnum >= NUM_REGS && regnum < gdbarch_tdep (current_gdbarch)->FV0_REGNUM) do_dr_register_info (regnum); *************** static void *** 1734,1740 **** sh_print_register (int regnum) { if (regnum < 0 || regnum >= NUM_REGS + NUM_PSEUDO_REGS) ! internal_error ("Invalid register number %d\n", regnum); else if (regnum > 0 && regnum < NUM_REGS) { --- 1735,1742 ---- sh_print_register (int regnum) { if (regnum < 0 || regnum >= NUM_REGS + NUM_PSEUDO_REGS) ! internal_error (__FILE__, __LINE__, ! "Invalid register number %d\n", regnum); else if (regnum > 0 && regnum < NUM_REGS) { Index: solib-svr4.c =================================================================== RCS file: /cvs/src/src/gdb/solib-svr4.c,v retrieving revision 1.4 diff -p -r1.4 solib-svr4.c *** solib-svr4.c 2000/11/21 01:09:54 1.4 --- solib-svr4.c 2000/12/01 11:19:37 *************** default_svr4_fetch_link_map_offsets (voi *** 209,215 **** #else ! internal_error ("default_svr4_fetch_link_map_offsets called without HAVE_LINK_H defined."); return 0; #endif /* HAVE_LINK_H */ --- 209,216 ---- #else ! internal_error (__FILE__, __LINE__, ! "default_svr4_fetch_link_map_offsets called without HAVE_LINK_H defined."); return 0; #endif /* HAVE_LINK_H */ Index: solib.c =================================================================== RCS file: /cvs/src/src/gdb/solib.c,v retrieving revision 1.29 diff -p -r1.29 solib.c *** solib.c 2000/11/27 02:18:44 1.29 --- solib.c 2000/12/01 11:19:39 *************** info_sharedlibrary_command (char *ignore *** 615,622 **** } else { ! internal_error ("%s:%d: bfd_get_arch_size() returned unknown size %d", ! __FILE__, __LINE__, arch_size); } update_solib_list (from_tty, 0); --- 615,623 ---- } else { ! internal_error (__FILE__, __LINE__, ! "bfd_get_arch_size() returned unknown size %d", ! arch_size); } update_solib_list (from_tty, 0); Index: source.c =================================================================== RCS file: /cvs/src/src/gdb/source.c,v retrieving revision 1.5 diff -p -r1.5 source.c *** source.c 2000/12/01 00:41:27 1.5 --- source.c 2000/12/01 11:19:41 *************** select_source_symtab (register struct sy *** 200,206 **** { if (cs_pst->readin) { ! internal_error ("select_source_symtab: readin pst found and no symtabs."); } else { --- 200,208 ---- { if (cs_pst->readin) { ! internal_error (__FILE__, __LINE__, ! "select_source_symtab: " ! "readin pst found and no symtabs."); } else { Index: sparc-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sparc-tdep.c,v retrieving revision 1.9 diff -p -r1.9 sparc-tdep.c *** sparc-tdep.c 2000/10/24 20:05:35 1.9 --- sparc-tdep.c 2000/12/01 11:19:49 *************** setup_arbitrary_frame (int argc, CORE_AD *** 526,532 **** frame = create_new_frame (argv[0], 0); if (!frame) ! internal_error ("create_new_frame returned invalid frame"); frame->extra_info->bottom = argv[1]; frame->pc = FRAME_SAVED_PC (frame); --- 526,533 ---- frame = create_new_frame (argv[0], 0); if (!frame) ! internal_error (__FILE__, __LINE__, ! "create_new_frame returned invalid frame"); frame->extra_info->bottom = argv[1]; frame->pc = FRAME_SAVED_PC (frame); *************** sparc_frame_find_saved_regs (struct fram *** 1053,1059 **** CORE_ADDR frame_addr = FRAME_FP (fi); if (!fi) ! internal_error ("Bad frame info struct in FRAME_FIND_SAVED_REGS"); memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR)); --- 1054,1061 ---- CORE_ADDR frame_addr = FRAME_FP (fi); if (!fi) ! internal_error (__FILE__, __LINE__, ! "Bad frame info struct in FRAME_FIND_SAVED_REGS"); memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR)); Index: symm-nat.c =================================================================== RCS file: /cvs/src/src/gdb/symm-nat.c,v retrieving revision 1.4 diff -p -r1.4 symm-nat.c *** symm-nat.c 2000/11/02 03:18:49 1.4 --- symm-nat.c 2000/12/01 11:19:51 *************** child_wait (int pid, struct target_waits *** 531,537 **** } break; case PTS_WATCHPT_HIT: ! internal_error ("PTS_WATCHPT_HIT\n"); break; default: /* stopped by signal */ --- 531,538 ---- } break; case PTS_WATCHPT_HIT: ! internal_error (__FILE__, __LINE__, ! "PTS_WATCHPT_HIT\n"); break; default: /* stopped by signal */ *************** _initialize_symm_nat (void) *** 844,850 **** rv = mptrace (XPT_MPDEBUGGER, 0, 0, 0); if (-1 == rv) { ! internal_error ("_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s", safe_strerror (errno)); } --- 845,852 ---- rv = mptrace (XPT_MPDEBUGGER, 0, 0, 0); if (-1 == rv) { ! internal_error (__FILE__, __LINE__, ! "_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s", safe_strerror (errno)); } *************** _initialize_symm_nat (void) *** 862,874 **** rv = sigaddset (&set, SIGCHLD); if (-1 == rv) { ! internal_error ("_initialize_symm_nat(): sigaddset(SIGCHLD): %s", safe_strerror (errno)); } rv = sigprocmask (SIG_BLOCK, &set, (sigset_t *) NULL); if (-1 == rv) { ! internal_error ("_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s", safe_strerror (errno)); } --- 864,878 ---- rv = sigaddset (&set, SIGCHLD); if (-1 == rv) { ! internal_error (__FILE__, __LINE__, ! "_initialize_symm_nat(): sigaddset(SIGCHLD): %s", safe_strerror (errno)); } rv = sigprocmask (SIG_BLOCK, &set, (sigset_t *) NULL); if (-1 == rv) { ! internal_error (__FILE__, __LINE__, ! "_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s", safe_strerror (errno)); } *************** _initialize_symm_nat (void) *** 878,884 **** rv = sigaction (SIGCHLD, &sact, (struct sigaction *) NULL); if (-1 == rv) { ! internal_error ("_initialize_symm_nat(): sigaction(SIGCHLD): %s", safe_strerror (errno)); } #endif --- 882,889 ---- rv = sigaction (SIGCHLD, &sact, (struct sigaction *) NULL); if (-1 == rv) { ! internal_error (__FILE__, __LINE__, ! "_initialize_symm_nat(): sigaction(SIGCHLD): %s", safe_strerror (errno)); } #endif Index: symtab.h =================================================================== RCS file: /cvs/src/src/gdb/symtab.h,v retrieving revision 1.16 diff -p -r1.16 symtab.h *** symtab.h 2000/11/10 23:02:56 1.16 --- symtab.h 2000/12/01 11:19:55 *************** struct section_offsets *** 828,835 **** }; #define ANOFFSET(secoff, whichone) \ ! ((whichone == -1) ? \ ! (internal_error ("Section index is uninitialized"), -1) : secoff->offsets[whichone]) /* The maximum possible size of a section_offsets table. */ --- 828,836 ---- }; #define ANOFFSET(secoff, whichone) \ ! ((whichone == -1) \ ! ? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \ ! : secoff->offsets[whichone]) /* The maximum possible size of a section_offsets table. */ Index: target.h =================================================================== RCS file: /cvs/src/src/gdb/target.h,v retrieving revision 1.9 diff -p -r1.9 target.h *** target.h 2000/11/21 10:26:07 1.9 --- target.h 2000/12/01 11:19:59 *************** extern void push_remote_target (char *na *** 1391,1397 **** #ifndef SOFTWARE_SINGLE_STEP_P #define SOFTWARE_SINGLE_STEP_P 0 #define SOFTWARE_SINGLE_STEP(sig,bp_p) \ ! (internal_error ("SOFTWARE_SINGLE_STEP"), 0) #endif /* SOFTWARE_SINGLE_STEP_P */ /* Blank target vector entries are initialized to target_ignore. */ --- 1391,1397 ---- #ifndef SOFTWARE_SINGLE_STEP_P #define SOFTWARE_SINGLE_STEP_P 0 #define SOFTWARE_SINGLE_STEP(sig,bp_p) \ ! (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0) #endif /* SOFTWARE_SINGLE_STEP_P */ /* Blank target vector entries are initialized to target_ignore. */ Index: top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.23 diff -p -r1.23 top.c *** top.c 2000/12/01 00:43:47 1.23 --- top.c 2000/12/01 11:20:10 *************** arg_cleanup (void *ignore) *** 1249,1255 **** { struct user_args *oargs = user_args; if (!user_args) ! internal_error ("Internal error, arg_cleanup called with no user args.\n"); user_args = user_args->next; free (oargs); --- 1249,1256 ---- { struct user_args *oargs = user_args; if (!user_args) ! internal_error (__FILE__, __LINE__, ! "arg_cleanup called with no user args.\n"); user_args = user_args->next; free (oargs); Index: ui-file.c =================================================================== RCS file: /cvs/src/src/gdb/ui-file.c,v retrieving revision 1.4 diff -p -r1.4 ui-file.c *** ui-file.c 2000/07/30 01:48:27 1.4 --- ui-file.c 2000/12/01 11:20:10 *************** void * *** 149,155 **** ui_file_data (struct ui_file *file) { if (file->magic != &ui_file_magic) ! internal_error ("ui_file_data: bad magic number"); return file->to_data; } --- 149,156 ---- ui_file_data (struct ui_file *file) { if (file->magic != &ui_file_magic) ! internal_error (__FILE__, __LINE__, ! "ui_file_data: bad magic number"); return file->to_data; } *************** mem_file_delete (struct ui_file *file) *** 314,320 **** { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) ! internal_error ("mem_file_delete: bad magic number"); if (stream->buffer != NULL) free (stream->buffer); free (stream); --- 315,322 ---- { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) ! internal_error (__FILE__, __LINE__, ! "mem_file_delete: bad magic number"); if (stream->buffer != NULL) free (stream->buffer); free (stream); *************** mem_file_rewind (struct ui_file *file) *** 331,337 **** { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) ! internal_error ("mem_file_rewind: bad magic number"); stream->length_buffer = 0; } --- 333,340 ---- { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) ! internal_error (__FILE__, __LINE__, ! "mem_file_rewind: bad magic number"); stream->length_buffer = 0; } *************** mem_file_put (struct ui_file *file, *** 342,348 **** { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) ! internal_error ("mem_file_put: bad magic number"); if (stream->length_buffer > 0) write (dest, stream->buffer, stream->length_buffer); } --- 345,352 ---- { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) ! internal_error (__FILE__, __LINE__, ! "mem_file_put: bad magic number"); if (stream->length_buffer > 0) write (dest, stream->buffer, stream->length_buffer); } *************** mem_file_write (struct ui_file *file, *** 354,360 **** { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) ! internal_error ("mem_file_write: bad magic number"); if (stream->buffer == NULL) { stream->length_buffer = length_buffer; --- 358,365 ---- { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) ! internal_error (__FILE__, __LINE__, ! "mem_file_write: bad magic number"); if (stream->buffer == NULL) { stream->length_buffer = length_buffer; *************** stdio_file_delete (struct ui_file *file) *** 415,421 **** { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error ("stdio_file_delete: bad magic number"); if (stdio->close_p) { fclose (stdio->file); --- 420,427 ---- { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error (__FILE__, __LINE__, ! "stdio_file_delete: bad magic number"); if (stdio->close_p) { fclose (stdio->file); *************** stdio_file_flush (struct ui_file *file) *** 428,434 **** { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error ("stdio_file_flush: bad magic number"); fflush (stdio->file); } --- 434,441 ---- { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error (__FILE__, __LINE__, ! "stdio_file_flush: bad magic number"); fflush (stdio->file); } *************** stdio_file_write (struct ui_file *file, *** 437,443 **** { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error ("stdio_file_write: bad magic number"); fwrite (buf, length_buf, 1, stdio->file); } --- 444,451 ---- { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error (__FILE__, __LINE__, ! "stdio_file_write: bad magic number"); fwrite (buf, length_buf, 1, stdio->file); } *************** stdio_file_fputs (const char *linebuffer *** 446,452 **** { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error ("stdio_file_fputs: bad magic number"); fputs (linebuffer, stdio->file); } --- 454,461 ---- { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error (__FILE__, __LINE__, ! "stdio_file_fputs: bad magic number"); fputs (linebuffer, stdio->file); } *************** stdio_file_isatty (struct ui_file *file) *** 455,461 **** { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error ("stdio_file_isatty: bad magic number"); return (isatty (fileno (stdio->file))); } --- 464,471 ---- { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) ! internal_error (__FILE__, __LINE__, ! "stdio_file_isatty: bad magic number"); return (isatty (fileno (stdio->file))); } Index: ui-out.c =================================================================== RCS file: /cvs/src/src/gdb/ui-out.c,v retrieving revision 1.5 diff -p -r1.5 ui-out.c *** ui-out.c 2000/10/31 05:49:55 1.5 --- ui-out.c 2000/12/01 11:20:10 *************** void *** 190,196 **** ui_out_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) { if (uiout->table_flag) ! internal_error ("gdb/ui_out.c: tables cannot be nested; table_begin found before \ previous table_end."); uiout->table_flag = 1; --- 190,197 ---- ui_out_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) { if (uiout->table_flag) ! internal_error (__FILE__, __LINE__, ! "tables cannot be nested; table_begin found before \ previous table_end."); uiout->table_flag = 1; *************** void *** 208,220 **** ui_out_table_body (struct ui_out *uiout) { if (!uiout->table_flag) ! internal_error ("gdb/ui_out.c: table_body outside a table is not valid; it must be \ after a table_begin and before a table_end."); if (uiout->body_flag) ! internal_error ("gdb/ui_out.c: extra table_body call not allowed; there must be \ only one table_body after a table_begin and before a table_end."); if (uiout->headercurr->colno != uiout->table_columns) ! internal_error ("gdb/ui_out.c: number of headers differ from number of table \ columns."); uiout->body_flag = 1; --- 209,224 ---- ui_out_table_body (struct ui_out *uiout) { if (!uiout->table_flag) ! internal_error (__FILE__, __LINE__, ! "table_body outside a table is not valid; it must be \ after a table_begin and before a table_end."); if (uiout->body_flag) ! internal_error (__FILE__, __LINE__, ! "extra table_body call not allowed; there must be \ only one table_body after a table_begin and before a table_end."); if (uiout->headercurr->colno != uiout->table_columns) ! internal_error (__FILE__, __LINE__, ! "number of headers differ from number of table \ columns."); uiout->body_flag = 1; *************** void *** 227,233 **** ui_out_table_end (struct ui_out *uiout) { if (!uiout->table_flag) ! internal_error ("gdb/ui_out.c: misplaced table_end or missing table_begin."); uiout->body_flag = 0; uiout->table_flag = 0; --- 231,238 ---- ui_out_table_end (struct ui_out *uiout) { if (!uiout->table_flag) ! internal_error (__FILE__, __LINE__, ! "misplaced table_end or missing table_begin."); uiout->body_flag = 0; uiout->table_flag = 0; *************** ui_out_table_header (struct ui_out *uiou *** 244,250 **** char *colhdr) { if (!uiout->table_flag || uiout->body_flag) ! internal_error ("ui_out: table header must be specified after table_begin \ and before table_body."); append_header_to_list (uiout, width, alignment, colhdr); --- 249,256 ---- char *colhdr) { if (!uiout->table_flag || uiout->body_flag) ! internal_error (__FILE__, __LINE__, ! "table header must be specified after table_begin \ and before table_body."); append_header_to_list (uiout, width, alignment, colhdr); *************** void *** 256,265 **** ui_out_list_begin (struct ui_out *uiout, char *lstid) { if (uiout->table_flag && !uiout->body_flag) ! internal_error ("ui_out: table header or table_body expected; lists must be \ specified after table_body."); if (uiout->list_flag >= 4) ! internal_error ("ui_out: list depth exceeded; only 4 levels of lists can be \ nested."); uiout->list_flag++; --- 262,273 ---- ui_out_list_begin (struct ui_out *uiout, char *lstid) { if (uiout->table_flag && !uiout->body_flag) ! internal_error (__FILE__, __LINE__, ! "table header or table_body expected; lists must be \ specified after table_body."); if (uiout->list_flag >= 4) ! internal_error (__FILE__, __LINE__, ! "list depth exceeded; only 4 levels of lists can be \ nested."); uiout->list_flag++; *************** void *** 274,280 **** ui_out_list_end (struct ui_out *uiout) { if (!uiout->list_flag) ! internal_error ("ui_out: misplaced list_end; there is no list to be closed."); uo_list_end (uiout, uiout->list_flag); --- 282,289 ---- ui_out_list_end (struct ui_out *uiout) { if (!uiout->list_flag) ! internal_error (__FILE__, __LINE__, ! "misplaced list_end; there is no list to be closed."); uo_list_end (uiout, uiout->list_flag); *************** verify_field_proper_position (struct ui_ *** 838,847 **** if (uiout->table_flag) { if (!uiout->body_flag) ! internal_error ("ui_out: table_body missing; table fields must be \ specified after table_body and inside a list."); if (!uiout->list_flag) ! internal_error ("ui_out: list_begin missing; table fields must be \ specified after table_body and inside a list."); } } --- 847,858 ---- if (uiout->table_flag) { if (!uiout->body_flag) ! internal_error (__FILE__, __LINE__, ! "table_body missing; table fields must be \ specified after table_body and inside a list."); if (!uiout->list_flag) ! internal_error (__FILE__, __LINE__, ! "list_begin missing; table fields must be \ specified after table_body and inside a list."); } } *************** verify_field_alignment (struct ui_out *u *** 861,867 **** && get_curr_header (uiout, &colno, width, align, &text)) { if (fldno != colno) ! internal_error ("gdb/ui-out.c: ui-out internal error in handling headers."); } else { --- 872,879 ---- && get_curr_header (uiout, &colno, width, align, &text)) { if (fldno != colno) ! internal_error (__FILE__, __LINE__, ! "ui-out internal error in handling headers."); } else { Index: utils.c =================================================================== RCS file: /cvs/src/src/gdb/utils.c,v retrieving revision 1.23 diff -p -r1.23 utils.c *** utils.c 2000/11/20 02:06:19 1.23 --- utils.c 2000/12/01 11:20:22 *************** free_current_contents (void *ptr) *** 386,392 **** { void **location = ptr; if (location == NULL) ! internal_error ("free_current_contents: NULL pointer"); if (*location != NULL) { free (*location); --- 386,393 ---- { void **location = ptr; if (location == NULL) ! internal_error (__FILE__, __LINE__, ! "free_current_contents: NULL pointer"); if (*location != NULL) { free (*location); *************** error_init (void) *** 667,673 **** want to continue, dump core, or just exit. */ NORETURN void ! internal_verror (const char *fmt, va_list ap) { static char msg[] = "Internal GDB error: recursive internal error.\n"; static int dejavu = 0; --- 668,675 ---- want to continue, dump core, or just exit. */ NORETURN void ! internal_verror (const char *file, int line, ! const char *fmt, va_list ap) { static char msg[] = "Internal GDB error: recursive internal error.\n"; static int dejavu = 0; *************** internal_verror (const char *fmt, va_lis *** 692,698 **** /* Try to get the message out */ target_terminal_ours (); ! fputs_unfiltered ("gdb-internal-error: ", gdb_stderr); vfprintf_unfiltered (gdb_stderr, fmt, ap); fputs_unfiltered ("\n", gdb_stderr); --- 694,700 ---- /* Try to get the message out */ target_terminal_ours (); ! fprintf_unfiltered (gdb_stderr, "%s:%d: gdb-internal-error: ", file, line); vfprintf_unfiltered (gdb_stderr, fmt, ap); fputs_unfiltered ("\n", gdb_stderr); *************** Create a core file containing the curren *** 728,739 **** } NORETURN void ! internal_error (char *string, ...) { va_list ap; va_start (ap, string); ! internal_verror (string, ap); va_end (ap); } --- 730,741 ---- } NORETURN void ! internal_error (const char *file, int line, const char *string, ...) { va_list ap; va_start (ap, string); ! internal_verror (file, line, string, ap); va_end (ap); } *************** nomem (long size) *** 999,1009 **** { if (size > 0) { ! internal_error ("virtual memory exhausted: can't allocate %ld bytes.", size); } else { ! internal_error ("virtual memory exhausted."); } } --- 1001,1013 ---- { if (size > 0) { ! internal_error (__FILE__, __LINE__, ! "virtual memory exhausted: can't allocate %ld bytes.", size); } else { ! internal_error (__FILE__, __LINE__, ! "virtual memory exhausted."); } } *************** xvasprintf (char **ret, const char *form *** 1098,1110 **** /* NULL could be returned due to a memory allocation problem; a badly format string; or something else. */ if ((*ret) == NULL) ! internal_error ("%s:%d: vasprintf returned NULL buffer (errno %d)", ! __FILE__, __LINE__, errno); /* A negative status with a non-NULL buffer shouldn't never happen. But to be sure. */ if (status < 0) ! internal_error ("%s:%d: vasprintf call failed (errno %d)", ! __FILE__, __LINE__, errno); } --- 1102,1116 ---- /* NULL could be returned due to a memory allocation problem; a badly format string; or something else. */ if ((*ret) == NULL) ! internal_error (__FILE__, __LINE__, ! "vasprintf returned NULL buffer (errno %d)", ! errno); /* A negative status with a non-NULL buffer shouldn't never happen. But to be sure. */ if (status < 0) ! internal_error (__FILE__, __LINE__, ! "vasprintf call failed (errno %d)", ! errno); } *************** CORE_ADDR *** 2869,2875 **** host_pointer_to_address (void *ptr) { if (sizeof (ptr) != TYPE_LENGTH (builtin_type_ptr)) ! internal_error ("core_addr_to_void_ptr: bad cast"); return POINTER_TO_ADDRESS (builtin_type_ptr, &ptr); } --- 2875,2882 ---- host_pointer_to_address (void *ptr) { if (sizeof (ptr) != TYPE_LENGTH (builtin_type_ptr)) ! internal_error (__FILE__, __LINE__, ! "core_addr_to_void_ptr: bad cast"); return POINTER_TO_ADDRESS (builtin_type_ptr, &ptr); } *************** address_to_host_pointer (CORE_ADDR addr) *** 2878,2884 **** { void *ptr; if (sizeof (ptr) != TYPE_LENGTH (builtin_type_ptr)) ! internal_error ("core_addr_to_void_ptr: bad cast"); ADDRESS_TO_POINTER (builtin_type_ptr, &ptr, addr); return ptr; } --- 2885,2892 ---- { void *ptr; if (sizeof (ptr) != TYPE_LENGTH (builtin_type_ptr)) ! internal_error (__FILE__, __LINE__, ! "core_addr_to_void_ptr: bad cast"); ADDRESS_TO_POINTER (builtin_type_ptr, &ptr, addr); return ptr; } Index: v850-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/v850-tdep.c,v retrieving revision 1.6 diff -p -r1.6 v850-tdep.c *** v850-tdep.c 2000/11/06 04:53:14 1.6 --- v850-tdep.c 2000/12/01 11:20:24 *************** v850_target_architecture_hook (const bfd *** 848,854 **** } } ! internal_error ("Architecture `%s' unrecognized", ap->printable_name); } void --- 848,855 ---- } } ! internal_error (__FILE__, __LINE__, ! "Architecture `%s' unrecognized", ap->printable_name); } void Index: mi/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/mi/ChangeLog,v retrieving revision 1.5 diff -p -r1.5 ChangeLog *** ChangeLog 2000/11/20 02:06:19 1.5 --- ChangeLog 2000/12/01 11:20:29 *************** *** 1,3 **** --- 1,16 ---- + Fri Dec 1 22:02:45 2000 Andrew Cagney + + * mi-getopt.c (mi_getopt): + + * mi-cmd-break.c (mi_cmd_break_insert): + + * mi-console.c (mi_console_file_delete): + (mi_console_file_fputs): + (mi_console_raw_packet): + (mi_console_file_flush): + + * mi-cmds.c (build_table): + Fri Nov 17 16:07:23 2000 Andrew Cagney * mi-main.c: Replace asprintf with xasprintf. Index: mi/mi-cmd-break.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmd-break.c,v retrieving revision 1.3 diff -p -r1.3 mi-cmd-break.c *** mi-cmd-break.c 2000/05/16 05:07:53 1.3 --- mi-cmd-break.c 2000/12/01 11:20:29 *************** mi_cmd_break_insert (char *command, char *** 161,167 **** break; #endif default: ! internal_error ("mi_cmd_break_insert: Bad switch."); } set_gdb_event_hooks (old_hooks); --- 161,168 ---- break; #endif default: ! internal_error (__FILE__, __LINE__, ! "mi_cmd_break_insert: Bad switch."); } set_gdb_event_hooks (old_hooks); Index: mi/mi-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmds.c,v retrieving revision 1.5 diff -p -r1.5 mi-cmds.c *** mi-cmds.c 2000/07/30 01:48:28 1.5 --- mi-cmds.c 2000/12/01 11:20:29 *************** build_table (struct mi_cmd *commands) *** 234,240 **** { struct mi_cmd **entry = lookup_table (command->name); if (*entry) ! internal_error ("command `%s' appears to be duplicated", command->name); *entry = command; if (0) --- 234,241 ---- { struct mi_cmd **entry = lookup_table (command->name); if (*entry) ! internal_error (__FILE__, __LINE__, ! "command `%s' appears to be duplicated", command->name); *entry = command; if (0) Index: mi/mi-console.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-console.c,v retrieving revision 1.3 diff -p -r1.3 mi-console.c *** mi-console.c 2000/05/16 05:07:53 1.3 --- mi-console.c 2000/12/01 11:20:29 *************** mi_console_file_delete (struct ui_file * *** 65,71 **** { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) ! internal_error ("mi_console_file_delete: bad magic number"); free (mi_console); } --- 65,72 ---- { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) ! internal_error (__FILE__, __LINE__, ! "mi_console_file_delete: bad magic number"); free (mi_console); } *************** mi_console_file_fputs (const char *buf, *** 75,81 **** { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) ! internal_error ("mi_console_file_fputs: bad magic number"); /* Append the text to our internal buffer */ fputs_unfiltered (buf, mi_console->buffer); /* Flush when an embedded \n */ --- 76,83 ---- { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) ! internal_error (__FILE__, __LINE__, ! "mi_console_file_fputs: bad magic number"); /* Append the text to our internal buffer */ fputs_unfiltered (buf, mi_console->buffer); /* Flush when an embedded \n */ *************** mi_console_raw_packet (void *data, *** 91,97 **** { struct mi_console_file *mi_console = data; if (mi_console->magic != &mi_console_file_magic) ! internal_error ("mi_console_file_transform: bad magic number"); if (length_buf > 0) { --- 93,100 ---- { struct mi_console_file *mi_console = data; if (mi_console->magic != &mi_console_file_magic) ! internal_error (__FILE__, __LINE__, ! "mi_console_file_transform: bad magic number"); if (length_buf > 0) { *************** mi_console_file_flush (struct ui_file *f *** 108,114 **** { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) ! internal_error ("mi_console_file_flush: bad magic number"); ui_file_put (mi_console->buffer, mi_console_raw_packet, mi_console); ui_file_rewind (mi_console->buffer); } --- 111,118 ---- { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) ! internal_error (__FILE__, __LINE__, ! "mi_console_file_flush: bad magic number"); ui_file_put (mi_console->buffer, mi_console_raw_packet, mi_console); ui_file_rewind (mi_console->buffer); } Index: mi/mi-getopt.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-getopt.c,v retrieving revision 1.3 diff -p -r1.3 mi-getopt.c *** mi-getopt.c 2000/05/16 05:07:53 1.3 --- mi-getopt.c 2000/12/01 11:20:31 *************** mi_getopt (const char *prefix, *** 33,39 **** struct mi_opt *opt; /* We assume that argv/argc are ok. */ if (*optind > argc || *optind < 0) ! internal_error ("mi_getopt_long: optind out of bounds"); if (*optind == argc) return -1; arg = argv[*optind]; --- 33,40 ---- struct mi_opt *opt; /* We assume that argv/argc are ok. */ if (*optind > argc || *optind < 0) ! internal_error (__FILE__, __LINE__, ! "mi_getopt_long: optind out of bounds"); if (*optind == argc) return -1; arg = argv[*optind]; Index: tui/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/tui/ChangeLog,v retrieving revision 1.8 diff -p -r1.8 ChangeLog *** ChangeLog 2000/06/22 07:16:19 1.8 --- ChangeLog 2000/12/01 11:20:33 *************** *** 1,3 **** --- 1,13 ---- + Fri Dec 1 21:49:51 2000 Andrew Cagney + + * tui-file.c (tui_file_delete): + (tui_file_isatty): + (tui_file_rewind): + (tui_file_put): + (tui_file_get_strbuf): + (tui_file_adjust_strbuf): + (tui_file_flush): + 2000-06-22 Kevin Buettner * tuiSourceWin.h: Eliminate use of PARAMS from this file. Index: tui/tui-file.c =================================================================== RCS file: /cvs/src/src/gdb/tui/tui-file.c,v retrieving revision 1.4 diff -p -r1.4 tui-file.c *** tui-file.c 2000/07/30 01:48:28 1.4 --- tui-file.c 2000/12/01 11:20:33 *************** tui_file_delete (struct ui_file *file) *** 85,91 **** { struct tui_stream *tmpstream = ui_file_data (file); if (tmpstream->ts_magic != &tui_file_magic) ! internal_error ("tui_file_delete: bad magic number"); if ((tmpstream->ts_streamtype == astring) && (tmpstream->ts_strbuf != NULL)) { --- 85,92 ---- { struct tui_stream *tmpstream = ui_file_data (file); if (tmpstream->ts_magic != &tui_file_magic) ! internal_error (__FILE__, __LINE__, ! "tui_file_delete: bad magic number"); if ((tmpstream->ts_streamtype == astring) && (tmpstream->ts_strbuf != NULL)) { *************** tui_file_isatty (struct ui_file *file) *** 131,137 **** { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error ("tui_file_isatty: bad magic number"); if (stream->ts_streamtype == afile) return (isatty (fileno (stream->ts_filestream))); else --- 132,139 ---- { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error (__FILE__, __LINE__, ! "tui_file_isatty: bad magic number"); if (stream->ts_streamtype == afile) return (isatty (fileno (stream->ts_filestream))); else *************** tui_file_rewind (struct ui_file *file) *** 143,149 **** { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error ("tui_file_rewind: bad magic number"); stream->ts_strbuf[0] = '\0'; } --- 145,152 ---- { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error (__FILE__, __LINE__, ! "tui_file_rewind: bad magic number"); stream->ts_strbuf[0] = '\0'; } *************** tui_file_put (struct ui_file *file, *** 154,160 **** { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error ("tui_file_put: bad magic number"); if (stream->ts_streamtype == astring) write (dest, stream->ts_strbuf, strlen (stream->ts_strbuf)); } --- 157,164 ---- { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error (__FILE__, __LINE__, ! "tui_file_put: bad magic number"); if (stream->ts_streamtype == astring) write (dest, stream->ts_strbuf, strlen (stream->ts_strbuf)); } *************** tui_file_get_strbuf (struct ui_file *fil *** 240,246 **** { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error ("tui_file_get_strbuf: bad magic number"); return (stream->ts_strbuf); } --- 244,251 ---- { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error (__FILE__, __LINE__, ! "tui_file_get_strbuf: bad magic number"); return (stream->ts_strbuf); } *************** tui_file_adjust_strbuf (int n, struct ui *** 252,258 **** struct tui_stream *stream = ui_file_data (file); int non_null_chars; if (stream->ts_magic != &tui_file_magic) ! internal_error ("tui_file_adjust_strbuf: bad magic number"); if (stream->ts_streamtype != astring) return; --- 257,264 ---- struct tui_stream *stream = ui_file_data (file); int non_null_chars; if (stream->ts_magic != &tui_file_magic) ! internal_error (__FILE__, __LINE__, ! "tui_file_adjust_strbuf: bad magic number"); if (stream->ts_streamtype != astring) return; *************** tui_file_flush (struct ui_file *file) *** 278,284 **** { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error ("tui_file_flush: bad magic number"); /* NOTE: cagney/1999-10-12: If we've been linked with code that uses fputs_unfiltered_hook then we assume that it doesn't need to know --- 284,291 ---- { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) ! internal_error (__FILE__, __LINE__, ! "tui_file_flush: bad magic number"); /* NOTE: cagney/1999-10-12: If we've been linked with code that uses fputs_unfiltered_hook then we assume that it doesn't need to know From muller@cerbere.u-strasbg.fr Fri Dec 01 03:42:00 2000 From: Pierre Muller To: gdb-patches@sourceware.cygnus.com Subject: [PATCH RFC] Problem with pascal objects. Date: Fri, 01 Dec 2000 03:42:00 -0000 Message-id: <4.2.0.58.20001201114225.019f6340@ics.u-strasbg.fr> X-SW-Source: 2000-12/msg00003.html Content-length: 3176 I have still some very pascal specific problems with GDB. I will try to explain this problem as simply as possible. Some Pascal Compiler have both classes and Objects (classes are similar to C++ classes in the sense that they are just invisible pointers to a record). On the contrary pascal objects are the record itself. Pascal objects are then defined as type PBaseObject = ^TBaseObject; TBaseObject = object x,y : longint; end; PDerivedObject = ^TDerivedObject; TDerivedObject = object(TBaseObject) z : longint; end; PIndependentObject = ^TIndependentObject; TIndependentObject = object x,y,z : longint; end; PBaseRecord = ^TBaseRecord; TBaseRecord = Record x,y : longint; end; PDerivedRecord = ^TDerivedRecord; TDerivedRecord = Record x,y,z : longint; end; var BO : PBaseObject; BD : PDerivedObject; RO : PBaseRecord; RD : PDerivedRecord; begin BD:=new(PDerivedObject); BD^.x:=1;BD^.y:=2;BD^.z:=3; BO:=BD; RD:=new(PDerivedRecord); RD^.x:=4;RD^.y:=5;RD^.z:=6; RO:=pbaserecord(RD); end. Break at last line, I can get the following results Breakpoint 1, main () at testobj.pp:40 40 end. (gdbpas) p pederivedobject(bo)^ No symbol "PEDERIVEDOBJECT" in current context. (gdbpas) p pderivedobject(bo) $1 = (PDERIVEDOBJECT) $14e9c (gdbpas) p pderivedobject(bo)^ $2 = { = {X = 1, Y = 2}, Z = 65538} (gdbpas) p pindependentobject(bo)^ $3 = {X = 1, Y = 2, Z = 3} (gdbpas) Clearly the problem only happens because the tderivedobject is a child of tbaseobject. For normal records, I never get such problems. I found out by debugging GDB that the problem is that the value_ptr for the expression "pderivedobject(bo)^" contains "Tderivedobject" as type field and "TBaseObject" as enclosing_type field. As the size of the enclosing_type is used to retrieve the data from debuggee memory, the z field is not read at all. The fact that pindependentobject typecast works correctly seems to indicate that this problem is object/class specific. I found a simple solution to the problem, but I don't know if this is an acceptable patch. 2000-12-01 Pierre Muller * valops.c (value_fetch_lazy): use biggest size from type and enclosing_type. --- origdb/valops.c Sun Apr 9 15:02:10 2000 +++ gdb/valops.c Fri Dec 1 10:30:30 2000 @@ -515,8 +515,13 @@ { CORE_ADDR addr = VALUE_ADDRESS (val) + VALUE_OFFSET (val); int length = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val)); - struct type *type = VALUE_TYPE (val); + /* In some case the enclosing type end up smaller as the + type at least for pascal */ + int blength = TYPE_LENGTH (type); + if (blength > length) + length = blength; + if (GDB_TARGET_IS_D10V && TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_TARGET_TYPE (type) Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 From eliz@is.elta.co.il Fri Dec 01 04:29:00 2000 From: "Eli Zaretskii" To: ac131313@cygnus.com Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [rfc] add __FILE__ and __LINE__ to internal_error() Date: Fri, 01 Dec 2000 04:29:00 -0000 Message-id: <9003-Fri01Dec2000142804+0200-eliz@is.elta.co.il> References: <3A2789DD.ABA82A16@cygnus.com> X-SW-Source: 2000-12/msg00004.html Content-length: 1018 > Date: Fri, 01 Dec 2000 22:22:05 +1100 > From: Andrew Cagney > > * gdb_assert.h (gdb_assert_fail), command.c (do_setshow_command), > v850-tdep.c (v850_target_architecture_hook), i386-tdep.c > (i386_extract_return_value), language.c > (longest_local_hex_string_custom), solib-svr4.c This is not how ChangeLog should be formatted. The correct format is like this: * gdb_assert.h (gdb_assert_fail): command.c (do_setshow_command): v850-tdep.c (v850_target_architecture_hook): i386-tdep.c (i386_extract_return_value): language.c (longest_local_hex_string_custom): .... breakpoint.c (print_bp_stop_message, print_one_breakpoint) (check_duplicates, delete_breakpoint): Update. (Note how a long list of functions from the same file is split between two or more lines in the last example for breakpoint.c.) And that "Update." should probably be "Update calls to internal_error." The format of the ChangeLog entries is described in standards.texi, node "Style of Change Logs". From muller@cerbere.u-strasbg.fr Fri Dec 01 05:07:00 2000 From: Pierre Muller To: gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH RFC] Problem with pascal objects. Date: Fri, 01 Dec 2000 05:07:00 -0000 Message-id: <4.2.0.58.20001201140603.019fc140@ics.u-strasbg.fr> X-SW-Source: 2000-12/msg00005.html Content-length: 1032 >--- origdb/valops.c Sun Apr 9 15:02:10 2000 >+++ gdb/valops.c Fri Dec 1 10:30:30 2000 >@@ -515,8 +515,13 @@ > { > CORE_ADDR addr = VALUE_ADDRESS (val) + VALUE_OFFSET (val); > int length = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val)); >- > struct type *type = VALUE_TYPE (val); >+ /* In some case the enclosing type end up smaller as the >+ type at least for pascal */ >+ int blength = TYPE_LENGTH (type); >+ if (blength > length) >+ length = blength; >+ > if (GDB_TARGET_IS_D10V > && TYPE_CODE (type) == TYPE_CODE_PTR > && TYPE_TARGET_TYPE (type) The patch is wrong because the allocated size is only length and thus if blength is greater than length we write past the allocated memory which is of course bad. This means that I should reallocate a bigger memory part aready in value_ind function. Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 From muller@cerbere.u-strasbg.fr Fri Dec 01 05:52:00 2000 From: Pierre Muller To: gdb-patches@sourceware.cygnus.com Subject: Re: [PATCH RFC] Problem with pascal objects. Date: Fri, 01 Dec 2000 05:52:00 -0000 Message-id: <4.2.0.58.20001201144330.01a02350@ics.u-strasbg.fr> References: <4.2.0.58.20001201140603.019fc140@ics.u-strasbg.fr> X-SW-Source: 2000-12/msg00006.html Content-length: 2947 At 14:06 01/12/00 , Pierre Muller a écrit: >>--- origdb/valops.c Sun Apr 9 15:02:10 2000 >>+++ gdb/valops.c Fri Dec 1 10:30:30 2000 >>@@ -515,8 +515,13 @@ >> { >> CORE_ADDR addr = VALUE_ADDRESS (val) + VALUE_OFFSET (val); >> int length = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val)); >>- >> struct type *type = VALUE_TYPE (val); >>+ /* In some case the enclosing type end up smaller as the >>+ type at least for pascal */ >>+ int blength = TYPE_LENGTH (type); >>+ if (blength > length) >>+ length = blength; >>+ >> if (GDB_TARGET_IS_D10V >> && TYPE_CODE (type) == TYPE_CODE_PTR >> && TYPE_TARGET_TYPE (type) > > The patch is wrong because the allocated size is only length >and thus if blength is greater than length we write past the allocated memory >which is of course bad. > > This means that I should reallocate a bigger memory part aready in > value_ind >function. Trying deeper to find out where the bug really is, I found out that this wrong size allocation is due to the following code in value_cast However I don't really understand this code that probably has to do with some C++ class magic I am not aware of. /* Look in the type of the target to see if it contains the type of the source as a superclass. If so, we'll need to offset the pointer rather than just change its type. FIXME: This fails silently with virtual inheritance. */ if (TYPE_NAME (t2) != NULL) { v = search_struct_field (type_name_no_tag (t2), value_zero (t1, not_lval), 0, t1, 1); if (v) { value_ptr v2 = value_ind (arg2); VALUE_ADDRESS (v2) -= VALUE_ADDRESS (v) + VALUE_OFFSET (v); /* JYG: adjust the new pointer value and embedded offset. */ v2->aligner.contents[0] -= VALUE_EMBEDDED_OFFSET (v); VALUE_EMBEDDED_OFFSET (v2) = 0; v2 = value_addr (v2); VALUE_TYPE (v2) = type; + if (current_language->la_language == language_pascal) + VALUE_ENCLOSING_TYPE (arg2) = type; /* pai: chk_val */ return v2; } } } The two line marked with + seem to fix my problem correctly (in the sense that the memory allocation is correct then) but maybe it would be even better to move the pascal check at a higher level. Free Pascal can only have only single base object/class until now, (I don't know the state for GPC). Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99 From ac131313@cygnus.com Fri Dec 01 06:07:00 2000 From: Andrew Cagney To: Eli Zaretskii Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [rfc] add __FILE__ and __LINE__ to internal_error() Date: Fri, 01 Dec 2000 06:07:00 -0000 Message-id: <3A27AEAB.F6392391@cygnus.com> References: <3A2789DD.ABA82A16@cygnus.com> <9003-Fri01Dec2000142804+0200-eliz@is.elta.co.il> X-SW-Source: 2000-12/msg00007.html Content-length: 810 Eli Zaretskii wrote: > > > Date: Fri, 01 Dec 2000 22:22:05 +1100 > > From: Andrew Cagney > > > > * gdb_assert.h (gdb_assert_fail), command.c (do_setshow_command), > > v850-tdep.c (v850_target_architecture_hook), i386-tdep.c > > (i386_extract_return_value), language.c > > (longest_local_hex_string_custom), solib-svr4.c > > This is not how ChangeLog should be formatted. Que? ;-) > The correct format is like this: > .... Hmm, the line: http://www.gnu.org/prep/standards_40.html#SEC40 ``Break long lists of function names by closing continued lines with `)', rather than `,', and opening the continuation with `(' as in this example: '' is new (well by my standards :-). Oldies may want to review that part of the manual. thanks for the heads up, Andrew From eliz@is.elta.co.il Fri Dec 01 08:12:00 2000 From: "Eli Zaretskii" To: ac131313@cygnus.com Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [rfc] add __FILE__ and __LINE__ to internal_error() Date: Fri, 01 Dec 2000 08:12:00 -0000 Message-id: <2561-Fri01Dec2000181133+0200-eliz@is.elta.co.il> References: <3A2789DD.ABA82A16@cygnus.com> <9003-Fri01Dec2000142804+0200-eliz@is.elta.co.il> <3A27AEAB.F6392391@cygnus.com> X-SW-Source: 2000-12/msg00008.html Content-length: 764 > Date: Sat, 02 Dec 2000 00:59:07 +1100 > From: Andrew Cagney > > Hmm, the line: > > http://www.gnu.org/prep/standards_40.html#SEC40 > ``Break long lists of function names by closing continued lines with > `)', rather than `,', and opening the continuation with `(' as in this > example: '' > > is new (well by my standards :-). Oldies may want to review that part of > the manual. RMS was asking Emacs maintainers for years to use this format. I asked him to write this up in standards.texi when it was last updated, since many people are unaware of this. The rationale for this format is mostly that it makes ChangeLog fontification in Emacs much more consistent. The font-lock definitios in add-log mode rely on the correct format. From fnasser@cygnus.com Fri Dec 01 09:13:00 2000 From: Fernando Nasser To: gdb-patches@sources.redhat.com, muller@cerbere.u-strasbg.fr Subject: Build failure on Linux - strnicmp undefined Date: Fri, 01 Dec 2000 09:13:00 -0000 Message-id: <3A27DBEA.D403D88A@cygnus.com> X-SW-Source: 2000-12/msg00009.html Content-length: 4414 The following change prevents GDB to build on Linux machines (and perhaps others) where "strnicmp()" is not defined. Note that the ChangeLog entry has the wrong date. It was checked in this morning. I reverted it in my sandbox. If we can't get hold of Pierre because of time differences I will revert the patch in the repository as well. revision 1.2 date: 2000/12/01 10:40:10; author: muller; state: Exp; lines: +22 -16 2000-10-27 Pierre Muller * p-exp.y (yylex): avoid problem with symbol name starting as a operator name. Here is the build error: gcc -g -O2 -o gdb main.o libgdb.a ../bfd/libbfd.a ../readline/libreadline.a ../opcodes/libopcodes.a ../libiberty/libiberty.a -lncurses ../libgui/src/libgui.a -L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/itcl/itcl/unix -litcl3.0 -L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/itcl/itk/unix -litk3.0 -L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/tix/unix/tk8.0 -ltix4.1.8.0 -L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/tk/unix -ltk8.0 -L/home/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/tcl/unix -ltcl8.0 -L/usr/X11R6/lib -lX11 -ldl -lieee -lm -lm ../libiberty/libiberty.a -ldl -rdynamic libgdb.a(p-exp.tab.o): In function `pascal_lex': /home/fnasser/DEVO/insight-sourceware/src/gdb/p-exp.y:956: undefined reference to `strnicmp' /home/fnasser/DEVO/insight-sourceware/src/gdb/p-exp.y:968: undefined reference to `strnicmp' collect2: ld returned 1 exit status make: *** [gdb] Error 1 make: Leaving directory `/big/fnasser/BUILD/insight-sourceware/i686-pc-linux-gnu-x-native/gdb' -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 Index: p-exp.y =================================================================== RCS file: /cvs/src/src/gdb/p-exp.y,v retrieving revision 1.2 retrieving revision 1.1 diff -c -p -r1.2 -r1.1 *** p-exp.y 2000/12/01 10:40:10 1.2 --- p-exp.y 2000/06/14 12:27:59 1.1 *************** yylex () *** 942,978 **** char *uptokstart; char *tokptr; char *p; ! int explen, tempbufindex; static char *tempbuf; static int tempbufsize; retry: tokstart = lexptr; - explen = strlen (lexptr); /* See if it is a special token of length 3. */ ! if (explen > 2) ! for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++) ! if (strnicmp (tokstart, tokentab3[i].operator, 3) == 0 ! && (!isalpha (tokentab3[i].operator[0]) || explen == 3 ! || (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_'))) ! { ! lexptr += 3; ! yylval.opcode = tokentab3[i].opcode; ! return tokentab3[i].token; ! } /* See if it is a special token of length 2. */ ! if (explen > 1) ! for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++) ! if (strnicmp (tokstart, tokentab2[i].operator, 2) == 0 ! && (!isalpha (tokentab2[i].operator[0]) || explen == 2 ! || (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_'))) ! { ! lexptr += 2; ! yylval.opcode = tokentab2[i].opcode; ! return tokentab2[i].token; ! } switch (c = *tokstart) { --- 942,971 ---- char *uptokstart; char *tokptr; char *p; ! int tempbufindex; static char *tempbuf; static int tempbufsize; retry: tokstart = lexptr; /* See if it is a special token of length 3. */ ! for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++) ! if (STREQN (tokstart, tokentab3[i].operator, 3)) ! { ! lexptr += 3; ! yylval.opcode = tokentab3[i].opcode; ! return tokentab3[i].token; ! } /* See if it is a special token of length 2. */ ! for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++) ! if (STREQN (tokstart, tokentab2[i].operator, 2)) ! { ! lexptr += 2; ! yylval.opcode = tokentab2[i].opcode; ! return tokentab2[i].token; ! } switch (c = *tokstart) { *************** yyerror (msg) *** 1450,1452 **** --- 1443,1446 ---- { error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); } + From cgd@sibyte.com Fri Dec 01 09:21:00 2000 From: cgd@sibyte.com (Chris G. Demetriou) To: Fernando Nasser Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [prelim patch] Add the notion of a global init file to gdb. Date: Fri, 01 Dec 2000 09:21:00 -0000 Message-id: <5tlmu02h3c.fsf@highland.sibyte.com> References: <5tvgthgjlr.fsf@highland.sibyte.com> <3A1AE935.999A6344@cygnus.com> X-SW-Source: 2000-12/msg00010.html Content-length: 2433 [ i've been busy; sorry for the slight delay in reply. 8-] Fernando Nasser writes: >First of all, we must make sure gdb mentions that it found this file and it is >"sourcing" it. Imagine how difficult it can be to debug gdb problems without >knowing that some commands were executed at startup. 'help source' will tell you (at least some of) the files which gdb tries to source at startup. (it does _not_ currently mention $(HOME)/.gdbinit, as far as I can tell, nor does it do so on non-ansi C systems iirc. My patch updated it to mention the global init file, if any, and, obviously, I'll have to do the documentation if this patch is considered a good thing.) I disagree that GDB has to, or even should, mention that it found the file; it doesn't do that for $(HOME)/.gdbinit, or .gdbinit, why is this any different? (In fact, in this case, the whole _point_ is the possibility of transparent extension of gdb.) In my particular case, because I want to make _sure_ the right thing is happening, I have my loaded script print a note about it being loaded. But I don't see why this should be treated differently than $(HOME)/.gdbinit or even ./.gdbinit. > And will -nx inhibit global, $HOME and start directory gdbinits? > Or just the last two? As i implemented it, all. To be honest, I'm of two minds about it: One perspective is that if it's a "local transparent extension" of GDB, you'd never want to run GDB without that extension in the local context, so it shouldn't be disabled by -nx. On the other hand, having it not be sourced is more consistent with the current and i'd say expected behaviour of GDB: -nx means don't source the normally-used init files. I implemented it so that all would be disabled, following the latter pattern of thought, because it's easier to work around: If you say -nx and it disables automatic inclusion, you can always include it yourself (if you want/need it). On the other hand, if -nx _doesn't_ disable automatic inclusion, then it may be insane to attempt to override the script (for users who don't necessary have permission to remove it). Anyway, those are my opinions and rationale; i'd love to hear the opinions of other members of the community. If there's some kind of consensus, I'll be glad to implement it (since I'd like to see the feature in, so I don't have to maintain it locally), but I'd like to hear some more voices. 8-) chris From fnasser@cygnus.com Fri Dec 01 10:10:00 2000 From: Fernando Nasser To: gdb-patches@sources.redhat.com Subject: [patch]: The new cli files are in - use "cvs update -d" Date: Fri, 01 Dec 2000 10:10:00 -0000 Message-id: <3A27E949.5D5CF7F6@cygnus.com> X-SW-Source: 2000-12/msg00011.html Content-length: 12320 It is in. I did not add the 10K lines of "-" and "+" caused by the code moving in this message. I added the interesting bits, I believe. Don't forget to use "-d" to get the new files. Fernando 2000-12-01 Fernando Nasser * cli/cli-decode.c: New file. Handle lists of commands, their decoding and documentation. (add_cmd, deprecate_cmd, add_abbrev_cmd, add_alias_cmd, add_prefix_cmd, add_abbrev_prefix_cmd, not_just_help_class_command, empty_sfunc, add_set_cmd, add_set_enum_cmd, add_set_auto_boolean_cmd, add_show_from_set, delete_cmd, apropos_cmd, help_cmd, help_list, help_all, print_doc_line, help_cmd_list, find_cmd, lookup_cmd_1, undef_cmd_error, lookup_cmd, deprecated_cmd_warning, lookup_cmd_composition, complete_on_cmdlist, complete_on_enum): Moved here from command.c. (add_info, add_info_alias, add_com, add_com_alias): Moved here from top.c. * cli/cli-decode.h: Definitions/declarations for the above. * cli/cli-cmds.c: New file. GDB CLI commands. (error_no_arg, info_command, show_command, help_command, show_version, quit_command, pwd_command, cd_command, echo_command, shell_escape, make_command, show_user, set_debug, show_debug, init_cmd_lists): Moved here from top.c. (apropos_command): Moved here from command.c. (complete_command, source_command): Moved here (part) from top.c. (is_complete_command): New function. Checks if a command is the "complete" command. (init_cli_cmds): New function. Add commands to the CLI (from code previously in top.c. * cli/cli-cmds.h: Definitions/declarations for the above. * cli/cli-script.c: New file. GDB CLI command scripting. (build_command_line, get_command_line, print_command_lines, print_command_line, execute_user_command, execute_control_command, while_command, if_command, arg_cleanup, setup_user_args, locate_arg, insert_args, realloc_body_list, read_next_line, recurse_read_control_structure, read_command_lines, free_command_lines, do_free_command_lines_cleanup, make_cleanup_free_command_lines, validate_comname, user_defined_command, define_command, document_command, source_cleanup_lines, do_fclose_cleanup, show_user_1): Moved here from top.c. (script_from_file): New function. Implements execution of a script contained in a file (part of code for the source_command() that used to exist in top.c). * cli/cli-script.h: Definitions/declarations for the above. * cli/cli-setshow.c: New file. Handle set and show GDB CLI commands. (parse_auto_binary_operation, parse_binary_operation, do_setshow_command, cmd_show_list): Moved here from command.c. * cli/cli-setshow.h: Definitions/declarations for the above. * top.c: Remove all CLI code, except the command loop. (gdb_init): Call init_cli_cmds(). * command.c: Remove obsolete file. * command.h: Mark as DEPRECATED. * gdbcmd.h: Ditto. * call-cmds.h: Ditto. * Makefile.in (SFILES): Remove command.c. (COMMON_OBS): Remove command.o. (command.o): Remove obsolete target. (cli_decode_h, cli_cmds_h, cli_script_h, cli_setshow_h): New macros. Refer to CLI header files. (cli-decode.o, cli-cmds.o, cli-setshow.o, cli-script.o): New targets. (SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_CLI_DEPS, SUBDIR_CLI_INITS, SUBDIR_CLI_LDFLAGS, SUBDIR_CLI_CFLAGS, SUBDIR_CLI_ALL, SUBDIR_CLI_CLEAN, SUBDIR_CLI_INSTALL, SUBDIR_CLI_UNINSTALL): New macros for new cli subdirectory. * configure.in (enable_gdbcli): New option. Include the CLI in the executable (cannot be disabled yet). (CONFIG_OBS, CONFIG_DEPS, CONFIG_SRCS, CONFIG_INITS, ENABLE_CFLAGS, CONFIG_ALL, CONFIG_CLEAN, CONFIG_INSTALL, CONFIG_UNINSTALL): Add the corresponding SUBDIR_CLI_* macros if CLI requested. * configure: Regenerate. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.48 diff -c -p -r1.48 Makefile.in *** Makefile.in 2000/12/01 00:41:27 1.48 --- Makefile.in 2000/12/01 16:46:55 *************** INTL_SRC = $(srcdir)/$(INTL_DIR) *** 135,140 **** --- 135,156 ---- INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC) # + # CLI sub directory definitons + # + SUBDIR_CLI_OBS = \ + cli-decode.o cli-script.o cli-cmds.o cli-setshow.o + SUBDIR_CLI_SRCS = \ + cli/cli-decode.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c + SUBDIR_CLI_DEPS = + SUBDIR_CLI_INITS = + SUBDIR_CLI_LDFLAGS= + SUBDIR_CLI_CFLAGS= + SUBDIR_CLI_ALL= + SUBDIR_CLI_CLEAN= + SUBDIR_CLI_INSTALL= + SUBDIR_CLI_UNINSTALL= + + # # MI sub directory definitons # SUBDIR_MI_OBS = \ *************** TARGET_FLAGS_TO_PASS = \ *** 477,483 **** SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \ ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \ ! command.c complaints.c completer.c corefile.c cp-valprint.c dbxread.c \ demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \ event-loop.c event-top.c \ expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \ --- 493,499 ---- SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \ ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \ ! complaints.c completer.c corefile.c cp-valprint.c dbxread.c \ demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \ event-loop.c event-top.c \ expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \ *************** breakpoint_h = breakpoint.h $(frame_h) $ *** 548,555 **** command_h = command.h gdbcmd_h = gdbcmd.h $(command_h) - call_cmds_h = call-cmds.h xm_h = @xm_h@ tm_h = @tm_h@ nm_h = @nm_h@ --- 564,571 ---- command_h = command.h gdbcmd_h = gdbcmd.h $(command_h) call_cmds_h = call-cmds.h + xm_h = @xm_h@ tm_h = @tm_h@ nm_h = @nm_h@ *************** ui_out_h = ui-out.h *** 568,573 **** --- 584,594 ---- cli_out_h = cli-out.h arch_utils_h = arch-utils.h + cli_decode_h = $(srcdir)/cli/cli-decode.h + cli_cmds_h = $(srcdir)/cli/cli-cmds.h + cli_script_h = $(srcdir)/cli/cli-script.h + cli_setshow_h = $(srcdir)/cli/cli-setshow.h + # Header files that need to have srcdir added. Note that in the cases # where we use a macro like $(gdbcmd_h), things are carefully arranged # so that each .h file is listed exactly once (M-x tags-search works *************** TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRC *** 621,627 **** COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \ source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ ! symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o command.o \ expprint.o environ.o stack.o thread.o \ event-loop.o event-top.o inf-loop.o completer.o \ gdbarch.o arch-utils.o gdbtypes.o copying.o $(DEPFILES) \ --- 642,648 ---- COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \ source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ ! symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \ expprint.o environ.o stack.o thread.o \ event-loop.o event-top.o inf-loop.o completer.o \ gdbarch.o arch-utils.o gdbtypes.o copying.o $(DEPFILES) \ *************** coffread.o: coffread.c $(bfd_h) $(breakp *** 1214,1221 **** symfile.h $(symtab_h) gdb-stabs.h stabsread.h target.h \ gdb_string.h ! command.o: command.c $(defs_h) $(expression_h) $(gdbcmd_h) \ ! $(gdbtypes_h) $(symtab_h) $(value_h) gdb_string.h gdb_wait.h complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h) --- 1235,1242 ---- symfile.h $(symtab_h) gdb-stabs.h stabsread.h target.h \ gdb_string.h ! # OBSOLETE command.o: command.c $(defs_h) $(expression_h) $(gdbcmd_h) \ ! # OBSOLETE $(gdbtypes_h) $(symtab_h) $(value_h) gdb_string.h gdb_wait.h complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h) *************** varobj.o: varobj.c $(defs_h) $(frame_h) *** 2012,2017 **** --- 2033,2064 ---- $(language_h) valprint.h varobj.h wrapper.h $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $< wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) wrapper.h + + # + # CLI dependencies + # + # Need to explicitly specify the compile rule as make will do nothing + # or try to compile the object file into the cli directory. + + cli-decode.o: $(srcdir)/cli/cli-decode.c $(cli_decode_h) \ + $(cli_cmds_h) $(defs_h) $(ui_out_h) \ + $(symtab_h) gnu-regex.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c + + cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(cli_cmds_h) $(cli_decode_h) \ + $(cli_script_h) $(cli_setshow_h) top.h completer.h $(defs_h) \ + $(target_h) gdb_wait.h gnu-regex.h $(ui_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c + + cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(cli_setshow_h) \ + $(cli_decode_h) $(cli_cmds_h) $(defs_h) \ + $(value_h) $(ui_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-setshow.c + + cli-script.o: $(srcdir)/cli/cli-script.c $(cli_script_h) \ + $(cli_cmds_h) $(cli_decode_h) top.h \ + $(defs_h) $(value_h) language.h $(ui_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-script.c # # MI dependencies Index: configure.in =================================================================== RCS file: /cvs/src/src/gdb/configure.in,v retrieving revision 1.45 diff -c -p -r1.45 configure.in *** configure.in 2000/11/24 11:02:58 1.45 --- configure.in 2000/12/01 16:46:56 *************** if test ${build} = ${host} -a ${host} = *** 460,465 **** --- 460,499 ---- AC_SUBST(CONFIG_LDFLAGS) fi + dnl The CLI cannot be disabled yet, but may be in the future + + dnl Handle CLI sub-directory configury. + AC_ARG_ENABLE(gdbcli, + [ --enable-gdbcli Enable GDB-CLI interface], + [ + case "${enable_gdbcli}" in + yes) ;; + "") enable_gdbcli=yes ;; + no) + AC_MSG_ERROR(The CLI cannot be disabled yet) + ;; + *) + AC_MSG_ERROR(Bad value for --enable-gdbmi: ${enableval}) + ;; + esac + ], + [enable_gdbcli=yes]) + case ${enable_gdbcli} in + "yes" ) + if test -d "${srcdir}/mi" ; then + CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_CLI_OBS)" + CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_CLI_DEPS)" + CONFIG_SRCS="${CONFIG_SRS} \$(SUBDIR_CLI_SRCS)" + CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_CLI_INITS)" + ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_CLI_CFLAGS)" + CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_CLI_ALL)" + CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_CLI_CLEAN)" + CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_CLI_INSTALL)" + CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_CLI_UNINSTALL)" + fi + ;; + esac + dnl Handle optional features that can be enabled. dnl Handle MI sub-directory configury. -------------------------------------------------------------- The following was added to command.h, gdbcmd.h and call-cmd.h: /* ***DEPRECATED*** The gdblib files must not be calling/using things in any of the possible command languages. If necessary, a hook (that may be present or not) must be used and set to the appropriate routine by any command language that cares about it. If you are having to include this file you are possibly doing things the old way. This file will disapear. fnasser@redhat.com */ -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 From eliz@is.elta.co.il Fri Dec 01 10:17:00 2000 From: "Eli Zaretskii" To: fnasser@cygnus.com Cc: gdb-patches@sources.redhat.com, muller@cerbere.u-strasbg.fr Subject: Re: Build failure on Linux - strnicmp undefined Date: Fri, 01 Dec 2000 10:17:00 -0000 Message-id: <2110-Fri01Dec2000201659+0200-eliz@is.elta.co.il> References: <3A27DBEA.D403D88A@cygnus.com> X-SW-Source: 2000-12/msg00012.html Content-length: 510 > Date: Fri, 01 Dec 2000 17:12:10 +0000 > From: Fernando Nasser > > The following change prevents GDB to build on Linux machines (and perhaps > others) where "strnicmp()" is not defined. > > Note that the ChangeLog entry has the wrong date. It was checked in this > morning. > > I reverted it in my sandbox. If we can't get hold of Pierre because of > time differences I will revert the patch in the repository as well. It might be much better to replace strnicmp with strncasecmp. From jtc@redback.com Fri Dec 01 10:25:00 2000 From: jtc@redback.com (J.T. Conklin) To: Fernando Nasser Cc: gdb-patches@sources.redhat.com, muller@cerbere.u-strasbg.fr Subject: Re: Build failure on Linux - strnicmp undefined Date: Fri, 01 Dec 2000 10:25:00 -0000 Message-id: <5mlmu0m21z.fsf@jtc.redback.com> References: <3A27DBEA.D403D88A@cygnus.com> X-SW-Source: 2000-12/msg00013.html Content-length: 407 >>>>> "Fernando" == Fernando Nasser writes: Fernando> The following change prevents GDB to build on Linux machines Fernando> (and perhaps others) where "strnicmp()" is not defined. I believe that strnicmp() is the DOS/Windows version of strncasecmp(), which is found in libiberty. Perhaps this simple change is all that is necessary. --jtc -- J.T. Conklin RedBack Networks From fnasser@cygnus.com Fri Dec 01 12:03:00 2000 From: Fernando Nasser To: egcs@cygnus.com Cc: gdb-patches@sources.redhat.com, muller@cerbere.u-strasbg.fr Subject: Re: Build failure on Linux - strnicmp undefined Date: Fri, 01 Dec 2000 12:03:00 -0000 Message-id: <3A280418.2A7AA698@cygnus.com> References: <3A27DBEA.D403D88A@cygnus.com> <5mlmu0m21z.fsf@jtc.redback.com> X-SW-Source: 2000-12/msg00014.html Content-length: 2754 Thanks folks. This works. I will check it in momentarily. * p-exp.y: Define strncasecmp as strnicmp for MSVC. (yylex): Use strncasecmp, not strnicmp. Index: p-exp.y =================================================================== RCS file: /cvs/src/src/gdb/p-exp.y,v retrieving revision 1.2 diff -c -p -r1.2 p-exp.y *** p-exp.y 2000/12/01 10:40:10 1.2 --- p-exp.y 2000/12/01 19:58:57 *************** Foundation, Inc., 59 Temple Place - Suit *** 58,63 **** --- 58,68 ---- #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ + /* MSVC uses strnicmp instead of strncasecmp */ + #ifdef _MSC_VER + #define strncasecmp strnicmp + #endif + /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple yacc generated parsers in gdb. Note that these are only the variables *************** yylex () *** 953,959 **** /* See if it is a special token of length 3. */ if (explen > 2) for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++) ! if (strnicmp (tokstart, tokentab3[i].operator, 3) == 0 && (!isalpha (tokentab3[i].operator[0]) || explen == 3 || (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_'))) { --- 958,964 ---- /* See if it is a special token of length 3. */ if (explen > 2) for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++) ! if (strncasecmp (tokstart, tokentab3[i].operator, 3) == 0 && (!isalpha (tokentab3[i].operator[0]) || explen == 3 || (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_'))) { *************** yylex () *** 965,971 **** /* See if it is a special token of length 2. */ if (explen > 1) for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++) ! if (strnicmp (tokstart, tokentab2[i].operator, 2) == 0 && (!isalpha (tokentab2[i].operator[0]) || explen == 2 || (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_'))) { --- 970,976 ---- /* See if it is a special token of length 2. */ if (explen > 1) for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++) ! if (strncasecmp (tokstart, tokentab2[i].operator, 2) == 0 && (!isalpha (tokentab2[i].operator[0]) || explen == 2 || (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_'))) { -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 From fnasser@cygnus.com Fri Dec 01 13:30:00 2000 From: Fernando Nasser To: gdb-patches@sources.redhat.com Subject: RFA: Remove unused synchronous code Date: Fri, 01 Dec 2000 13:30:00 -0000 Message-id: <3A28185D.D114FFF4@cygnus.com> X-SW-Source: 2000-12/msg00015.html Content-length: 40252 The new event loop has been the default since 1999-06-23. This is almost 1 1/2 yrs. This means that if you do not start GDB with "--noasync" you've been using it all along. The code itself is almost 2 yrs. old and has been proven robust. It is a nice piece of code if you haven't had the opportunity to look at it (Elena Zannoni wrote it, or at least most of it). It happens that the provisions for fall-back (run synchronously) are getting in the way, making the code illegible and requiring duplicate efforts (you should still make sure that the old way works -- have you tested with --noasync after applying your patches?). This patch removes the stale (currently unused) non-asynchronous code. OK to commit? Fernando ChangeLog: Remove old synchronous command loop that has not been used (as default) since 1999-06-23. * main.c (event_loop_p): Remove definition. (long_options[]): Remove "async" and "noasync" options. * defs.h: Remove declaration of event_loop_p. * breakpoint.c (until_break_command): Assume event_loop_p true. * event-top.c (_initialize_event_loop): Ditto. * infcmd.c (run_command, continue_command, step_1, jump_command, until_command, finish_command, interrupt_target_command_wrapper): Ditto. * infrun.c (proceed): Ditto. * remote.c (remote_async_resume, extended_remote_async_create_inferior): Ditto. * top.c (return_to_top_level, gdb_init, execute_command, command_line_input, get_prompt_1, get_prompt, set_prompt, init_main): Ditto. * tracepoint.c (read_actions): Ditto. * utils.c (prompt_for_continue): Ditto. * mi/mi-main.c (mi_command_loop, _initialize_mi_main): Ditto. -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.21 diff -c -p -r1.21 breakpoint.c *** breakpoint.c 2000/12/01 00:41:27 1.21 --- breakpoint.c 2000/12/01 20:47:19 *************** until_break_command (char *arg, int from *** 5577,5595 **** breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until); ! if (!event_loop_p || !target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); else old_chain = make_exec_cleanup_delete_breakpoint (breakpoint); ! /* If we are running asynchronously, and the target supports async ! execution, we are not waiting for the target to stop, in the call ! tp proceed, below. This means that we cannot delete the ! brekpoints until the target has actually stopped. The only place where we get a chance to do that is in fetch_inferior_event, so we must set things up for that. */ ! if (event_loop_p && target_can_async_p ()) { /* In this case the arg for the continuation is just the point in the exec_cleanups chain from where to start doing --- 5577,5594 ---- breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until); ! if (!target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); else old_chain = make_exec_cleanup_delete_breakpoint (breakpoint); ! /* If the target supports async execution, we are not waiting for the target ! to stop, in the call to proceed, below. This means that we cannot delete ! the brekpoints until the target has actually stopped. The only place where we get a chance to do that is in fetch_inferior_event, so we must set things up for that. */ ! if (target_can_async_p ()) { /* In this case the arg for the continuation is just the point in the exec_cleanups chain from where to start doing *************** until_break_command (char *arg, int from *** 5610,5625 **** sal = find_pc_line (prev_frame->pc, 0); sal.pc = prev_frame->pc; breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until); ! if (!event_loop_p || !target_can_async_p ()) make_cleanup_delete_breakpoint (breakpoint); else make_exec_cleanup_delete_breakpoint (breakpoint); } proceed (-1, TARGET_SIGNAL_DEFAULT, 0); ! /* Do the cleanups now, anly if we are not running asynchronously, ! of if we are, but the target is still synchronous. */ ! if (!event_loop_p || !target_can_async_p ()) do_cleanups (old_chain); } --- 5609,5623 ---- sal = find_pc_line (prev_frame->pc, 0); sal.pc = prev_frame->pc; breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until); ! if (!target_can_async_p ()) make_cleanup_delete_breakpoint (breakpoint); else make_exec_cleanup_delete_breakpoint (breakpoint); } proceed (-1, TARGET_SIGNAL_DEFAULT, 0); ! /* Do the cleanups now if the target is still synchronous. */ ! if (!target_can_async_p ()) do_cleanups (old_chain); } Index: defs.h =================================================================== RCS file: /cvs/src/src/gdb/defs.h,v retrieving revision 1.32 diff -c -p -r1.32 defs.h *** defs.h 2000/11/20 02:06:18 1.32 --- defs.h 2000/12/01 20:47:20 *************** extern char *interpreter_p; *** 1160,1169 **** struct target_waitstatus; struct cmd_list_element; - /* Should the asynchronous variant of the interpreter (using the - event-loop) be enabled? */ - extern int event_loop_p; - extern void (*init_ui_hook) (char *argv0); extern void (*command_loop_hook) (void); extern void (*show_load_progress) (const char *section, --- 1160,1165 ---- Index: event-top.c =================================================================== RCS file: /cvs/src/src/gdb/event-top.c,v retrieving revision 1.9 diff -c -p -r1.9 event-top.c *** event-top.c 2000/09/01 23:53:02 1.9 --- event-top.c 2000/12/01 20:47:20 *************** set_async_prompt (char *args, int from_t *** 1130,1179 **** void _initialize_event_loop (void) { ! if (event_loop_p) { ! /* If the input stream is connected to a terminal, turn on ! editing. */ ! if (ISATTY (instream)) ! { ! /* Tell gdb that we will be using the readline library. This ! could be overwritten by a command in .gdbinit like 'set ! editing on' or 'off'. */ ! async_command_editing_p = 1; ! ! /* When a character is detected on instream by select or ! poll, readline will be invoked via this callback ! function. */ ! call_readline = rl_callback_read_char_wrapper; ! } ! else ! { ! async_command_editing_p = 0; ! call_readline = gdb_readline2; ! } ! /* When readline has read an end-of-line character, it passes ! the complete line to gdb for processing. command_line_handler ! is the function that does this. */ ! input_handler = command_line_handler; ! /* Tell readline to use the same input stream that gdb uses. */ ! rl_instream = instream; ! /* Get a file descriptor for the input stream, so that we can ! register it with the event loop. */ ! input_fd = fileno (instream); ! /* Tell gdb to use the cli_command_loop as the main loop. */ ! command_loop_hook = cli_command_loop; ! /* Now we need to create the event sources for the input file ! descriptor. */ ! /* At this point in time, this is the only event source that we ! register with the even loop. Another source is going to be ! the target program (inferior), but that must be registered ! only when it actually exists (I.e. after we say 'run' or ! after we connect to a remote target. */ ! add_file_handler (input_fd, stdin_event_handler, 0); ! } } --- 1130,1176 ---- void _initialize_event_loop (void) { ! /* If the input stream is connected to a terminal, turn on ! editing. */ ! if (ISATTY (instream)) { ! /* Tell gdb that we will be using the readline library. This ! could be overwritten by a command in .gdbinit like 'set ! editing on' or 'off'. */ ! async_command_editing_p = 1; ! ! /* When a character is detected on instream by select or ! poll, readline will be invoked via this callback ! function. */ ! call_readline = rl_callback_read_char_wrapper; ! } ! else ! { ! async_command_editing_p = 0; ! call_readline = gdb_readline2; ! } ! /* When readline has read an end-of-line character, it passes ! the complete line to gdb for processing. command_line_handler ! is the function that does this. */ ! input_handler = command_line_handler; ! /* Tell readline to use the same input stream that gdb uses. */ ! rl_instream = instream; ! /* Get a file descriptor for the input stream, so that we can ! register it with the event loop. */ ! input_fd = fileno (instream); ! /* Tell gdb to use the cli_command_loop as the main loop. */ ! command_loop_hook = cli_command_loop; ! /* Now we need to create the event sources for the input file ! descriptor. */ ! /* At this point in time, this is the only event source that we ! register with the even loop. Another source is going to be ! the target program (inferior), but that must be registered ! only when it actually exists (I.e. after we say 'run' or ! after we connect to a remote target. */ ! add_file_handler (input_fd, stdin_event_handler, 0); } Index: infcmd.c =================================================================== RCS file: /cvs/src/src/gdb/infcmd.c,v retrieving revision 1.13 diff -c -p -r1.13 infcmd.c *** infcmd.c 2000/11/10 19:27:45 1.13 --- infcmd.c 2000/12/01 20:47:20 *************** Start it from the beginning? ")) *** 275,281 **** if (!args) { ! if (event_loop_p && target_can_async_p ()) async_disable_stdin (); } else --- 275,281 ---- if (!args) { ! if (target_can_async_p ()) async_disable_stdin (); } else *************** Start it from the beginning? ")) *** 285,296 **** /* If we get a request for running in the bg but the target doesn't support it, error out. */ ! if (event_loop_p && async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we don't get a request of running in the bg, then we need to simulate synchronous (fg) execution. */ ! if (event_loop_p && !async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); --- 285,296 ---- /* If we get a request for running in the bg but the target doesn't support it, error out. */ ! if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we don't get a request of running in the bg, then we need to simulate synchronous (fg) execution. */ ! if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); *************** continue_command (char *proc_count_exp, *** 352,363 **** /* If we must run in the background, but the target can't do it, error out. */ ! if (event_loop_p && async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ ! if (event_loop_p && !async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); --- 352,363 ---- /* If we must run in the background, but the target can't do it, error out. */ ! if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ ! if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); *************** step_1 (int skip_subroutines, int single *** 450,461 **** /* If we get a request for running in the bg but the target doesn't support it, error out. */ ! if (event_loop_p && async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we don't get a request of running in the bg, then we need to simulate synchronous (fg) execution. */ ! if (event_loop_p && !async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); --- 450,461 ---- /* If we get a request for running in the bg but the target doesn't support it, error out. */ ! if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we don't get a request of running in the bg, then we need to simulate synchronous (fg) execution. */ ! if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); *************** step_1 (int skip_subroutines, int single *** 466,479 **** if (!single_inst || skip_subroutines) /* leave si command alone */ { enable_longjmp_breakpoint (); ! if (!event_loop_p || !target_can_async_p ()) cleanups = make_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); else make_exec_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); } /* In synchronous case, all is well, just use the regular for loop. */ ! if (!event_loop_p || !target_can_async_p ()) { for (; count > 0; count--) { --- 466,479 ---- if (!single_inst || skip_subroutines) /* leave si command alone */ { enable_longjmp_breakpoint (); ! if (!target_can_async_p ()) cleanups = make_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); else make_exec_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); } /* In synchronous case, all is well, just use the regular for loop. */ ! if (!target_can_async_p ()) { for (; count > 0; count--) { *************** which has no line number information.\n" *** 539,545 **** and handle them one at the time, through step_once(). */ else { ! if (event_loop_p && target_can_async_p ()) step_once (skip_subroutines, single_inst, count); } } --- 539,545 ---- and handle them one at the time, through step_once(). */ else { ! if (target_can_async_p ()) step_once (skip_subroutines, single_inst, count); } } *************** jump_command (char *arg, int from_tty) *** 675,686 **** /* If we must run in the background, but the target can't do it, error out. */ ! if (event_loop_p && async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ ! if (event_loop_p && !async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); --- 675,686 ---- /* If we must run in the background, but the target can't do it, error out. */ ! if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ ! if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); *************** until_command (char *arg, int from_tty) *** 983,994 **** /* If we must run in the background, but the target can't do it, error out. */ ! if (event_loop_p && async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ ! if (event_loop_p && !async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); --- 983,994 ---- /* If we must run in the background, but the target can't do it, error out. */ ! if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ ! if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); *************** finish_command (char *arg, int from_tty) *** 1131,1142 **** /* If we must run in the background, but the target can't do it, error out. */ ! if (event_loop_p && async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ ! if (event_loop_p && !async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); --- 1131,1142 ---- /* If we must run in the background, but the target can't do it, error out. */ ! if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ ! if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); *************** finish_command (char *arg, int from_tty) *** 1160,1166 **** breakpoint = set_momentary_breakpoint (sal, frame, bp_finish); ! if (!event_loop_p || !target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); else old_chain = make_exec_cleanup_delete_breakpoint (breakpoint); --- 1160,1166 ---- breakpoint = set_momentary_breakpoint (sal, frame, bp_finish); ! if (!target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); else old_chain = make_exec_cleanup_delete_breakpoint (breakpoint); *************** finish_command (char *arg, int from_tty) *** 1177,1187 **** print_stack_frame (selected_frame, selected_frame_level, 0); } ! /* If running asynchronously and the target support asynchronous ! execution, set things up for the rest of the finish command to be ! completed later on, when gdb has detected that the target has ! stopped, in fetch_inferior_event. */ ! if (event_loop_p && target_can_async_p ()) { arg1 = (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg)); --- 1177,1186 ---- print_stack_frame (selected_frame, selected_frame_level, 0); } ! /* If the target support asynchronous execution, set things up for the rest ! of the finish command to be completed later on, when gdb has detected that ! the target has stopped, in fetch_inferior_event. */ ! if (target_can_async_p ()) { arg1 = (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg)); *************** finish_command (char *arg, int from_tty) *** 1201,1210 **** proceed_to_finish = 1; /* We want stop_registers, please... */ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); ! /* Do this only if not running asynchronously or if the target ! cannot do async execution. Otherwise, complete this command when ! the target actually stops, in fetch_inferior_event. */ ! if (!event_loop_p || !target_can_async_p ()) { /* Did we stop at our breakpoint? */ --- 1200,1208 ---- proceed_to_finish = 1; /* We want stop_registers, please... */ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); ! /* Do this only if the target cannot do async execution. Otherwise, complete ! this command when the target actually stops, in fetch_inferior_event. */ ! if (!target_can_async_p ()) { /* Did we stop at our breakpoint? */ *************** interrupt_target_command_wrapper (char * *** 1744,1750 **** static void interrupt_target_command (char *args, int from_tty) { ! if (event_loop_p && target_can_async_p ()) { dont_repeat (); /* Not for the faint of heart */ target_stop (); --- 1742,1748 ---- static void interrupt_target_command (char *args, int from_tty) { ! if (target_can_async_p ()) { dont_repeat (); /* Not for the faint of heart */ target_stop (); Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.22 diff -c -p -r1.22 infrun.c *** infrun.c 2000/11/10 19:27:45 1.22 --- infrun.c 2000/12/01 20:47:21 *************** breakpoints and/or watchpoints.\n"); *** 1083,1091 **** /* Wait for it to stop (if not standalone) and in any case decode why it stopped, and act accordingly. */ ! /* Do this only if we are not using the event loop, or if the target ! does not support asynchronous execution. */ ! if (!event_loop_p || !target_can_async_p ()) { wait_for_inferior (); normal_stop (); --- 1083,1090 ---- /* Wait for it to stop (if not standalone) and in any case decode why it stopped, and act accordingly. */ ! /* Do this only if the target does not support asynchronous execution. */ ! if (!target_can_async_p ()) { wait_for_inferior (); normal_stop (); Index: main.c =================================================================== RCS file: /cvs/src/src/gdb/main.c,v retrieving revision 1.4 diff -c -p -r1.4 main.c *** main.c 2000/10/23 22:49:28 1.4 --- main.c 2000/12/01 20:47:22 *************** int display_time; *** 47,58 **** int display_space; - /* Whether this is the async version or not. The async version is - invoked on the command line with the -nw --async options. In this - version, the usual command_loop is substituted by and event loop which - processes UI events asynchronously. */ - int event_loop_p = 1; - #ifdef UI_OUT /* Has an interpreter been specified and if so, which. */ char *interpreter_p; --- 47,52 ---- *************** captured_main (void *data) *** 223,230 **** with no equivalent). */ static struct option long_options[] = { - {"async", no_argument, &event_loop_p, 1}, - {"noasync", no_argument, &event_loop_p, 0}, #if defined(TUI) {"tui", no_argument, &tui_version, 1}, #endif --- 217,222 ---- Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.30 diff -c -p -r1.30 remote.c *** remote.c 2000/11/27 02:18:44 1.30 --- remote.c 2000/12/01 20:47:23 *************** remote_async_resume (int pid, int step, *** 2355,2361 **** /* FIXME: ezannoni 1999-09-28: We may need to move this out of here into infcmd.c in order to allow inferior function calls to work NOT asynchronously. */ ! if (event_loop_p && target_can_async_p ()) target_async (inferior_event_handler, 0); /* Tell the world that the target is now executing. */ /* FIXME: cagney/1999-09-23: Is it the targets responsibility to set --- 2355,2361 ---- /* FIXME: ezannoni 1999-09-28: We may need to move this out of here into infcmd.c in order to allow inferior function calls to work NOT asynchronously. */ ! if (target_can_async_p ()) target_async (inferior_event_handler, 0); /* Tell the world that the target is now executing. */ /* FIXME: cagney/1999-09-23: Is it the targets responsibility to set *************** extended_remote_async_create_inferior (c *** 4177,4183 **** /* If running asynchronously, register the target file descriptor with the event loop. */ ! if (event_loop_p && target_can_async_p ()) target_async (inferior_event_handler, 0); /* Now restart the remote server. */ --- 4177,4183 ---- /* If running asynchronously, register the target file descriptor with the event loop. */ ! if (target_can_async_p ()) target_async (inferior_event_handler, 0); /* Now restart the remote server. */ Index: top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.24 diff -c -p -r1.24 top.c *** top.c 2000/12/01 18:01:38 1.24 --- top.c 2000/12/01 20:47:23 *************** return_to_top_level (enum return_reason *** 392,400 **** disable_current_display (); do_cleanups (ALL_CLEANUPS); ! if (event_loop_p && target_can_async_p () && !target_executing) do_exec_cleanups (ALL_CLEANUPS); ! if (event_loop_p && sync_execution) do_exec_error_cleanups (ALL_CLEANUPS); if (annotation_level > 1) --- 392,400 ---- disable_current_display (); do_cleanups (ALL_CLEANUPS); ! if (target_can_async_p () && !target_executing) do_exec_cleanups (ALL_CLEANUPS); ! if (sync_execution) do_exec_error_cleanups (ALL_CLEANUPS); if (annotation_level > 1) *************** gdb_init (char *argv0) *** 686,699 **** init_cli_cmds(); init_main (); /* But that omits this file! Do it now */ ! /* The signal handling mechanism is different depending whether or ! not the async version is run. NOTE: in the future we plan to make ! the event loop be the default engine of gdb, and this difference ! will disappear. */ ! if (event_loop_p) ! async_init_signals (); ! else ! init_signals (); /* We need a default language for parsing expressions, so simple things like "set width 0" won't fail if no language is explicitly set in a config file --- 686,692 ---- init_cli_cmds(); init_main (); /* But that omits this file! Do it now */ ! async_init_signals (); /* We need a default language for parsing expressions, so simple things like "set width 0" won't fail if no language is explicitly set in a config file *************** extern void serial_log_command (const ch *** 757,763 **** /* If the target is running, we allow only a limited set of commands. */ ! if (event_loop_p && target_can_async_p () && target_executing) if (!strcmp (c->name, "help") && !strcmp (c->name, "pwd") && !strcmp (c->name, "show") --- 750,756 ---- /* If the target is running, we allow only a limited set of commands. */ ! if (target_can_async_p () && target_executing) if (!strcmp (c->name, "help") && !strcmp (c->name, "pwd") && !strcmp (c->name, "show") *************** command_line_input (char *prompt_arg, in *** 1203,1212 **** #ifdef STOP_SIGNAL if (job_control) { ! if (event_loop_p) ! signal (STOP_SIGNAL, handle_stop_sig); ! else ! signal (STOP_SIGNAL, stop_sig); } #endif --- 1196,1202 ---- #ifdef STOP_SIGNAL if (job_control) { ! signal (STOP_SIGNAL, handle_stop_sig); } #endif *************** get_prompt_1 (void *data) *** 1442,1453 **** { char *formatted_prompt = data; char *local_prompt; - - if (event_loop_p) - local_prompt = PROMPT (0); - else - local_prompt = gdb_prompt_string; if (gdb_prompt_escape == 0) { --- 1432,1439 ---- { char *formatted_prompt = data; char *local_prompt; + local_prompt = PROMPT (0); if (gdb_prompt_escape == 0) { *************** get_prompt (void) *** 1679,1688 **** else { /* Prompt could not be formatted. */ ! if (event_loop_p) ! return PROMPT (0); ! else ! return gdb_prompt_string; } } --- 1665,1671 ---- else { /* Prompt could not be formatted. */ ! return PROMPT (0); } } *************** set_prompt (char *s) *** 1694,1703 **** if (prompt != NULL) free (prompt); */ ! if (event_loop_p) ! PROMPT (0) = savestring (s, strlen (s)); ! else ! gdb_prompt_string = savestring (s, strlen (s)); } --- 1677,1683 ---- if (prompt != NULL) free (prompt); */ ! PROMPT (0) = savestring (s, strlen (s)); } *************** init_main (void) *** 1976,2001 **** { struct cmd_list_element *c; ! /* If we are running the asynchronous version, ! we initialize the prompts differently. */ ! if (!event_loop_p) ! { ! gdb_prompt_string = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT)); ! } ! else ! { ! /* initialize the prompt stack to a simple "(gdb) " prompt or to ! whatever the DEFAULT_PROMPT is. */ ! the_prompts.top = 0; ! PREFIX (0) = ""; ! PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT)); ! SUFFIX (0) = ""; ! /* Set things up for annotation_level > 1, if the user ever decides ! to use it. */ ! async_annotation_suffix = "prompt"; ! /* Set the variable associated with the setshow prompt command. */ ! new_async_prompt = savestring (PROMPT (0), strlen (PROMPT (0))); ! } gdb_prompt_escape = 0; /* default to none. */ /* Set the important stuff up for command editing. */ --- 1956,1973 ---- { struct cmd_list_element *c; ! /* initialize the prompt stack to a simple "(gdb) " prompt or to ! whatever the DEFAULT_PROMPT is. */ ! the_prompts.top = 0; ! PREFIX (0) = ""; ! PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT)); ! SUFFIX (0) = ""; ! /* Set things up for annotation_level > 1, if the user ever decides ! to use it. */ ! async_annotation_suffix = "prompt"; ! /* Set the variable associated with the setshow prompt command. */ ! new_async_prompt = savestring (PROMPT (0), strlen (PROMPT (0))); ! gdb_prompt_escape = 0; /* default to none. */ /* Set the important stuff up for command editing. */ *************** init_main (void) *** 2010,2035 **** rl_completer_quote_characters = get_gdb_completer_quote_characters (); rl_readline_name = "gdb"; ! /* The set prompt command is different depending whether or not the ! async version is run. NOTE: this difference is going to ! disappear as we make the event loop be the default engine of ! gdb. */ ! if (!event_loop_p) ! { ! add_show_from_set ! (add_set_cmd ("prompt", class_support, var_string, ! (char *) &gdb_prompt_string, "Set gdb's prompt", ! &setlist), ! &showlist); ! } ! else ! { ! c = add_set_cmd ("prompt", class_support, var_string, ! (char *) &new_async_prompt, "Set gdb's prompt", ! &setlist); ! add_show_from_set (c, &showlist); ! c->function.sfunc = set_async_prompt; ! } add_show_from_set (add_set_cmd ("prompt-escape-char", class_support, var_zinteger, --- 1982,1992 ---- rl_completer_quote_characters = get_gdb_completer_quote_characters (); rl_readline_name = "gdb"; ! c = add_set_cmd ("prompt", class_support, var_string, ! (char *) &new_async_prompt, "Set gdb's prompt", ! &setlist); ! add_show_from_set (c, &showlist); ! c->function.sfunc = set_async_prompt; add_show_from_set (add_set_cmd ("prompt-escape-char", class_support, var_zinteger, *************** init_main (void) *** 2042,2071 **** Primarily used inside of user-defined commands that should not be repeated when\n\ hitting return."); ! /* The set editing command is different depending whether or not the ! async version is run. NOTE: this difference is going to disappear ! as we make the event loop be the default engine of gdb. */ ! if (!event_loop_p) ! { ! add_show_from_set ! (add_set_cmd ("editing", class_support, var_boolean, (char *) &command_editing_p, ! "Set editing of command lines as they are typed.\n\ ! Use \"on\" to enable the editing, and \"off\" to disable it.\n\ ! Without an argument, command line editing is enabled. To edit, use\n\ ! EMACS-like or VI-like commands like control-P or ESC.", &setlist), ! &showlist); ! } ! else ! { ! c = add_set_cmd ("editing", class_support, var_boolean, (char *) &async_command_editing_p, ! "Set editing of command lines as they are typed.\n\ Use \"on\" to enable the editing, and \"off\" to disable it.\n\ Without an argument, command line editing is enabled. To edit, use\n\ EMACS-like or VI-like commands like control-P or ESC.", &setlist); ! add_show_from_set (c, &showlist); ! c->function.sfunc = set_async_editing_command; ! } add_show_from_set (add_set_cmd ("save", no_class, var_boolean, (char *) &write_history_p, --- 1999,2012 ---- Primarily used inside of user-defined commands that should not be repeated when\n\ hitting return."); ! c = add_set_cmd ("editing", class_support, var_boolean, (char *) &async_command_editing_p, ! "Set editing of command lines as they are typed.\n\ Use \"on\" to enable the editing, and \"off\" to disable it.\n\ Without an argument, command line editing is enabled. To edit, use\n\ EMACS-like or VI-like commands like control-P or ESC.", &setlist); ! add_show_from_set (c, &showlist); ! c->function.sfunc = set_async_editing_command; add_show_from_set (add_set_cmd ("save", no_class, var_boolean, (char *) &write_history_p, *************** ie. the number of previous commands to k *** 2093,2127 **** &setlist), &showlist); ! /* The set annotate command is different depending whether or not ! the async version is run. NOTE: this difference is going to ! disappear as we make the event loop be the default engine of ! gdb. */ ! if (!event_loop_p) ! { ! c = add_set_cmd ("annotate", class_obscure, var_zinteger, ! (char *) &annotation_level, "Set annotation_level.\n\ 0 == normal; 1 == fullname (for use when running under emacs)\n\ 2 == output annotated suitably for use by programs that control GDB.", ! &setlist); ! c = add_show_from_set (c, &showlist); ! } ! else ! { ! c = add_set_cmd ("annotate", class_obscure, var_zinteger, ! (char *) &annotation_level, "Set annotation_level.\n\ ! 0 == normal; 1 == fullname (for use when running under emacs)\n\ ! 2 == output annotated suitably for use by programs that control GDB.", ! &setlist); ! add_show_from_set (c, &showlist); ! c->function.sfunc = set_async_annotation_level; ! } ! if (event_loop_p) ! { ! add_show_from_set ! (add_set_cmd ("exec-done-display", class_support, var_boolean, (char *) &exec_done_display_p, ! "Set notification of completion for asynchronous execution commands.\n\ Use \"on\" to enable the notification, and \"off\" to disable it.", &setlist), &showlist); - } } --- 2034,2050 ---- &setlist), &showlist); ! c = add_set_cmd ("annotate", class_obscure, var_zinteger, ! (char *) &annotation_level, "Set annotation_level.\n\ 0 == normal; 1 == fullname (for use when running under emacs)\n\ 2 == output annotated suitably for use by programs that control GDB.", ! &setlist); ! add_show_from_set (c, &showlist); ! c->function.sfunc = set_async_annotation_level; ! ! add_show_from_set (add_set_cmd ("exec-done-display", class_support, ! var_boolean, (char *) &exec_done_display_p, ! "Set notification of completion for asynchronous execution commands.\n\ Use \"on\" to enable the notification, and \"off\" to disable it.", &setlist), &showlist); } Index: tracepoint.c =================================================================== RCS file: /cvs/src/src/gdb/tracepoint.c,v retrieving revision 1.14 diff -c -p -r1.14 tracepoint.c *** tracepoint.c 2000/12/01 00:41:27 1.14 --- tracepoint.c 2000/12/01 20:47:24 *************** read_actions (struct tracepoint *t) *** 816,825 **** #ifdef STOP_SIGNAL if (job_control) { ! if (event_loop_p) ! signal (STOP_SIGNAL, handle_stop_sig); ! else ! signal (STOP_SIGNAL, stop_sig); } #endif old_chain = make_cleanup_free_actions (t); --- 816,822 ---- #ifdef STOP_SIGNAL if (job_control) { ! signal (STOP_SIGNAL, handle_stop_sig); } #endif old_chain = make_cleanup_free_actions (t); Index: utils.c =================================================================== RCS file: /cvs/src/src/gdb/utils.c,v retrieving revision 1.23 diff -c -p -r1.23 utils.c *** utils.c 2000/11/20 02:06:19 1.23 --- utils.c 2000/12/01 20:47:24 *************** prompt_for_continue (void) *** 1631,1640 **** ++p; if (p[0] == 'q') { ! if (!event_loop_p) ! request_quit (SIGINT); ! else ! async_request_quit (0); } free (ignore); } --- 1631,1637 ---- ++p; if (p[0] == 'q') { ! async_request_quit (0); } free (ignore); } Index: mi/mi-main.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-main.c,v retrieving revision 1.8 diff -c -p -r1.8 mi-main.c *** mi-main.c 2000/11/20 02:06:19 1.8 --- mi-main.c 2000/12/01 20:47:25 *************** mi_command_loop (void) *** 1456,1465 **** /* Tell the world that we're alive */ fputs_unfiltered ("(gdb) \n", raw_stdout); ! if (!event_loop_p) ! simplified_command_loop (mi_input, mi_execute_command); ! else ! start_event_loop (); } static void --- 1456,1462 ---- /* Tell the world that we're alive */ fputs_unfiltered ("(gdb) \n", raw_stdout); ! start_event_loop (); } static void *************** _initialize_mi_main (void) *** 1489,1503 **** setup_architecture_data (); register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL); register_gdbarch_swap (NULL, 0, setup_architecture_data); ! if (event_loop_p) ! { ! /* These overwrite some of the initialization done in ! _intialize_event_loop. */ ! call_readline = gdb_readline2; ! input_handler = mi_execute_command_wrapper; ! add_file_handler (input_fd, stdin_event_handler, 0); ! async_command_editing_p = 0; ! } } /* FIXME: Should we notify main that we are here as a possible interpreter? */ --- 1486,1497 ---- setup_architecture_data (); register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL); register_gdbarch_swap (NULL, 0, setup_architecture_data); ! /* These overwrite some of the initialization done in ! _intialize_event_loop. */ ! call_readline = gdb_readline2; ! input_handler = mi_execute_command_wrapper; ! add_file_handler (input_fd, stdin_event_handler, 0); ! async_command_editing_p = 0; } /* FIXME: Should we notify main that we are here as a possible interpreter? */ From jtc@redback.com Fri Dec 01 13:39:00 2000 From: jtc@redback.com (J.T. Conklin) To: Fernando Nasser Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: Remove unused synchronous code Date: Fri, 01 Dec 2000 13:39:00 -0000 Message-id: <5m8zpzkeir.fsf@jtc.redback.com> References: <3A28185D.D114FFF4@cygnus.com> X-SW-Source: 2000-12/msg00016.html Content-length: 549 >>>>> "Fernando" == Fernando Nasser writes: Fernando> This patch removes the stale (currently unused) Fernando> non-asynchronous code. Fernando> Fernando> OK to commit? Not so fast. There was some issue, I think related to stopping the inferior, that I reported shortly after the async loop as made the default. I believe the fix was grotty enough that we (redback) were forced to go back to using the synchronous loop. I'll try to look up the details sometime later today. --jtc -- J.T. Conklin RedBack Networks From jtc@redback.com Fri Dec 01 16:11:00 2000 From: jtc@redback.com (J.T. Conklin) To: Fernando Nasser Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: Remove unused synchronous code Date: Fri, 01 Dec 2000 16:11:00 -0000 Message-id: <5md7fbisvu.fsf@jtc.redback.com> References: <3A28185D.D114FFF4@cygnus.com> <5m8zpzkeir.fsf@jtc.redback.com> X-SW-Source: 2000-12/msg00017.html Content-length: 723 >>>>> "jtc" == J T Conklin writes: >>>>> "Fernando" == Fernando Nasser writes: Fernando> This patch removes the stale (currently unused) Fernando> non-asynchronous code. Fernando> Fernando> OK to commit? jtc> Not so fast. There was some issue, I think related to stopping the jtc> inferior, that I reported shortly after the async loop as made the jtc> default. I believe the fix was grotty enough that we (redback) were jtc> forced to go back to using the synchronous loop. jtc> jtc> I'll try to look up the details sometime later today. The thread I was refering to starts here: http://sources.redhat.com/ml/gdb/1999-q4/msg00143.html -- J.T. Conklin RedBack Networks From jtc@redback.com Fri Dec 01 16:48:00 2000 From: jtc@redback.com (J.T. Conklin) To: gdb-patches@sourceware.cygnus.com Subject: [RFA]: gdbserver cleanup, add m68k & ns32k support to low-nbsd.c Date: Fri, 01 Dec 2000 16:48:00 -0000 Message-id: <5m3dg7ir72.fsf@jtc.redback.com> X-SW-Source: 2000-12/msg00018.html Content-length: 16820 I submit the enclosed patch for approval. I only planning to add support for m68k and ns32k based NetBSD systems, when I found some unused variables, etc. in the low-*.c files. I couldn't fix the instances in only low-nbsd.c without fixing the others, so those changes are in here as well. --jtc 2000-12-01 J.T. Conklin * gdbserver/low-hppabsd.c (buf2, environ, quit, quit_flag): Removed unused variables and declarations. * gdbserver/low-linux.c (buf2, environ, query, quit, quit_flag): Likewise. * gdbserver/low-nbsd.c (buf2, environ, quit, quit_flag): Likewise. * gdbserver/low-sparc.c (buf2, environ, query, quit, quit_flag): Likewise. * gdbserver/low-sun.c (buf2, environ, query, quit, quit_flag): Likewise. * gdbserver/low-hppabsd.c, gdbserver/low-linux.c, gdbserver/low-nbsd.c, gdbserver/low-sparc.c, gdbserver/low-sun3.c (create_inferior): Update comment. * gdbserver/low-nbsd.c (initialize_arch, fetch_inferior_registers, store_inferior_registers): Provide implementations for the m68k and ns32k. * config/m68k/nbsd.mt (GDBSERVER_DEPFILES): Add low-nbsd.o * config/ns32k/nbsd.mt (GDBSERVER_DEPFILES): Likewise. * configure.tgt (m68*-*-netbsd*, ns32k-*-netbsd*): Add gdbserver to configdirs. Index: configure.tgt =================================================================== RCS file: /cvs/src/src/gdb/configure.tgt,v retrieving revision 1.14 diff -c -r1.14 configure.tgt *** configure.tgt 2000/11/26 20:04:41 1.14 --- configure.tgt 2000/12/02 00:40:45 *************** *** 167,173 **** configdirs="${configdirs} gdbserver" ;; m68*-*-lynxos*) gdb_target=m68klynx configdirs="${configdirs} gdbserver" ;; ! m68*-*-netbsd*) gdb_target=nbsd ;; m68*-*-os68k*) gdb_target=os68k ;; m68*-*-sunos3*) gdb_target=sun3os3 ;; m68*-*-sunos4*) gdb_target=sun3os4 ;; --- 167,174 ---- configdirs="${configdirs} gdbserver" ;; m68*-*-lynxos*) gdb_target=m68klynx configdirs="${configdirs} gdbserver" ;; ! m68*-*-netbsd*) gdb_target=nbsd ! configdirs="${configdirs} gdbserver" ;; m68*-*-os68k*) gdb_target=os68k ;; m68*-*-sunos3*) gdb_target=sun3os3 ;; m68*-*-sunos4*) gdb_target=sun3os4 ;; *************** *** 222,228 **** none-*-*) gdb_target=none ;; ns32k-*-mach3*) gdb_target=ns32km3 ;; ! ns32k-*-netbsd*) gdb_target=nbsd ;; ns32k-utek-sysv*) gdb_target=merlin ;; ns32k-utek-*) gdb_target=umax ;; --- 223,230 ---- none-*-*) gdb_target=none ;; ns32k-*-mach3*) gdb_target=ns32km3 ;; ! ns32k-*-netbsd*) gdb_target=nbsd ! configdirs="${configdirs} gdbserver" ;; ns32k-utek-sysv*) gdb_target=merlin ;; ns32k-utek-*) gdb_target=umax ;; Index: config/m68k/nbsd.mt =================================================================== RCS file: /cvs/src/src/gdb/config/m68k/nbsd.mt,v retrieving revision 1.3 diff -c -r1.3 nbsd.mt *** nbsd.mt 2000/11/09 22:57:02 1.3 --- nbsd.mt 2000/12/02 00:40:45 *************** *** 1,3 **** --- 1,5 ---- # Target: Motorola m68k running NetBSD TDEPFILES= m68k-tdep.o solib.o solib-svr4.o TM_FILE= tm-nbsd.h + + GDBSERVER_DEPFILES= low-nbsd.o Index: config/ns32k/nbsd.mt =================================================================== RCS file: /cvs/src/src/gdb/config/ns32k/nbsd.mt,v retrieving revision 1.3 diff -c -r1.3 nbsd.mt *** nbsd.mt 2000/11/09 22:57:02 1.3 --- nbsd.mt 2000/12/02 00:40:46 *************** *** 1,3 **** --- 1,5 ---- # Target: PC532 running NetBSD TDEPFILES= ns32k-tdep.o solib.o solib-svr4.o TM_FILE= tm-nbsd.h + + GDBSERVER_DEPFILES= low-nbsd.o Index: gdbserver/low-hppabsd.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/low-hppabsd.c,v retrieving revision 1.2 diff -c -r1.2 low-hppabsd.c *** low-hppabsd.c 2000/07/30 01:48:28 1.2 --- low-hppabsd.c 2000/12/02 00:40:46 *************** *** 33,61 **** #include /***************Begin MY defs*********************/ - int quit_flag = 0; static char my_registers[REGISTER_BYTES]; char *registers = my_registers; - - /* Index within `registers' of the first byte of the space for - register N. */ - - - char buf2[MAX_REGISTER_RAW_SIZE]; /***************End MY defs*********************/ #include #include - extern char **environ; extern int errno; extern int inferior_pid; ! void quit (), perror_with_name (); ! int query (); /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. ! ENV is the environment vector to pass. */ int create_inferior (char *program, char **allargs) --- 33,51 ---- #include /***************Begin MY defs*********************/ static char my_registers[REGISTER_BYTES]; char *registers = my_registers; /***************End MY defs*********************/ #include #include extern int errno; extern int inferior_pid; ! void perror_with_name (); /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. */ int create_inferior (char *program, char **allargs) Index: gdbserver/low-linux.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/low-linux.c,v retrieving revision 1.4 diff -c -r1.4 low-linux.c *** low-linux.c 2000/07/30 01:48:28 1.4 --- low-linux.c 2000/12/02 00:40:46 *************** *** 33,47 **** #include /***************Begin MY defs*********************/ - int quit_flag = 0; static char my_registers[REGISTER_BYTES]; char *registers = my_registers; - - /* Index within `registers' of the first byte of the space for - register N. */ - - - char buf2[MAX_REGISTER_RAW_SIZE]; /***************End MY defs*********************/ #ifdef HAVE_SYS_REG_H --- 33,40 ---- *************** *** 53,69 **** #define PTRACE_XFER_TYPE int #endif - extern char **environ; extern int errno; extern int inferior_pid; ! void quit (), perror_with_name (); ! int query (); static void initialize_arch (void); /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. ! ENV is the environment vector to pass. */ int create_inferior (char *program, char **allargs) --- 46,59 ---- #define PTRACE_XFER_TYPE int #endif extern int errno; extern int inferior_pid; ! void perror_with_name (); static void initialize_arch (void); /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. */ int create_inferior (char *program, char **allargs) Index: gdbserver/low-nbsd.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/low-nbsd.c,v retrieving revision 1.5 diff -c -r1.5 low-nbsd.c *** low-nbsd.c 2000/11/21 00:25:58 1.5 --- low-nbsd.c 2000/12/02 00:40:47 *************** *** 27,50 **** #include /***************Begin MY defs*********************/ - int quit_flag = 0; static char my_registers[REGISTER_BYTES]; char *registers = my_registers; - - /* Index within `registers' of the first byte of the space for - register N. */ - - char buf2[MAX_REGISTER_RAW_SIZE]; /***************End MY defs*********************/ #include #include ! extern int sys_nerr; // extern char **sys_errlist; - extern char **environ; extern int inferior_pid; ! void quit (), perror_with_name (); #define RF(dst, src) \ memcpy(®isters[REGISTER_BYTE(dst)], &src, sizeof(src)) --- 27,43 ---- #include /***************Begin MY defs*********************/ static char my_registers[REGISTER_BYTES]; char *registers = my_registers; /***************End MY defs*********************/ #include #include ! // extern int sys_nerr; // extern char **sys_errlist; extern int inferior_pid; ! void perror_with_name (); #define RF(dst, src) \ memcpy(®isters[REGISTER_BYTE(dst)], &src, sizeof(src)) *************** *** 106,111 **** --- 99,118 ---- } #endif /* !__i386__ */ + #ifdef __m68k__ + static void + initialize_arch (void) + { + } + #endif /* !__m68k__ */ + + #ifdef __ns32k__ + static void + initialize_arch (void) + { + } + #endif /* !__ns32k__ */ + #ifdef __powerpc__ #include "ppc-tdep.h" *************** *** 117,124 **** /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. ! ENV is the environment vector to pass. */ int create_inferior (char *program, char **allargs) --- 124,130 ---- /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. */ int create_inferior (char *program, char **allargs) *************** *** 312,317 **** --- 318,451 ---- (PTRACE_ARG3_TYPE) &inferior_fp_registers, 0); } #endif /* !__i386__ */ + + #ifdef __m68k__ + /* Fetch one or more registers from the inferior. REGNO == -1 to get + them all. We actually fetch more than requested, when convenient, + marking them as valid so we won't fetch them again. */ + + void + fetch_inferior_registers (int regno) + { + struct reg inferior_registers; + struct fpreg inferior_fp_registers; + + ptrace (PT_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_registers, 0); + memcpy (®isters[REGISTER_BYTE (0)], &inferior_registers, + sizeof (inferior_registers)); + + ptrace (PT_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); + memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, + sizeof (inferior_fp_registers)); + } + + /* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + + void + store_inferior_registers (int regno) + { + struct reg inferior_registers; + struct fpreg inferior_fp_registers; + + memcpy (&inferior_registers, ®isters[REGISTER_BYTE (0)], + sizeof (inferior_registers)); + ptrace (PT_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_registers, 0); + + memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], + sizeof (inferior_fp_registers)); + ptrace (PT_SETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); + } + #endif /* !__m68k__ */ + + + #ifdef __ns32k__ + /* Fetch one or more registers from the inferior. REGNO == -1 to get + them all. We actually fetch more than requested, when convenient, + marking them as valid so we won't fetch them again. */ + + void + fetch_inferior_registers (int regno) + { + struct reg inferior_registers; + struct fpreg inferior_fpregisters; + + ptrace (PT_GETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_registers, 0); + ptrace (PT_GETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0); + + RF (R0_REGNUM + 0, inferior_registers.r_r0); + RF (R0_REGNUM + 1, inferior_registers.r_r1); + RF (R0_REGNUM + 2, inferior_registers.r_r2); + RF (R0_REGNUM + 3, inferior_registers.r_r3); + RF (R0_REGNUM + 4, inferior_registers.r_r4); + RF (R0_REGNUM + 5, inferior_registers.r_r5); + RF (R0_REGNUM + 6, inferior_registers.r_r6); + RF (R0_REGNUM + 7, inferior_registers.r_r7); + + RF (SP_REGNUM, inferior_registers.r_sp); + RF (FP_REGNUM, inferior_registers.r_fp); + RF (PC_REGNUM, inferior_registers.r_pc); + RF (PS_REGNUM, inferior_registers.r_psr); + + RF (FPS_REGNUM, inferior_fpregisters.r_fsr); + RF (FP0_REGNUM + 0, inferior_fpregisters.r_freg[0]); + RF (FP0_REGNUM + 2, inferior_fpregisters.r_freg[2]); + RF (FP0_REGNUM + 4, inferior_fpregisters.r_freg[4]); + RF (FP0_REGNUM + 6, inferior_fpregisters.r_freg[6]); + RF (LP0_REGNUM + 1, inferior_fpregisters.r_freg[1]); + RF (LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]); + RF (LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]); + RF (LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]); + } + + /* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + + void + store_inferior_registers (int regno) + { + struct reg inferior_registers; + struct fpreg inferior_fpregisters; + + RS (R0_REGNUM + 0, inferior_registers.r_r0); + RS (R0_REGNUM + 1, inferior_registers.r_r1); + RS (R0_REGNUM + 2, inferior_registers.r_r2); + RS (R0_REGNUM + 3, inferior_registers.r_r3); + RS (R0_REGNUM + 4, inferior_registers.r_r4); + RS (R0_REGNUM + 5, inferior_registers.r_r5); + RS (R0_REGNUM + 6, inferior_registers.r_r6); + RS (R0_REGNUM + 7, inferior_registers.r_r7); + + RS (SP_REGNUM, inferior_registers.r_sp); + RS (FP_REGNUM, inferior_registers.r_fp); + RS (PC_REGNUM, inferior_registers.r_pc); + RS (PS_REGNUM, inferior_registers.r_psr); + + RS (FPS_REGNUM, inferior_fpregisters.r_fsr); + RS (FP0_REGNUM + 0, inferior_fpregisters.r_freg[0]); + RS (FP0_REGNUM + 2, inferior_fpregisters.r_freg[2]); + RS (FP0_REGNUM + 4, inferior_fpregisters.r_freg[4]); + RS (FP0_REGNUM + 6, inferior_fpregisters.r_freg[6]); + RS (LP0_REGNUM + 1, inferior_fpregisters.r_freg[1]); + RS (LP0_REGNUM + 3, inferior_fpregisters.r_freg[3]); + RS (LP0_REGNUM + 5, inferior_fpregisters.r_freg[5]); + RS (LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]); + + ptrace (PT_SETREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_registers, 0); + ptrace (PT_SETFPREGS, inferior_pid, + (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0); + + } + #endif /* !__ns32k__ */ #ifdef __powerpc__ /* Fetch one or more registers from the inferior. REGNO == -1 to get Index: gdbserver/low-sparc.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/low-sparc.c,v retrieving revision 1.2 diff -c -r1.2 low-sparc.c *** low-sparc.c 2000/07/30 01:48:28 1.2 --- low-sparc.c 2000/12/02 00:40:47 *************** *** 36,50 **** #include /***************Begin MY defs*********************/ - int quit_flag = 0; static char my_registers[REGISTER_BYTES]; char *registers = my_registers; - - /* Index within `registers' of the first byte of the space for - register N. */ - - - char buf2[MAX_REGISTER_RAW_SIZE]; /***************End MY defs*********************/ #include --- 36,43 ---- *************** *** 52,66 **** extern int sys_nerr; extern char **sys_errlist; - extern char **environ; extern int errno; extern int inferior_pid; ! void quit (), perror_with_name (); ! int query (); /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. ! ENV is the environment vector to pass. */ int create_inferior (char *program, char **allargs) --- 45,56 ---- extern int sys_nerr; extern char **sys_errlist; extern int errno; extern int inferior_pid; ! void perror_with_name (); /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. */ int create_inferior (char *program, char **allargs) Index: gdbserver/low-sun3.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/low-sun3.c,v retrieving revision 1.2 diff -c -r1.2 low-sun3.c *** low-sun3.c 2000/07/30 01:48:28 1.2 --- low-sun3.c 2000/12/02 00:40:47 *************** *** 33,47 **** #include /***************Begin MY defs*********************/ - int quit_flag = 0; static char my_registers[REGISTER_BYTES]; char *registers = my_registers; - - /* Index within `registers' of the first byte of the space for - register N. */ - - - char buf2[MAX_REGISTER_RAW_SIZE]; /***************End MY defs*********************/ #include --- 33,40 ---- *************** *** 49,63 **** extern int sys_nerr; extern char **sys_errlist; - extern char **environ; extern int errno; extern int inferior_pid; ! void quit (), perror_with_name (); ! int query (); /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. ! ENV is the environment vector to pass. */ int create_inferior (char *program, char **allargs) --- 42,53 ---- extern int sys_nerr; extern char **sys_errlist; extern int errno; extern int inferior_pid; ! void perror_with_name (); /* Start an inferior process and returns its pid. ! ALLARGS is a vector of program-name and args. */ int create_inferior (char *program, char **allargs) -- J.T. Conklin RedBack Networks From msnyder@redhat.com Fri Dec 01 17:49:00 2000 From: Michael Snyder To: Andrew Cagney Cc: GDB Patches Subject: Re: [rfc/rfa] multi-arch *_REG_TO_REGNUM() Date: Fri, 01 Dec 2000 17:49:00 -0000 Message-id: <3A285526.6E9F@redhat.com> References: <3A25F04A.DD2D108@cygnus.com> X-SW-Source: 2000-12/msg00019.html Content-length: 11286 Andrew Cagney wrote: > > Hello, > > The attatched multi-arches all the existing .*_REG_TO_REGNUM() macros. > In addition it adds a new DWARF2_REG_TO_REGNUM() (I know the s390 port > needs this) and documents the ones that were missing from > gdbint.texinfo. I think this is a great idea, and I hope you put it in ASAP, 'cause I need it for several ports I'm working on. ;-) > --------------------------------------------------------------- > Thu Nov 30 16:33:36 2000 Andrew Cagney > > * gdbarch.sh (STAB_REG_TO_REGNUM, ECOFF_REG_TO_REGNUM, > DWARF_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): > Add. > * gdbarch.h, gdbarch.c: Regenerate. > * arch-utils.c (no_op_reg_to_regnum): New function. > * arch-utils.h (no_op_reg_to_regnum): Declare. > > * dwarfread.c (DWARF_REG_TO_REGNUM), coffread.c > (SDB_REG_TO_REGNUM), stabsread.h (STAB_REG_TO_REGNUM), > mdebugread.c (ECOFF_REG_TO_REGNUM): Delete macro. > > * config/mips/tm-mips.h (ECOFF_REG_TO_REGNUM, STAB_REG_TO_REGNUM): > Delete. Moved to mips-tdep.c. > * mips-tdep.c (mips_ecoff_reg_to_regnum, mips_stab_reg_to_regnum): > New functions. > (mips_gdbarch_init): Add ``mips_ecoff_reg_to_regnum'' and > ``mips_stab_reg_to_regnum'' to multi-arch vector. > > Index: doc/ChangeLog > Thu Nov 30 16:57:19 2000 Andrew Cagney > > * gdbint.texinfo (ECOFF_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, > DWARF2_REG_TO_REGNUM): Document. > > Index: arch-utils.c > =================================================================== > RCS file: /cvs/src/src/gdb/arch-utils.c,v > retrieving revision 1.16 > diff -p -r1.16 arch-utils.c > *** arch-utils.c 2000/10/27 19:17:56 1.16 > --- arch-utils.c 2000/11/30 06:08:53 > *************** default_convert_from_func_ptr_addr (CORE > *** 233,238 **** > --- 233,244 ---- > return addr; > } > > + int > + no_op_reg_to_regnum (int reg) > + { > + return reg; > + } > + > /* Functions to manipulate the endianness of the target. */ > > #ifdef TARGET_BYTE_ORDER_SELECTABLE > Index: arch-utils.h > =================================================================== > RCS file: /cvs/src/src/gdb/arch-utils.h,v > retrieving revision 1.10 > diff -p -r1.10 arch-utils.h > *** arch-utils.h 2000/10/26 07:41:25 1.10 > --- arch-utils.h 2000/11/30 06:08:53 > *************** extern int default_register_sim_regno (i > *** 97,100 **** > --- 97,104 ---- > > extern CORE_ADDR default_convert_from_func_ptr_addr (CORE_ADDR addr); > > + /* No-op conversion of reg to regnum. */ > + > + extern int no_op_reg_to_regnum (int reg); > + > #endif > Index: coffread.c > =================================================================== > RCS file: /cvs/src/src/gdb/coffread.c,v > retrieving revision 1.12 > diff -p -r1.12 coffread.c > *** coffread.c 2000/10/24 21:13:08 1.12 > --- coffread.c 2000/11/30 06:09:04 > *************** struct coff_symfile_info > *** 68,81 **** > > #define SDB_TYPE(type) (BTYPE(type) | (type & N_TMASK)) > > - /* Convert from an sdb register number to an internal gdb register number. > - This should be defined in tm.h, if REGISTER_NAMES is not set up > - to map one to one onto the sdb register numbers. */ > - > - #ifndef SDB_REG_TO_REGNUM > - #define SDB_REG_TO_REGNUM(value) (value) > - #endif > - > /* Core address of start and end of text of current source file. > This comes from a ".text" symbol where x_nlinno > 0. */ > > --- 68,73 ---- > Index: dwarfread.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarfread.c,v > retrieving revision 1.3 > diff -p -r1.3 dwarfread.c > *** dwarfread.c 2000/07/30 01:48:25 1.3 > --- dwarfread.c 2000/11/30 06:09:09 > *************** typedef unsigned int DIE_REF; /* Referen > *** 189,199 **** > #define CHILL_PRODUCER "GNU Chill " > #endif > > - /* Provide a default mapping from a DWARF register number to a gdb REGNUM. */ > - #ifndef DWARF_REG_TO_REGNUM > - #define DWARF_REG_TO_REGNUM(num) (num) > - #endif > - > /* Flags to target_to_host() that tell whether or not the data object is > expected to be signed. Used, for example, when fetching a signed > integer in the target environment which is used as a signed integer > --- 189,194 ---- > Index: gdbarch.sh > =================================================================== > RCS file: /cvs/src/src/gdb/gdbarch.sh,v > retrieving revision 1.48 > diff -p -r1.48 gdbarch.sh > *** gdbarch.sh 2000/11/08 23:58:46 1.48 > --- gdbarch.sh 2000/11/30 06:09:23 > *************** v:2:PC_REGNUM:int:pc_regnum::::0:-1 > *** 371,376 **** > --- 371,387 ---- > v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0 > v:2:NPC_REGNUM:int:npc_regnum::::0:-1::0 > v:2:NNPC_REGNUM:int:nnpc_regnum::::0:-1::0 > + # Convert stab register number (from \`r\' declaration) to a gdb REGNUM. > + f:2:STAB_REG_TO_REGNUM:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0 > + # Provide a default mapping from a ecoff register number to a gdb REGNUM. > + f:2:ECOFF_REG_TO_REGNUM:int:ecoff_reg_to_regnum:int ecoff_regnr:ecoff_regnr:::no_op_reg_to_regnum::0 > + # Provide a default mapping from a DWARF register number to a gdb REGNUM. > + f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no_op_reg_to_regnum::0 > + # Convert from an sdb register number to an internal gdb register number. > + # This should be defined in tm.h, if REGISTER_NAMES is not set up > + # to map one to one onto the sdb register numbers. > + f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0 > + f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0 > f:2:REGISTER_NAME:char *:register_name:int regnr:regnr:::legacy_register_name::0 > v:2:REGISTER_SIZE:int:register_size::::0:-1 > v:2:REGISTER_BYTES:int:register_bytes::::0:-1 > Index: mdebugread.c > =================================================================== > RCS file: /cvs/src/src/gdb/mdebugread.c,v > retrieving revision 1.7 > diff -p -r1.7 mdebugread.c > *** mdebugread.c 2000/09/24 04:42:12 1.7 > --- mdebugread.c 2000/11/30 06:09:37 > *************** typedef struct mips_extra_func_info > *** 93,103 **** > > extern void _initialize_mdebugread (void); > > - /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */ > - #ifndef ECOFF_REG_TO_REGNUM > - #define ECOFF_REG_TO_REGNUM(num) (num) > - #endif > - > /* Provide a way to test if we have both ECOFF and ELF symbol tables. > We use this define in order to know whether we should override a > symbol's ECOFF section with its ELF section. This is necessary in > --- 93,98 ---- > Index: mips-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/mips-tdep.c,v > retrieving revision 1.34 > diff -p -r1.34 mips-tdep.c > *** mips-tdep.c 2000/10/30 21:50:57 1.34 > --- mips-tdep.c 2000/11/30 06:09:44 > *************** mips_saved_pc_after_call (struct frame_i > *** 3812,3817 **** > --- 3812,3840 ---- > } > > > + /* Convert a dbx stab register number (from `r' declaration) to a gdb > + REGNUM */ > + > + static int > + mips_stab_reg_to_regnum (int num) > + { > + if (num < 32) > + return num; > + else > + return num + FP0_REGNUM - 38; > + } > + > + /* Convert a ecoff register number to a gdb REGNUM */ > + > + static int > + mips_ecoff_reg_to_regnum (int num) > + { > + if (num < 32) > + return num; > + else > + return num + FP0_REGNUM - 32; > + } > + > static struct gdbarch * > mips_gdbarch_init (struct gdbarch_info info, > struct gdbarch_list *arches) > *************** mips_gdbarch_init (struct gdbarch_info i > *** 4052,4057 **** > --- 4075,4084 ---- > set_gdbarch_write_fp (gdbarch, generic_target_write_fp); > set_gdbarch_read_sp (gdbarch, generic_target_read_sp); > set_gdbarch_write_sp (gdbarch, generic_target_write_sp); > + > + /* Map debug register numbers onto internal register numbers. */ > + set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum); > + set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_ecoff_reg_to_regnum); > > /* Initialize a frame */ > set_gdbarch_init_extra_frame_info (gdbarch, mips_init_extra_frame_info); > Index: stabsread.h > =================================================================== > RCS file: /cvs/src/src/gdb/stabsread.h,v > retrieving revision 1.3 > diff -p -r1.3 stabsread.h > *** stabsread.h 2000/06/04 00:41:09 1.3 > --- stabsread.h 2000/11/30 06:09:46 > *************** > *** 30,41 **** > #define EXTERN extern > #endif > > - /* Convert stab register number (from `r' declaration) to a gdb REGNUM. */ > - > - #ifndef STAB_REG_TO_REGNUM > - #define STAB_REG_TO_REGNUM(VALUE) (VALUE) > - #endif > - > /* Hash table of global symbols whose values are not known yet. > They are chained thru the SYMBOL_VALUE_CHAIN, since we don't > have the correct data for that slot yet. > --- 30,35 ---- > Index: config/mips/tm-mips.h > =================================================================== > RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v > retrieving revision 1.15 > diff -p -r1.15 tm-mips.h > *** tm-mips.h 2000/10/27 15:02:42 1.15 > --- tm-mips.h 2000/11/30 06:09:49 > *************** extern void mips_print_extra_frame_info > *** 437,450 **** > #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) > extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); > > - /* Convert a dbx stab register number (from `r' declaration) to a gdb REGNUM */ > - > - #define STAB_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-38) > - > - /* Convert a ecoff register number to a gdb REGNUM */ > - > - #define ECOFF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32) > - > /* Select the default mips disassembler */ > > #define TM_PRINT_INSN_MACH 0 > --- 437,442 ---- > Index: doc/gdbint.texinfo > =================================================================== > RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v > retrieving revision 1.16 > diff -p -r1.16 gdbint.texinfo > *** gdbint.texinfo 2000/11/24 11:02:59 1.16 > --- gdbint.texinfo 2000/11/30 06:10:08 > *************** library in which breakpoints cannot be s > *** 1640,1645 **** > --- 1640,1657 ---- > @item DO_REGISTERS_INFO > If defined, use this to print the value of a register or all registers. > > + @item DWARF_REG_TO_REGNUM > + Convert DWARF register number into @value{GDBN} regnum. If not defined, > + no conversion will be performed. > + > + @item DWARF2_REG_TO_REGNUM > + Convert DWARF2 register number into @value{GDBN} regnum. If not > + defined, no conversion will be performed. > + > + @item ECOFF_REG_TO_REGNUM > + Convert ECOFF register number into @value{GDBN} regnum. If not defined, > + no conversion will be performed. > + > @item END_OF_TEXT_DEFAULT > This is an expression that should designate the end of the text section > (? FIXME ?) From eliz@is.elta.co.il Fri Dec 01 23:40:00 2000 From: "Eli Zaretskii" To: cgd@sibyte.com Cc: fnasser@cygnus.com, gdb-patches@sourceware.cygnus.com Subject: Re: [prelim patch] Add the notion of a global init file to gdb. Date: Fri, 01 Dec 2000 23:40:00 -0000 Message-id: <3405-Sat02Dec2000093926+0200-eliz@is.elta.co.il> References: <5tvgthgjlr.fsf@highland.sibyte.com> <3A1AE935.999A6344@cygnus.com> <5tlmu02h3c.fsf@highland.sibyte.com> X-SW-Source: 2000-12/msg00020.html Content-length: 518 > From: cgd@sibyte.com (Chris G. Demetriou) > Date: 01 Dec 2000 09:20:55 -0800 > > If you say -nx and it disables automatic inclusion, you can always > include it yourself (if you want/need it). > > On the other hand, if -nx _doesn't_ disable automatic inclusion, then > it may be insane to attempt to override the script (for users who > don't necessary have permission to remove it). Yes. So I think -nx should disable all sourced files. This is usually handy when debugging users' problems over email as well. From eliz@is.elta.co.il Sat Dec 02 00:10:00 2000 From: "Eli Zaretskii" To: fnasser@cygnus.com Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: Remove unused synchronous code Date: Sat, 02 Dec 2000 00:10:00 -0000 Message-id: <7263-Sat02Dec2000100947+0200-eliz@is.elta.co.il> References: <3A28185D.D114FFF4@cygnus.com> X-SW-Source: 2000-12/msg00021.html Content-length: 1562 > Date: Fri, 01 Dec 2000 16:30:05 -0500 > From: Fernando Nasser > > The new event loop has been the default since 1999-06-23. This is > almost 1 1/2 yrs. I don't think it's correct to measure time since the introduction of the feature into the CVS. I think we need to measure since the first official release which made it the default, since that's when the users really see it. Correct me if I'm wrong, but I think that GDB 5.0 was the first official release that used the event loop as the default. GDB 5.0 was released in May 2000, which is only 6 months ago. In addition, DJGPP users only got a precompiled binary a few weeks ago (my fault), so they only now begin using it en masse. I think that removing the fallback after a single release is a too short notice. I think we should keep it for at least one more version. Please keep in mind that the async code is modeled on Unix and GNU/Linux systems; other platforms are using emulations of `select' and related facilities, and the quality of those emulations might vary... > It happens that the provisions for fall-back (run synchronously) are > getting in the way, making the code illegible Perhaps we could discuss the specific problems with retaining the old code, and find interim solutions for them that won't require excessive labor. > and requiring > duplicate efforts (you should still make sure that the old way works > -- have you tested with --noasync after applying your patches?). Perhaps the test suite should be run with --noasync as well as without it? From kevinb@cygnus.com Sat Dec 02 01:05:00 2000 From: Kevin Buettner To: Jim Blandy , Elena Zannoni , gdb-patches@sources.redhat.com Cc: Richard Henderson Subject: [PATCH RFA] elfread.c: Fix dwarf2read.c related crash... Date: Sat, 02 Dec 2000 01:05:00 -0000 Message-id: <1001202090503.ZM15347@ocotillo.lan> X-SW-Source: 2000-12/msg00022.html Content-length: 4931 The patch below fixes a crash (actually, an internal error) that occurs when attempting to use gdb to debug certain programs created with current development versions of gcc/g++. For more information, see: http://sources.redhat.com/ml/gdb/2000-11/msg00285.html http://sources.redhat.com/ml/gdb/2000-11/msg00286.html http://sources.redhat.com/ml/gdb/2000-11/msg00287.html http://sources.redhat.com/ml/gdb/2000-11/msg00290.html http://sources.redhat.com/ml/gdb/2000-12/msg00000.html http://sources.redhat.com/ml/gdb/2000-12/msg00001.html In a nutshell, new_symbol() in dwarf2read.c is using fixup_symbol_section() to set the section index for the symbol that it's creating. The only problem is that it was setting it to -1 which was causing the ANOFFSET macro (on the lines following the call to fixup_symbol_section()) to generate an internal error. fixup_symbol_section() looks up the corresponding minimal symbol and uses the minsym's section index to set the index for the symbol needing "fixing up". In the case under consideration, the mimimal symbol *was* being found, but the section index was -1. The reason for this is that the symbol in question was in a data section (i.e, it wasn't code), but had the BSF_WEAK flag set. It turns out that this case was simply not being handled by the portion of the code in elf_symtab_read() which was responsible for computing the value of ms_type. The last one line change in my patch addresses this problem. (This change by itself is sufficient for fixing the current bug.) I've also substantially modified record_minimal_symbol_and_info() in order to prevent a symbol's section index from being set to -1 for some future "corner" case. In the past, the switch statement in this function was used to compute the section index based upon the value of ms_type. The resulting section index was one of either SECT_OFF_TEXT, SECT_OFF_DATA, or SECT_OFF_BSS. [Do ``cvs annotate -r1.4 elfread.c'' to see what it used to look like.] Earlier this year, the code was changed so that the section index for the interesting ms_type cases was computed by simply using bfd's index. However, the default case in which the section index was set to -1 was retained. My change smooshes all of these cases (including the default case) together so that we always use the bfd section index even for the "non-interesting" values of ms_type. (This change by itself is also sufficient for fixing the bug in question.) The other approach which could be taken here is to generate an internal error for the default case. I'm certainly willing to (re)consider this approach, but I would recommend to anyone wanting to suggest this that you first look at the means by which ms_type is computed in elf_symtab_read(). This code is truly scary and I have doubts about its overall correctness. (The comments in the code admit that gdb is basically guessing.) It seems to me that we can do better than rely on a guess; in this case doing better means simply relying on bfd for the section index. I've tested on linux/x86 with both dwarf2 and stabs and see no regressions. So... with the explanation out of the way, I ask for approval to commit the following changes: * elfread.c (record_minimal_symbol_and_info): Don't guess at the section index; instead just always use the bfd index. (elf_symtab_read): Handle weak symbols appearing in data sections. Index: elfread.c =================================================================== RCS file: /cvs/src/src/gdb/elfread.c,v retrieving revision 1.11 diff -u -p -r1.11 elfread.c --- elfread.c 2000/08/07 15:02:48 1.11 +++ elfread.c 2000/12/02 04:58:55 @@ -171,32 +171,13 @@ record_minimal_symbol_and_info (char *na enum minimal_symbol_type ms_type, char *info, /* FIXME, is this really char *? */ asection *bfd_section, struct objfile *objfile) { - int section; - - /* Guess the section from the type. This is likely to be wrong in - some cases. */ - switch (ms_type) - { - case mst_text: - case mst_file_text: - section = bfd_section->index; #ifdef SMASH_TEXT_ADDRESS - SMASH_TEXT_ADDRESS (address); + if (ms_type == mst_text || ms_type == mst_file_text) + SMASH_TEXT_ADDRESS (address); #endif - break; - case mst_data: - case mst_file_data: - case mst_bss: - case mst_file_bss: - section = bfd_section->index; - break; - default: - section = -1; - break; - } return prim_record_minimal_symbol_and_info - (name, address, ms_type, info, section, bfd_section, objfile); + (name, address, ms_type, info, bfd_section->index, bfd_section, objfile); } /* @@ -423,7 +404,7 @@ elf_symtab_read (struct objfile *objfile } else if (sym->section->flags & SEC_ALLOC) { - if (sym->flags & BSF_GLOBAL) + if (sym->flags & (BSF_GLOBAL | BSF_WEAK)) { if (sym->section->flags & SEC_LOAD) {