Unable to debug ifconfig with Haiku debugger

Hi All,
I am trying to use the haiku debugger to do a step by step execution of the “ifconfig” executable.
However, I am unable to do so .

  1. When I start the debugger and pass the “ifconfig” command as argument, the debugger window opens and shows several prompts saying it could not find libstdc++.so.6.0.31.debuginfo , libgcc_s.so.1 , libcrypto.so.1.1 ,
  2. After I skip this, the main dialog box shows Source file unavailable and just shows assembly instructions.
    I have already put this line
    “SetConfigVar DEBUG : HAIKU_TOP src bin network ifconfig : 1 : global ;” inside Userbuildconfig.sample and ran the command “jam -q j8 @nightly-anyboot” inside the generated.x86_64 folder.
    Can anyone kindly help? Below are the screenshots attached.

UserBuildConfig.sample is a sample file. You need to create your own UserBuildConfig file next to it to put your customizations in. The sample is not used by anything,

Ok… Few more questions
1)how to build libstdc++ and others with debuginfo as it is saying those files are missing ?(Attached in screenshots)
2) Once I create a new file with name “UserBuildConfig”, just running “jam -q j8 @nightly-anyboot” should do or do I have to compile ifconfig individually and then create the anyboot image ?

The debugger offers you to install the debuginfo packages for the libraries. Just click the install button.

You can create the entire image and ifconfig in it should have debug infos. You can also build just ifconfig and run it directly, that should be faster than rebuilding everything everytime

But in the screenshots, I see no Install button. Only Locate and Skip options are there .

@PulkoMandy I created a UserBuildConfig file in the same location as UserBuildConfig.sample , put the debug statement in that file and ran the jam command to create the nightly image.
Still getting the same errors as above while running debugger .
“SetConfigVar DEBUG : HAIKU_TOP src bin network ifconfig : 1 : global ;” → this is the debug statement .
I am building the anyboot image in host machine and running haiku in VM .

The debugger is broken for me, too. When using the r1beta4 release, anything that upgrades to gcc 13 will render make the debugger fail. Upgrading the system to the latest nightly does not help.

FWIW, I run a reasonably current nightly with gcc-13.2.0 and if I build ifconfig with debugging as described above, I can launch it with debugger. No alerts to locate or skip anything. Clicking “Source path not available” the first time pops up a menu where I choose the correctly identified source file.

Maybe try a “pkgman full-sync” on a nightly? I dunno if that would help…

@humdinger the “source file unavailable” is a text in my case and not something I can click on .

@humdinger If the source code is in my host machine and haiku is running in VM, it will not be able to find the source code, is that correct ?

Thats correct.

Debugger should have been fixed for GCC 13 as of the last few months; it works fine for me on nightlies at this point. On beta3, the problem can be worked around by adding -gdwarf-3 to compile arguments after -g.

@humdinger after giving your command “pkgman full-sync”, it started giving me the install option and so the debuginfo file issue looks like sorted . Many many thanks for the help .

Coming to the 2nd problem , with the source file being unavailable inside haiku since I am running haiku in vm while building in host machine, how can I debug the source code line by line ?
I can scp the haiku codebase to the vm , inside which haiku is running but how to make the debugger refer to that source code ?
@extrowerk Any ideas on this ?

As far as i can remember the Debugger tries to automatically locate the sources on accessible BFS partitions and if it doesnt finds them then lets the user select the location.

You can do that with scp or simply clone the git repository inside haiku.

1 Like

Hi there; I like to work with the project checked-out on a linux host within an Intelli-J project. I can use the IDE there and check that my target builds. Once it is building on linux, I will transfer the source to a Haiku VM to re-build it and then debug + test. The Haiku VM has two disks. One disk has the operating system on it. The other disk is a “build” disc and has the Haiku source, build tools source and my generated_x86_64 directory. It also has some bash scripts I have written. The scripts use rsync to synchronize the source (sans git material) from the linux host over to the Haiku VM’s “build” disc. The script can either sync the whole lot or just parts of it. Synchronising just parts of it is faster of course.

By having the two disks, it makes it much easier to drop the operating system disk and re-build it if there is an issue.

The Debugger generally works well after the recent support for the new DWARF format was added. I have found that occasionally I have trouble getting it to find some source files but I have not tried to track the issue down.

@extrowerk @PulkoMandy I have been able to get the debugger working .Thanks for your help.
I have a few more questions.
To debug the ifconfig command line by line, I am attaching it to the team. Then I set a breakpoint in the teams window where the source code is displayed. Now , if I hit run button, execution reaches the breakpoint and it halts there. From there on, I want to execute step by step. So want to know what are the roles of the buttons Step Over, Step Into and Step Out in order to do that ?

Step into will execute the code line by line, and will al o enter into called functions and execute them line by line

Step over will execute the code line by line, but not enter into called functions, and step over them

Step out will run the code until the current function returns.

@humdinger. Thanks for your help. The “pkgman full-sync” solved all the linking issues .

You’re welcome. If you haven’'t already, there’s PDF DebuggerReferenceManual that explains more details of working with Debugger.

We probably should host that on-site… @anevilyak, is that your dropbox? OK to put it in the Documents section of this site?