Hi folks, When you 'rbreak' a pattern that matches certain symbols (e.g., those containing "@plt"), you will get a "Junk at end of arguments" error when applying the breakpoints. For instance, given the example program: #include int foo() { return 37; } int main() { printf("%d\n", foo()); } compiled with gcc -g and run under a clean build of gdb as of last night (on a 'clean' CentOS 5 system, as well as an modded Debian-derivative system): [cgd@blue tmp]$ gdb/bld.clean/gdb/gdb a.out GNU gdb 6.8.50.20080315-cvs Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu"... (gdb) rbreak printf Function "printf" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (printf@plt) pending. printf@plt; (gdb) run Starting program: /tmp/a.out Error in re-setting breakpoint 1: Junk at end of arguments. 37 Program exited with code 03. (gdb) Note the pending breakpoint query, the error setting the breakpoint, and the fact that the breakpoint wasn't hit. What seems to be happening is that when setting the breakpoint, breakpoint_re_set_one is called. This calls decode_line_1 which in turn calls skip_quoted, which ultimately leaves "@plt" as something to be left over after stopping the symbol name at "printf". (My analysis may be a bit off, I actually debugged this using an optimized gdb binary, stupid me.) The attached patch fixes this by quoting the symbol name. (The symbol name is actually quoted in one case in rbreak_command already, this gets the other.) With the patch, as expected: [cgd@blue tmp]$ gdb/bld.dirty/gdb/gdb a.out GNU gdb 6.8.50.20080315-cvs Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu"... (gdb) rbreak printf Breakpoint 1 at 0x400398 printf@plt; (gdb) run Starting program: /tmp/a.out Breakpoint 1, 0x0000000000400398 in printf@plt () (gdb) No pending breakpoint query, no breakpoint-setting error, and breakpoint is hit as expected. (FWIW, i originally tripped over this on a symbol other than printf. That was just something easy for the example. And, others out in the world have seen this too, e.g., http://community.livejournal.com/evan_tech .) Tested manually as shown above, plus by running gdb 'make check' before/after symtab.c patch. Only change is that the new test goes from FAIL to PASS. If this patch is acceptable, please apply it. (I don't have write access.) chris --- [gdb/ChangeLog] 2008-03-15 Chris Demetriou * symtab.c (rbreak_command): Quote symbol name before passing it to break_command. [gdb/testsuite/ChangeLog] 2008-03-15 Chris Demetriou * gdb.base/break.exp (rbreak junk): New test for rbreak "Junk at end of arguments" issue.