Skip to content

Commit

Permalink
Use UNIX EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
djolertrk authored May 31, 2019
1 parent c42ae9c commit 9d47003
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
# gdb_tls (One solution for reading a value of a TLS variable from a core file generated on a target machine)
# One solution for reading a value of a TLS variable from a core file generated on a target machine

-Building the tool (Multiarch version):

mkdir build
cd build
~/$GDB_SRC/configure --enable-thread-access --enable-build-with-cxx=no --with-python --enable-targets=all
make

-Installing the tool:

mkdir INSTALL
make install DESTDIR= ~/$path_to_build/INSTALL

-Using the tool:
(NOTE: The version of the glibc on the host machine should match the glibc version of the target process being debugged. In the following example we built glibc 2.22, because the program being debugged from target machine (with MIPS arch) was built with glibc 2.22.). We are trying to print, by using Multiarch GNU GDB, the value of the TLS variable (declared as __thread int foo = 0xdeadbeef;) from a core file generated on a target machine.
(NOTE: The version of the glibc on the host machine should match the glibc version
of the target process being debugged. In the following example we built glibc 2.22,
because the program being debugged from target machine (with MIPS arch) was
built with glibc 2.22.. We are trying to print, by using Multiarch GNU GDB,
the value of the TLS variable (declared as __thread int foo = 0xdeadbeef;) from
a core file generated on a target machine.)


./gdb
...
Expand All @@ -21,12 +29,7 @@
(gdb) file exampleFromMipsPlatform
Reading symbols from exampleFromMipsPlatform...done.
(gdb) core-file core.mips
[New LWP 21808]
[New LWP 21813]
[New LWP 21810]
[New LWP 21809]
[New LWP 21811]
[New LWP 21812]
...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "~/path_to_the_glibc22_build/INSTALL/liblibthread_db.so.1".
Core was generated by `./exampleFromMipsPlatform'.
Expand Down

0 comments on commit 9d47003

Please sign in to comment.