Loading dl-debug.c in gdb / Ubuntu 14.04.4 LTS - c++

When I use gdb xxx, while loading, this is the result:
dl-debug.c:74: No such file or directory.
dl-debug.c:74: No such file or directory.
dl-debug.c:74: No such file or directory.
dl-debug.c:74: No such file or directory.
dl-debug.c:74: No such file or directory.
lots of it, how can I solve it?
I've searched this in the internet, but all the answers are not the resolution.
Some might recommended that apt-get source glibc or apt-get install libc-source, but NO HELP.
I've tried to find /usr | grep dl-debug.c, but, this file is not on my Linux.
Any help?

I've solved this problem.
Firstly, use "apt-get install eglibc-source" to get the source file, while "glibc-source" is not a valid package.
Secondly, locate your source file .tar.xz (mine is in /usr/src), uncompressed it.
Finally, run gdb, and type "directory /usr/src/glibc-xxx(your location)/elf", and "dl-debug.c" is in this directory.
Also, adding "directory /usr/src/glibc-xxx(your location)/elf" in ~/.gdbinit might help u a lot.

It worked great! The file ~/.gdbinit didn't exist in my case. I create it with:
echo "directory /usr/src/glibc/eglibc-2.11.1/elf" >> ~/.gdbinit
Having done this I didn't had to type it in anymore. I tested it with gdb and gdb -tui.
Maybe this helps also for this bug:https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/571356
I am running on Ubuntu 3.13.0-66 with gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)

Related

I can't uninstall macports

I tried to uninstall following this guide: https://guide.macports.org/chunked/installing.macports.uninstalling.html#installing.macports.uninstalling.users
When I put in the last command lines in terminal it does not work and says:
zsh: no matches found: /Library/LaunchDaemons/org.macports.*
What's the issue here?
I opened /opt/local/bin and there's still files in there.
At the bottom of the page you will find the following note:
"Depending on which version of MacPorts you have and which ports you have installed, not all of the above paths will exist on your system; this is OK."
Apparently you do not have any files in that directory. Try removing /Library/LaunchDaemons/org.macports.* from the command.

Having problems with gdb [duplicate]

How can I include/view the source code of malloc in gdb?
I want to do a step by step execution in gdb, and step into malloc.c source code when any of the malloc functions is called.
Currently what gdb says is:
malloc.c: No such file or directory.
This guy here faced the same problem, but they do not mention a solution, ie how to actually step into the source code of malloc.
I am on Ubuntu server 14.04, and I have already tried to install the following:
libc6-dbg, libc6-dev, and libc6-dbgsym.
I don't even know if one of these packages might help, but installing the libc-dbgsym gives me the following error:
dpkg: error processing archive /var/cache/apt/archives/libc6-dbgsym_2.19-0ubuntu6.6_amd64.ddeb (--unpack): trying to overwrite
'/usr/lib/debug/usr/lib/x86_64-linux-gnu/audit/sotruss-lib.so', which
is also in package libc6-dbg:amd64 2.19-0ubuntu6.6 dpkg-deb: error:
subprocess paste was killed by signal (Broken pipe)
The following worked for me. Not sure whether there is a better way.
Install libc6-dbg (which you have already done):
sudo apt-get install libc6-dbg
Install the eglibc-source package (ubuntu actually uses eglibc): sudo apt-get install eglibc-source.
Unpack the tar file that was installed in /usr/src/glibc: /usr/src/glibc $ sudo tar xvf eglibc-2.19.tar.xz
Crank up gdb and add in the path to the malloc source: (gdb) dir /usr/src/glibc/eglibc-2.19/malloc
(gdb) n
13 char *c = malloc(100);
(gdb) s
__GI___libc_malloc (bytes=100) at malloc.c:2876 2876
{
(gdb)
Gdb can only show the source codes because the debug-compiled binaries contain references between the binary code and the source files.
malloc() is in the C library. On normal systems, it is not compiled with debug metadata, and its sources are also not installed in the system.
But they are reachable, you only need to install the debug versions of these libraries. For example, on debian an apt-get install glibc-debug or similar will do it. On SuSE, a zipper in libc6-debug (afaik, maybe the exact package names could be a little bit differ).

Running configure file in MinGW64: default build_alias command and default prefix not found

I'm using MinGW64 via an MSYS2 download and am currently trying to install the Solar Geometry 2 library (http://www.oie.mines-paristech.fr/Valorisation/Outils/Solar-Geometry/) for use. I'm following their install README, which states to navigate to the directory and "configure" (I've been typing "./configure". However, when I do so, I get the following message in my terminal:
$ ./configure
configure: loading site script /mingw64/etc/config.site
/mingw64/etc/config.site: line 13: config.site:13: default build_alias set to x6_64-w64-mingw32: command not found
/mingw64/etc/config.site: line 20: config.site:20: default prefix set to /mingw4: No such file or directory
configure: error: cannot find install-sh or install.sh in . ./.. ./../..
When I initially installed MSYS2 I set up the etc/fstab file as recommended. However, I'm quite new to MSYS so I'm assuming I botched something in my setup. I haven't edited anything in the config.site file mentioned in the errors, so I'm wondering if it's something in there.
Any help is greatly appreciated, thank you
No where in the directions for "Solar Geometry" do I see reference to MSys or MSys2.
I suggest you install the compiler toolchain and base development file. No idea if you editing /etc/fstab will cause problems. I do not normmaly edit it!
Install MinGW Package build packages. You might need more packages installed.
pacman -S --needed base-devel mingw-w64-x86_64-toolchain

omz_urlencode:42: -regex-match not available for regex

Okay so i'm trying to install Homebrew, so that I can I can install nodejs and npm. However I'm using this command from brew.sh;
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Once I install Homebrew It keeps returning this error
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md etc lib libexec Library LICENSE.txt README.md sbin share .git .github .gitignore
omz_urlencode:42: failed to load module `zsh/regex': dlopen(/usr/local/Cellar/zsh/5.2/lib/zsh/regex.so, 9): image not found
omz_urlencode:42: -regex-match not available for regex'
I honestly have no idea what's happening here. I'm not sure If I have to symlink Homebrew up or what. But I have tried everything I know so far (which isn't much). If anyone could be kind enough to give me instructions as what too look for to solve the issue, I'm all ears.
Thank you for listening!
It seems it's a bug that have been corrected in recent version of OMZ, you should update it.
You get the output:
zsh: command not found: homebrew
Because homebrew is not a command. Try brew -v instead.
To resolve:
Warning: node-5.10.1 already installed, it's just not linked
Use brew link node
Okay so I think I have made some progress, It may have been for some weird reason I didn't have permission writes to run the 'brew link < package > ' so i ran the following command:
'sudo chown -R /usr/local/share/systemtap/tapset && brew doctor'
Once I ran 'brew link node' it successfully created 7 symlinks for the node directory on the following path;
'Linking /usr/local/Cellar/node/5.10.1... 7 symlinks created'
However, when I installed live-server via npm; I typed 'live-server -v' and it again returned 'zsh: command not found: live-server'. In addition to this it keeps telling me I have 'unbrewed dylibs':
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libociei.dylib
So im still unsure what the exact issue is.
P.S. Apologies for not posting this correctly, as im trying to see where I can seperate it into commands like you corrected in the first post, if you could link me to a post where it tells me how to use it properly i'll be more than happy to read it.
Thanks,

Error when configuring gmp

hope this is just a very simple question. Ok, here's what I've done: I wanted to install gmp under my Linux Ubuntu 11.10. I have both g++ and gcc on my system. So I downloaded the latest release from the gmp official site (gmp 5.0.2), extracted it and then, since I need the c++ gmp interface, I simply run:
./configure --enable-cxx
But it keeps working for a while and then prints out:
checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).
Did I do something wrong? Thank you very much!
Matteo
try sudo apt-get install m4 and rerun the ./configure
I know this was from 7 years ago, but Im looking at installing gmp5.1.3 from source on an older system right now. I noted the "funny output" checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin 5bin hunh? I though it was a typo, and it probably is. On line 27285 of configure script, there is ac_dummy="$PATH:/usr/5bin"
that is a shell variable that the script then looks for and doesn't find. in the *nix default FHS, /usr/5bin doesn't exist.
the problem with ac_dummy="$PATH:/usr/5bin" is that the next few lines are a for loop searching the $PATH variable + /usr/5bin for m4.
on my system, /usr/sbin is where the m4 files are located, and is not part of the default $PATH variable.
Fixes:
you could modify your $PATH variable to include /usr/sbin.
you could modify the configure script to say ac_dummy="$PATH:/usr/sbin"
you could wait 7 years for someone to file a bug report.
depending on age and support of your OS, sudo apt-get install m4 could also work.
I have the same error, sudo apt-get install m4 solve this problem.