Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to be able to run hp-systray from gdb to get a stacktrace and help fix a very annoying bug that's been around for a while now. However, if I try to run

gdb hp-systray 2>&1 | tee ~/gdb-hp-systray.txt

as per the Ubuntu Wiki's article on getting a backtrace, I get the following output:

GNU gdb (Ubuntu/Linaro 7.4-0ubuntu1) 7.4
Copyright (C) 2012 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-linux-gnu".
For bug reporting instructions, please see:
"/usr/bin/hp-systray": not in executable format: File format not recognized

Furthermore, using gdb's run command returns the following:

(gdb) run
Starting program:  
No executable file specified.
Use the "file" or "exec-file" command.

Running hp-systray on its own in the terminal works as expected, so how can I get it to run from gdb?

share|improve this question
up vote 1 down vote accepted

hp-systray is a python script, so try:

$ gdb --args python /usr/bin/hp-systray
share|improve this answer
Thanks much! I also added on the 2>&1 | tee ~/gdb-hp-systray.txt bit from above and it still worked perfectly fine. – Christopher Kyle Horton Mar 6 '12 at 9:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.