How to run a Linux program line by line

I would like to run the GTK + / C program line by line with some debugger. I have never debugged a Linux program, so where can I find instructions for a beginner on how to debug code? I have only the idea that I should download sources from the network, compile the project using debugging symbols and run the sources via DDD or GDB. So can anyone give suggestions on how to start learning these subjects and what can be a good debugger to get started? I have at least time to learn something.

+3
source share
3 answers

Also look at nemiver besides DDD, they are good at different things, but nemiver is going very well.

PS. If you are running Ubuntu and want to navigate through the application installed from the package repository, call it some_package, and then do the following:

  • install the build-essential and devscripts packages
  • run "sudo apt-get build-dep some_package" to install everything you need to compile this package.
  • run "mkdir -p ~ / src / some_package; cd ~ / src / some_package" to create a directory for the source code
  • Go to System :: Administration :: Software Sources and activate the Source Code repository
  • run "apt-get source some_package" to download the source code for some_package and put it in the current directory
  • "cd" , - "some-app-1.2.3"

7A. "debuild -us -uc -b", .DEB,

( ):

7. run "MAKEFLAGS = -j6 DEB_BUILD_OPTIONS =" nostrip noopt parallel = 5 "CFLAGS =" - g3 -O0 "debuild -us -uc" deb WITH debug information

  1. "cd..", , "ls", DEB ( , .. DEB, ).
  2. sudo "sudo dpkg -i some_package_123.deb"

, 6 7. , . Firefox, Linux, mesa - .

+2
+1
+1
source

Source: https://habr.com/ru/post/1719025/


All Articles