From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23645 invoked by alias); 8 Apr 2010 15:09:42 -0000 Received: (qmail 23629 invoked by uid 22791); 8 Apr 2010 15:09:39 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,TW_QC,TW_RQ,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-fx0-f227.google.com (HELO mail-fx0-f227.google.com) (209.85.220.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Apr 2010 15:09:29 +0000 Received: by fxm27 with SMTP id 27so540208fxm.8 for ; Thu, 08 Apr 2010 08:09:26 -0700 (PDT) Received: by 10.223.17.150 with SMTP id s22mr301633faa.14.1270739366544; Thu, 08 Apr 2010 08:09:26 -0700 (PDT) Received: from localhost.localdomain ([202.161.43.231]) by mx.google.com with ESMTPS id 14sm125089fxm.13.2010.04.08.08.09.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 08 Apr 2010 08:09:25 -0700 (PDT) From: crquan@gmail.com To: gdb-patches@sourceware.org Subject: [PATCH] disassemble support start,+length format Date: Thu, 08 Apr 2010 15:09:00 -0000 Message-Id: <1270739689-28732-1-git-send-email-crquan@gmail.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: 2010-04/txt/msg00176.txt.bz2 From: CHENG Renquan add new support for disassemble by "start,+length" format gdb/cli/cli-cmds.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) --- gdb/cli/cli-cmds.c.orig 2010-01-18 14:25:22.000000000 +0800 +++ gdb/cli/cli-cmds.c 2010-04-08 23:06:25.816107001 +0800 @@ -1045,8 +1045,9 @@ disassemble_current_function (int flags) - dump the assembly code for the function of the current pc disassemble [/mr] addr - dump the assembly code for the function at ADDR - disassemble [/mr] low high - - dump the assembly code in the range [LOW,HIGH) + disassemble [/mr] low,high + disassemble [/mr] low,+length + - dump the assembly code in the range [LOW,HIGH), or [LOW,LOW+length) A /m modifier will include source code with the assembly. A /r modifier will include raw instructions in hex with the assembly. */ @@ -1117,8 +1118,16 @@ disassemble_command (char *arg, int from else { /* Two arguments. */ + int incl_flag = 0; + low = pc; + if (arg[0] == '+') { + ++arg; + incl_flag = 1; + } high = parse_and_eval_address (arg); + if (incl_flag) + high += low; } print_disassembly (gdbarch, name, low, high, flags); @@ -1546,7 +1555,8 @@ Default is the function surrounding the With a /m modifier, source lines are included (if available).\n\ With a /r modifier, raw instructions in hex are included.\n\ With a single argument, the function surrounding that address is dumped.\n\ -Two arguments (separated by a comma) are taken as a range of memory to dump.")); +Two arguments (separated by a comma) are taken as a range of memory to dump,\n\ + in the form of \"start,end\", or \"start,+length\".")); set_cmd_completer (c, location_completer); if (xdb_commands) add_com_alias ("va", "disassemble", class_xdb, 0); -- git v1.7.0.4, rqcheng at smu edu sg