From: wangjiong@sunnorth.com.cn
To: gdb@sourceware.org
Subject: mi_cmd_disassemble bug?
Date: Tue, 22 Jan 2008 06:40:00 -0000 [thread overview]
Message-ID: <OF042DA940.F7C0FC8E-ON482573D8.002257BC-482573D8.00249EF6@sunnorth.com.cn> (raw)
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
next reply other threads:[~2008-01-22 6:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-22 6:40 wangjiong [this message]
2008-01-22 7:09 ` Nick Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=OF042DA940.F7C0FC8E-ON482573D8.002257BC-482573D8.00249EF6@sunnorth.com.cn \
--to=wangjiong@sunnorth.com.cn \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox