From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17231 invoked by alias); 6 Aug 2011 22:29:05 -0000 Received: (qmail 17223 invoked by uid 22791); 6 Aug 2011 22:29:04 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,TW_RG X-Spam-Check-By: sourceware.org Received: from mail-pz0-f44.google.com (HELO mail-pz0-f44.google.com) (209.85.210.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 06 Aug 2011 22:28:49 +0000 Received: by pzk36 with SMTP id 36so47902pzk.3 for ; Sat, 06 Aug 2011 15:28:49 -0700 (PDT) Received: by 10.142.128.17 with SMTP id a17mr3559427wfd.92.1312669721697; Sat, 06 Aug 2011 15:28:41 -0700 (PDT) Received: from [10.172.73.11] (dip4-fw-nat.santamonica.corp.yahoo.com [67.72.118.219]) by mx.google.com with ESMTPS id g4sm4572024pbj.73.2011.08.06.15.28.39 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 06 Aug 2011 15:28:40 -0700 (PDT) Message-Id: <587BFD3C-0540-49FA-87F9-89CBBF2FF010@newplanetsoftware.com> From: John Lindal To: gdb-patches@sourceware.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Allow -data-disassemble to run with only -s option Date: Sat, 06 Aug 2011 22:29:00 -0000 Cc: gdb@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/msg00131.txt.bz2 Since the "disassemble" command only requires the function name, I figured it would be nice if -data-disassemble did not require the ending address. The attached patch makes the end address (-e option) optional. This is backward compatible, since all existing code that calls -data-disassemble passes both -s and -e. Sincerely, John Lindal New Planet Software http://www.newplanetsoftware.com/ twitter: newplanetsw ----- 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. ----- *** mi/mi-cmd-disas.c~ 2011-03-09 12:31:50.000000000 -0800 --- mi/mi-cmd-disas.c 2011-08-06 15:14:55.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,147 ---- 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) --- 149,159 ---- || (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)