Remix.run Logo
t_mahmood 5 days ago

Maybe someone can give me idea, how can I debug this particular rust app, which is extremely annoying. It's a one of Rustdesk.

It won't run if I compile with debug info. I think it's due to a 3rd party proprietary library. So, to run the app I have to use release profile, with debug info stripped.

So, when I fire up gdb, I can't see any function information or anything, and it has so many system calls it's really difficult to follow through blindly.

So, what is the best way to handle this?

yrand 5 days ago | parent | next [-]

I'd investigate why it won't run with debug info in the first place. That feels like the core problem here, because it prevents you from using some debug tools.

Of course that may require digging down pretty low, which is difficult in itself.

Edit: also there's split-debuginfo which puts debug info in separate file. It could help if the reason you can't run it is the debug info itself. Which feels unlikely, but :shrug:.

t_mahmood 4 days ago | parent [-]

I tried to generate split-debuginfo, and it created another compiler issue in another library, haha, and I was too tired to dig more into it.

Curious if it's possible could it be because of protobuf implementation, which is used between UI and the server, and my error is occurring on the UI side.

So, after reading a bit, this is what I find

>Deterministic serialization is not canonical. The serializer can generate different output for many reasons, including but not limited to the following variations:

> The binary is built with different flags (eg. opt vs. debug).

My knowledge on this is pretty limited, so I could be wrong. But, this could be a reason. Maybe someone more knowledgeable on this matter can shade some lights. And I should've studied more on this before ... heh.

tomjakubowski 5 days ago | parent | prev | next [-]

You can add debug info to release builds. In Cargo.toml:

    [profile.release]
    debug = true
https://doc.rust-lang.org/cargo/reference/profiles.html#debu...
t_mahmood 4 days ago | parent [-]

Yes, tried that, but it still failed.

mrugge 5 days ago | parent | prev [-]

claude code cli

yrand 5 days ago | parent [-]

Could you expand on what you meant? I'm curious.

Not related to OP, but debugging is often about finding where an invariant is broken, so it feels like using LLM to navigate a debugging loop may be useful as it's not a complicated but repetitive task. However in the morning I struggle to imagine how to do that.

mrugge 4 days ago | parent | next [-]

I use claude code all day long to debug gnarly legacy code. Sometimes in languages I barely know. It works great especially as a second opinion or to get unstuck. It is very fun but can be addictive and exhausting.

mrugge 4 days ago | parent | prev [-]

More specifically I will stub out a simple unit test by hand to zoom in on where I think the issue is. It then turns into an exhilarating and wild ride from there.