Hi, I encountered a problem when trying CVS HEAD gdb with gcc-4.1, which has no .debug_ranges support. Below is the test case: $ cat main.c int main () { return 0; } extern void __attribute__ ((__section__ (".init.text"))) foo_init (void); void foo_init () { return; } $ cat foo.c int foo () { return 0; } $ gcc-4.1 -o test main.c foo.c -g CVS HEAD gdb cannot show the source line of foo. $ gdb test GNU gdb (GDB) 6.8.50.20081020-cvs [snip] (gdb) b foo Breakpoint 1 at 0x400458 while gdb-6.8 can $ gdb test GNU gdb 6.8 [snip] (gdb) b foo Breakpoint 1 at 0x400458: file foo.c, line 3. Since gcc-4.1 does not generate .debug_ranges, gdb tries to create addrmap from low_pc and high_pc. When creating mutable addrmap, the address range of main.c is treated as contiguous, e.g. [0x400448, 0x40053e], while foo.c is e.g. [0x400454, 0x40045f], which is embedded in the former. In current gdb, the value of the start and end transitions for foo.c are initialized as same as the value of the start one for main.c. Then later in addrmap_mutable_set_empty, those transitions are removed. This patch should fix this case. Is it OK? Regards, Jie