Some build systems (e.g. mozilla firefox) provides build of source code with only full path to files (i.e. pass to gcc full path to file). Sometimes it's difficult to change build (especially if it's huge project). If you debug compiled program you may see full path in backtraces, like this: (gdb) backtrace #0 main (argc=4, argv=0xbffff884) at /media/25b7639d-9a70-42ca-aaa7-28f4d1f417fd/firefox-dev/mozilla-central/browser/app/nsBrowserApp.cpp:204 I'm uncomfortable to read such backtraces. I've implemented the new feature (patch for gdb-7.2 release from "02-Sep-2010 20:12"): New argument for "backtrace" called "nopath". If you run "backtrace nopath" you will see something like this: (gdb) backtrace nopath #0 main (argc=4, argv=0xbffff884) at nsBrowserApp.cpp:204 (instead above result) "nopath" argument just cuts full path to file and remains only filename. If you think that this feature is useful for somebody you can see ChangeLog and patch in attachment. If it's useful feature but i made some mistakes (e.g. made ugly names) i will change it if you want. P.S. Sorry for my poor english. ChangeLog: 2011-06-26 Eldar Gaynetdinov : * stack.c (backtrace_command): Created new variable "nofull_path" for implementation of "backtrace nopath" command. It has similar logic as "fulltrace_arg" for "backtrace full" command. (backtrace_full_command): nofull_path is just zero (i.e. it's not used there). (backtrace_command_stub): just pass new argument ("args->nofull_path") to backtrace_command_1 (backtrace_command_1): if "nofull_path" is enabled (by "backtrace nopath") then call print_frame_info with LOC_NO_FULLPATH. (print_frame_info): work with LOC_NO_FULLPATH same as LOCATION (because it's almost same thing). (print_frame): if LOC_NO_FULLPATH was passed then cut fullpath (if exist) and remain only filename. * frame.h (enum print_what): Added LOC_NO_FULLPATH with comment.