From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25028 invoked by alias); 29 Aug 2002 15:59:05 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25021 invoked from network); 29 Aug 2002 15:59:04 -0000 Received: from unknown (HELO valrhona.uglyboxes.com) (64.1.192.220) by sources.redhat.com with SMTP; 29 Aug 2002 15:59:04 -0000 Received: from localhost.localdomain (IDENT:BDeaKKVgs5oogOx8SVyIohE3v7zq6iAJ@localhost.localdomain [127.0.0.1]) by valrhona.uglyboxes.com (8.11.6/8.11.6) with ESMTP id g7TG1jI06757; Thu, 29 Aug 2002 09:01:45 -0700 Date: Thu, 29 Aug 2002 09:10:00 -0000 From: Keith Seitz X-X-Sender: keiths@valrhona.uglyboxes.com To: Elena Zannoni cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] stack.c: Always set current_source_{symtab,line} In-Reply-To: <15726.14171.621119.721148@localhost.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-08/txt/msg00983.txt.bz2 On Thu, 29 Aug 2002, Elena Zannoni wrote: > Seems an ok patch, but do you have an example command sequence > before/after that shows where things go wrong? I am having a bit of a > hard time visualizing the interaction. Sure. From the interpreter branch I've been using. [Sorry, I had the sequence wrong. The problem is with the "list" command, not "break". We had to do something similar in Insight, aka print_frame_info_listing_hook. If this patch gets approved, I can whack that hook (from Insight, at least).] (I've removed all the event notifications to facilitate reading) Without patch: $ ./gdb -nx -q -i=mi gdb (gdb) -break-insert main ^done (gdb) -exec-run ^running (gdb) *stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08075006",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff544"}],file="../../src/gdb/main.c",line="743"} (gdb) -break-insert catcher =breakpoint-create,number="2" ^done (gdb) -exec-continue ^running (gdb) *stopped,reason="breakpoint-hit",bkptno="2",thread-id="0",frame={addr="0x080fa8d9",func="catcher",args=[{name="func",value="0x80faad0 "},{name="func_uiout",value="0x829bb60"},{name="func_args",value="0xbffff4a8"},{name="func_val",value="0xbffff4b4"},{name="func_caught",value="0xbffff4b0"},{name="errstring",value="0x8226f20 \"\""},{name="mask",value="6"}],file="../../src/gdb/top.c",line="401"} (gdb) -interpreter-exec console "list" ~"734\t catch_errors (captured_command_loop, 0, \"\", RETURN_MASK_ALL);\n" ~"735\t }\n" ~"736\t /* No exit -- exit is through quit_command. */\n" ~"737\t}\n" ~"738\t\n" ~"739\tint\n" ~"740\tmain (int argc, char **argv)\n" ~"741\t{\n" ~"742\t struct captured_main_args args;\n" ~"743\t args.argc = argc;\n" ^done (gdb) Note that we stopped in catcher(), but when we asked the console for a "list", it returned main(). With patch: $ ./gdb -nx -q -i=mi gdb (gdb) -break-insert main ^done (gdb) -exec-run ^running (gdb) *stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08075006",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbfffe744"}],file="../../src/gdb/main.c",line="743"} (gdb) -break-insert catcher ^done (gdb) -exec-continue ^running (gdb) *stopped,reason="breakpoint-hit",bkptno="2",thread-id="0",frame={addr="0x080fa8e9",func="catcher",args=[{name="func",value="0x80faae0 "},{name="func_uiout",value="0x829bb80"},{name="func_args",value="0xbfffe6a8"},{name="func_val",value="0xbfffe6b4"},{name="func_caught",value="0xbfffe6b0"},{name="errstring",value="0x8226f40 \"\""},{name="mask",value="6"}],file="../../src/gdb/top.c",line="401"} (gdb) -interpreter-exec console list ~"401\t saved_error_pre_print = error_pre_print;\n" ~"402\t saved_quit_pre_print = quit_pre_print;\n" ~"403\t\n" ~"404\t if (mask & RETURN_MASK_ERROR)\n" ~"405\t error_pre_print = errstring;\n" ~"406\t if (mask & RETURN_MASK_QUIT)\n" ~"407\t quit_pre_print = errstring;\n" ~"408\t\n" ~"409\t /* Override the global ``struct ui_out'' builder. */\n" ~"410\t\n" ^done (gdb) Now we get the proper source listing from the console. Keith