From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5647 invoked by alias); 9 Aug 2011 01:00:56 -0000 Received: (qmail 5633 invoked by uid 22791); 9 Aug 2011 01:00:55 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f178.google.com (HELO mail-iy0-f178.google.com) (209.85.210.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Aug 2011 01:00:35 +0000 Received: by iym5 with SMTP id 5so8970204iym.23 for ; Mon, 08 Aug 2011 18:00:35 -0700 (PDT) Received: by 10.42.147.134 with SMTP id n6mr6486861icv.19.1312851635195; Mon, 08 Aug 2011 18:00:35 -0700 (PDT) Received: from listalthough-lm.burbank.corp.yahoo.com (fw-dip4.burbank.corp.yahoo.com [209.131.61.1]) by mx.google.com with ESMTPS id b6sm4604105ibg.48.2011.08.08.18.00.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Aug 2011 18:00:34 -0700 (PDT) Message-Id: <3DBE6912-1DE6-4B8B-8353-96855B07268E@newplanetsoftware.com> From: John Lindal To: gdb-patches@sourceware.org In-Reply-To: Content-Type: multipart/mixed; boundary=Apple-Mail-19--463017043 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Allow -data-disassemble to run with only -s option Date: Tue, 09 Aug 2011 01:00:00 -0000 References: <587BFD3C-0540-49FA-87F9-89CBBF2FF010@newplanetsoftware.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-08/txt/msg00166.txt.bz2 --Apple-Mail-19--463017043 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Content-length: 296 > This patch needs a documentation update. Attached are the updated patches, which hopefully won't get mangled in MIME format. > A test case would be nice. Without the patch, you have to specify both -s and -e. With the patch, you can do this: -data-disassemble -s main Thanks, John --Apple-Mail-19--463017043 Content-Disposition: attachment; filename=ChangeLog Content-Type: application/octet-stream; x-unix-mode=0644; name="ChangeLog" Content-Transfer-Encoding: 7bit Content-length: 198 2011-08-06 John Lindal * mi-cmd-disas.c: Accept only -s option. Automatically set end to end of function, or complain that start address is not part of any function. --Apple-Mail-19--463017043 Content-Disposition: attachment; filename=patch Content-Type: application/octet-stream; x-unix-mode=0644; name="patch" Content-Transfer-Encoding: 7bit Content-length: 2165 *** gdb-7.3-orig/gdb/mi/mi-cmd-disas.c 2011-03-09 12:31:50.000000000 -0800 --- gdb-7.3/gdb/mi/mi-cmd-disas.c 2011-08-08 15:18:49.000000000 -0700 *************** *** 37,42 **** --- 37,47 ---- or: + START-ADDRESS: address to start the disassembly at. + (END-ADDRESS is the end of the function.) + + or: + FILENAME: The name of the file where we want disassemble from. LINE: The line around which we want to disassemble. It will disassemble the function that contins that line. *************** mi_cmd_disassemble (char *command, char *** 127,132 **** --- 132,148 ---- argv += optind; argc -= optind; + if (!line_seen && !file_seen && !num_seen && start_seen && !end_seen) + { + char *ignore_name; + CORE_ADDR ignore_low; + + if (find_pc_partial_function (low, &ignore_name, &ignore_low, &high) == 0) + error (_("No function contains specified address")); + + end_seen = 1; + } + /* Allow only filename + linenum (with how_many which is not required) OR start_addr + and_addr */ *************** mi_cmd_disassemble (char *command, char *** 134,144 **** || (line_seen && file_seen && !num_seen && !start_seen && !end_seen) || (!line_seen && !file_seen && !num_seen && start_seen && end_seen))) error (_("-data-disassemble: Usage: ( [-f filename -l linenum [-n " ! "howmany]] | [-s startaddr -e endaddr]) [--] mode.")); if (argc != 1) error (_("-data-disassemble: Usage: [-f filename -l linenum " ! "[-n howmany]] [-s startaddr -e endaddr] [--] mode.")); mode = atoi (argv[0]); if (mode < 0 || mode > 3) --- 150,160 ---- || (line_seen && file_seen && !num_seen && !start_seen && !end_seen) || (!line_seen && !file_seen && !num_seen && start_seen && end_seen))) error (_("-data-disassemble: Usage: ( [-f filename -l linenum [-n " ! "howmany]] | [-s startaddr [-e endaddr]]) [--] mode.")); if (argc != 1) error (_("-data-disassemble: Usage: [-f filename -l linenum " ! "[-n howmany]] [-s startaddr [-e endaddr]] [--] mode.")); mode = atoi (argv[0]); if (mode < 0 || mode > 3) --Apple-Mail-19--463017043 Content-Disposition: attachment; filename=patch_doc Content-Type: application/octet-stream; x-unix-mode=0644; name="patch_doc" Content-Transfer-Encoding: 7bit Content-length: 1185 *** doc/gdb.texinfo-orig 2011-08-08 17:51:19.000000000 -0700 --- doc/gdb.texinfo 2011-08-08 17:55:37.000000000 -0700 *************** examine memory and registers, evaluate e *** 28271,28277 **** @smallexample -data-disassemble ! [ -s @var{start-addr} -e @var{end-addr} ] | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ] -- @var{mode} @end smallexample --- 28271,28277 ---- @smallexample -data-disassemble ! [ -s @var{start-addr} [ -e @var{end-addr} ] ] | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ] -- @var{mode} @end smallexample *************** Where: *** 28283,28289 **** @item @var{start-addr} is the beginning address (or @code{$pc}) @item @var{end-addr} ! is the end address @item @var{filename} is the name of the file to disassemble @item @var{linenum} --- 28283,28289 ---- @item @var{start-addr} is the beginning address (or @code{$pc}) @item @var{end-addr} ! is the end address. If only @var{start-addr} is specified, then @var{end-addr} is set to the end of the function containing @var{start-addr}. @item @var{filename} is the name of the file to disassemble @item @var{linenum} --Apple-Mail-19--463017043--