Bug 13707 - "/usr/bin/localc": not in executable format: File format not recognized
Summary: "/usr/bin/localc": not in executable format: File format not recognized
Status: RESOLVED DUPLICATE of bug 12208
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.4
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-18 00:58 UTC by Christopher M. Penalver
Modified: 2023-12-31 13:32 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher M. Penalver 2012-02-18 00:58:56 UTC
Downstream bug may be found at:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/871940

1) lsb_release -rd
Description: Ubuntu precise (development branch)
Release: 12.04

2) apt-cache policy gdb
gdb:
  Installed: 7.4-0ubuntu1
  Candidate: 7.4-0ubuntu1
  Version table:
 *** 7.4-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status

apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.5.0~beta2-2ubuntu4
  Candidate: 1:3.5.0~beta2-2ubuntu4
  Version table:
 *** 1:3.5.0~beta2-2ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status

3) What is expected to happen at the Terminal:

gdb localc 2>&1 | tee gdb-libreoffice.txt

is LibreOffice Calc opens via gdb for debugging purposes.

4) What happens instead is Calc is not launched with the following shown in the Terminal:

 GNU gdb (Ubuntu/Linaro 7.4-0ubuntu1) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
"/usr/bin/localc": not in executable format: File format not recognized
(gdb)

WORKAROUND: Attach to the process ID via the Terminal:

sudo gdb localc 21015 2>&1 | tee gdb-libreoffice.txt
Comment 1 Tom Tromey 2012-02-21 18:20:42 UTC
I don't have an Ubuntu install, but at least on Fedora,
/usr/bin/oocalc is a shell script.
What does "file /usr/bin/localc" say?
Comment 2 Jan Kratochvil 2012-02-23 10:06:23 UTC
GDB could automatically do:
  gdb --args /bin/sh -c /usr/bin/oocalc
Comment 3 Tom Tromey 2012-02-23 15:10:24 UTC
(In reply to comment #2)
> GDB could automatically do:
>   gdb --args /bin/sh -c /usr/bin/oocalc

Yeah, I have thought about that for the future, maybe as 
part of switching over to multi-inferior-by-default or something.
This would be useful for the situation where libtool makes a
shell script for you instead of a real executable...
However, an additional feature would be needed as well, because
the above won't work as expected if you want to pass your own
arguments to the inferior.
Comment 4 Christopher M. Penalver 2012-02-24 23:48:16 UTC
file /usr/bin/localc
/usr/bin/localc: POSIX shell script text executable
Comment 5 Tom Tromey 2012-02-27 19:35:05 UTC
Ok, this isn't a bug.
gdb doesn't know about shell scripts.
I don't really think we're serious in comment #2 and comment #3;
but if someone thinks otherwise they can reopen this and turn
it into a feature request with the appropriate synopsis.
Comment 6 Christopher M. Penalver 2012-02-27 22:34:16 UTC
I did not know if this was a bug or enhancement. Since this is not a bug, this is an enhancement request.
Comment 7 Hannes Domani 2023-12-31 13:32:29 UTC
Dup.

*** This bug has been marked as a duplicate of bug 12208 ***