From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18360 invoked by alias); 22 Jan 2008 06:40:53 -0000 Received: (qmail 18347 invoked by uid 22791); 22 Jan 2008 06:40:53 -0000 X-Spam-Check-By: sourceware.org Received: from mail.sunnorth.com.cn (HELO bjmsw01.sunnorth.com.cn) (124.42.0.200) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 22 Jan 2008 06:40:33 +0000 Received: from maillog.sunnorth.com.cn (unverified [172.20.10.250]) by bjmsw01.sunnorth.com.cn (Clearswift SMTPRS 5.2.9) with ESMTP id for ; Tue, 22 Jan 2008 14:40:28 +0800 Received: from ntns1cn.sunnorth.com.cn (ntns1cn.sunnorth.com.cn [172.20.10.252]) by maillog.sunnorth.com.cn (8.12.10/8.12.10) with ESMTP id m0M6jPSK029320 for ; Tue, 22 Jan 2008 14:45:25 +0800 To: gdb@sourceware.org MIME-Version: 1.0 Subject: mi_cmd_disassemble bug? X-Mailer: Lotus Notes Release 6.5 September 26, 2003 Message-ID: From: wangjiong@sunnorth.com.cn Date: Tue, 22 Jan 2008 06:40:00 -0000 Content-Type: text/plain; charset="US-ASCII" Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00221.txt.bz2 Dear all: I have found that when Eclipse call gdb to disassemble the program from the appointed line in mixed source mode, there is some problem. For example, if the program stopped at line 140 in main, then the user want to see the disassembled codes mixed with C source codes, Eclipse will using the following command: xxx-data-disassemble -f example.c -l 140 -n 100 -- 1 then gdb will call function mi_cmd_disassemble which will always disassemble from the start address of the function which includes that line. But I think what Eclipse expect gdb to do is disassembling from where line 140 start instead of the start address of that function. So in GDB6.7 mi/mi-cmd-disas.c, in function mi_cmd_disassemble Should the folloing code be modified ? if (!find_line_pc (s, line_num, &start)) error (_("mi_cmd_disassemble: Invalid line number")); if (find_pc_partial_function (start, NULL, &low, &high) == 0) error (_("mi_cmd_disassemble: No function contains specified address")); } gdb_disassembly (uiout, file_string, line_num, mixed_source_and_assembly, how_many, low, high); Should it be? if (!find_line_pc (s, line_num, &start)) error (_("mi_cmd_disassemble: Invalid line number")); } gdb_disassembly (uiout, file_string, line_num, mixed_source_and_assembly, how_many, start, high); Wang Jiong tel:2254