From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2719 invoked by alias); 10 Sep 2006 14:49:45 -0000 Received: (qmail 2711 invoked by uid 22791); 10 Sep 2006 14:49:44 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sun, 10 Sep 2006 14:49:42 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GMQco-0007au-W1; Sun, 10 Sep 2006 10:49:35 -0400 Date: Sun, 10 Sep 2006 14:49:00 -0000 From: Daniel Jacobowitz To: "Zarges, Olav" , "gdb@sourceware.org" Subject: Re: gdb-6.5 produces infinite backtrace on ARM Message-ID: <20060910144934.GB28131@nevyn.them.org> Mail-Followup-To: "Zarges, Olav" , "gdb@sourceware.org" References: <44E181DE.7040905@imc-berlin.de> <20060815124053.GA18496@nevyn.them.org> <20060819052434.GA15612@nevyn.them.org> <44E999B4.5030905@imc-berlin.de> <20060821124241.GA16416@nevyn.them.org> <44FECDF7.2050900@imc-berlin.de> <20060906144356.GA2786@nevyn.them.org> <44FEE32E.60401@imc-berlin.de> <20060906151915.GA4002@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060906151915.GA4002@nevyn.them.org> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00058.txt.bz2 On Wed, Sep 06, 2006 at 11:19:15AM -0400, Daniel Jacobowitz wrote: > On Wed, Sep 06, 2006 at 05:03:10PM +0200, Zarges, Olav wrote: > > > > Daniel Jacobowitz wrote: > > > The error should be caught in backtrace_command now. The finished > > > output should still be printed. > > > > Eclipse seems to read the stack via gdb/mi commands stack-info-depth > > and stack-list-frames and that was what I was referring to (sorry). > > Please see log below. I tried to print the message with warning(...) > > and return NULL instead of calling error(...) which seems to work but > > I don't know about the side-effects this might involve. > > Oh, I see. Interesting. We'll see what we can do about this; that > does make more sense. Hi Olav, Does this patch work for you? I am not sure if it is the right solution or not - it's careless about discarding errors - but I want to make sure it works for you also before I start any discussion on that. -- Daniel Jacobowitz CodeSourcery Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.840 diff -u -p -r1.840 Makefile.in --- Makefile.in 22 Aug 2006 19:08:31 -0000 1.840 +++ Makefile.in 10 Sep 2006 14:48:01 -0000 @@ -3067,7 +3067,7 @@ mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmds.c mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \ $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(block_h) \ - $(stack_h) $(dictionary_h) $(gdb_string_h) + $(stack_h) $(dictionary_h) $(exceptions_h) $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) Index: mi/mi-cmd-stack.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmd-stack.c,v retrieving revision 1.30 diff -u -p -r1.30 mi-cmd-stack.c --- mi/mi-cmd-stack.c 7 Sep 2006 16:40:18 -0000 1.30 +++ mi/mi-cmd-stack.c 10 Sep 2006 14:48:01 -0000 @@ -29,6 +29,7 @@ #include "block.h" #include "stack.h" #include "dictionary.h" +#include "exceptions.h" #include "gdb_string.h" static void list_args_or_locals (int locals, int values, struct frame_info *fi); @@ -46,6 +47,7 @@ mi_cmd_stack_list_frames (char *command, int i; struct cleanup *cleanup_stack; struct frame_info *fi; + volatile struct gdb_exception e; if (argc > 2 || argc == 1) error (_("mi_cmd_stack_list_frames: Usage: [FRAME_LOW FRAME_HIGH]")); @@ -75,16 +77,23 @@ mi_cmd_stack_list_frames (char *command, cleanup_stack = make_cleanup_ui_out_list_begin_end (uiout, "stack"); - /* Now let;s print the frames up to frame_high, or until there are - frames in the stack. */ + /* Now let's print the frames up to frame_high, or until there are + no more frames in the stack. */ for (; fi && (i <= frame_high || frame_high == -1); - i++, fi = get_prev_frame (fi)) + i++) { QUIT; /* Print the location and the address always, even for level 0. args == 0: don't print the arguments. */ print_frame_info (fi, 1, LOC_AND_ADDRESS, 0 /* args */ ); + + TRY_CATCH (e, RETURN_MASK_ERROR) + { + fi = get_prev_frame (fi); + } + if (e.reason == RETURN_ERROR) + break; } do_cleanups (cleanup_stack); @@ -98,6 +107,7 @@ mi_cmd_stack_info_depth (char *command, int frame_high; int i; struct frame_info *fi; + volatile struct gdb_exception e; if (argc > 1) error (_("mi_cmd_stack_info_depth: Usage: [MAX_DEPTH]")); @@ -111,8 +121,16 @@ mi_cmd_stack_info_depth (char *command, for (i = 0, fi = get_current_frame (); fi && (i < frame_high || frame_high == -1); - i++, fi = get_prev_frame (fi)) - QUIT; + i++) + { + QUIT; + TRY_CATCH (e, RETURN_MASK_ERROR) + { + fi = get_prev_frame (fi); + } + if (e.reason == RETURN_ERROR) + break; + } ui_out_field_int (uiout, "depth", i); @@ -161,6 +179,7 @@ mi_cmd_stack_list_args (char *command, c int i; struct frame_info *fi; struct cleanup *cleanup_stack_args; + volatile struct gdb_exception e; if (argc < 1 || argc > 3 || argc == 2) error (_("mi_cmd_stack_list_args: Usage: PRINT_VALUES [FRAME_LOW FRAME_HIGH]")); @@ -194,7 +213,7 @@ mi_cmd_stack_list_args (char *command, c frames in the stack. */ for (; fi && (i <= frame_high || frame_high == -1); - i++, fi = get_prev_frame (fi)) + i++) { struct cleanup *cleanup_frame; QUIT; @@ -202,6 +221,13 @@ mi_cmd_stack_list_args (char *command, c ui_out_field_int (uiout, "level", i); list_args_or_locals (0, atoi (argv[0]), fi); do_cleanups (cleanup_frame); + + TRY_CATCH (e, RETURN_MASK_ERROR) + { + fi = get_prev_frame (fi); + } + if (e.reason == RETURN_ERROR) + break; } do_cleanups (cleanup_stack_args);