Setting a breakpoint on a function name or on the first line of a function doesn't work for Sun C compiled target programs (32 and 64 bit). I verified this against these compiler versions: Sun C 5.5 2003/03/12 Forte Developer 7 C 5.4 2002/03/09 Sun WorkShop 6 update 2 C 5.3 2001/05/15 Sun WorkShop 6 2000/04/07 C 5.1 This is what happens: GNU gdb 20040614 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc-sun-solaris2.8"... (gdb) list 1,100 1 #include 2 3 void fun(void); 4 5 int 6 main() 7 { 8 fun(); 9 printf("line %d\n", __LINE__); 10 } 11 12 void 13 fun() 14 { 15 int n = 7; 16 17 printf("fun: n = %d\n", n); 18 } (gdb) b main Breakpoint 1 at 0x106cc: file p1.c, line 9. (gdb) run Starting program: /export/home/michaelm/gdb/gdb-6.1.patch/tst/p1 fun: n = 7 Breakpoint 1, main () at p1.c:9 9 printf("line %d\n", __LINE__); (gdb) # This is the second line in main!!! (gdb) b 8 Breakpoint 2 at 0x0: file p1.c, line 8. (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /export/home/michaelm/gdb/gdb-6.1.patch/tst/p1 Warning: Cannot insert breakpoint 2. Error accessing memory address 0x0: I/O error. The reason is that in process_one_symbol the first SLINE address is set to last_function_start which is 0 at that time. There are 2 problems (at least). 1) last_function_start is set = valu underneath case N_FNAME:, which is 0. Valu is then corrected after the following goto define_a_symbol;. Butlast_function_start remains 0. 2) After correcting that I found that this didn't work either and wasn't even necessary (see patch below). I don't know why this was done in the first place and how and for which version this worked. There is this comment: /* If this is the first SLINE note in the function, record it at the start of the function instead of at the listed location. */ Why was this done? 3) last_function_start is used in other places as well. Not sure if this now works correctly. Not sure how to test it. I tested my patch manually against the above compilers. 2004-05-16 Michael Mueller * dbxread.c: make breakpoint at function or first line of function work