This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
How to avoid "but contains no code." in command "info line"?
- From: qinwei<qinwei at sunnorth dot com dot cn>
- To: gdb at sourceware dot org
- Date: Fri, 23 Mar 2007 15:21:29 +0800
- Subject: How to avoid "but contains no code." in command "info line"?
Dears, problems are here:
In a assembly file 'a.s', we define two sections which have code both.
For example:
line1: .section mysection
line2: load r4, [r3]
line3: jump func
......
line6: .text
line7: store r4, [r3]
line8: jump func
......
"info line a.s:7" will print both the begin and end address of the line.
but "info line a.s:2" just print the begin address and "but contains no
code."
I trace the behavior of gdb (6.6 release) and find if the code is not in
.text,
then it will not be put to the 'blockvector structure' and finally the
branch in
gdb/source.c is taken. Does gdb have commands to let codes that in user
defined
sections tobe added to the 'blockvector structure' and "info line" will
print
both the begin & end address? Thanks!
if (start_pc == end_pc)
{
printf_filtered ("Line %d of \"%s\"",
sal.line, sal.symtab->filename);
wrap_here (" ");
printf_filtered (" is at address ");
print_address (start_pc, gdb_stdout);
wrap_here (" ");
printf_filtered (" but contains no code.\n");
}
Best regards,
Qinwei
Mail qinwei@sunnorth.com.cn
Phone +86-010-62981668-2708
Fax +86-010-62985972