Debug flag in 1.x?

I wonder why there isn’t any “debug” flag in the makefile.

I’d like to build using -O0 instead of -O3 when I need to debug my plugin.
Usually, a make install DEBUG=true is enough.

How do you debug in Rack instead? I don’t want to change manually the into the Rack folder. Once I pull new changes, it will replace edits and such.

Wouldn’t be more elegant to just place:

ifndef DEBUG
FLAGS += -O3
FLAGS += -O0

(And the same with strip command)

Or somethings more configurable by user tasks?

I think @Vortico has mentioned he doesn’t do a ton of gbd debugging in Rack (and neither do I). It seems like a fine idea for you to modify the relevant parts of the makefile as you suggest. If do the same for my plugins - I turn off the asserts in a normal build, and only turn them on with a command line option for local debugging.

Yes, but it could be nice if the whole can be add to the main repo (for me and for anyone will use it), else every time I pull the branch, the .mk will be overwritten…

Pull request? @Vortico would you add it?

This is why I do

git stash
git pull
git stash apply

every time I update Rack; preserving other local changes which would otherwise be overwritten.

Thats a light workaround.
What if you need to port your own plugins repo on another machine?
Or if you need to share the repo with some other collabs?

You need to spread these similar edits every time, on each machine.

Looking for somethings more solid :slight_smile:
These tools are provided by the infrastructure, usually.

Won’t this also help you?

I do have my own plugins repo on multiple machines. I don’t edit Rack often, so the changes are mostly ‘set it and forget it’; also, different machines need different patch sets – e.g., Mac uses lldb, Windows gdb.

When I share my work, I make sure that it is compatible with unmodified Rack; besides, another developer may have their own set of mods that match their workflow. If I want to share my mods, I can send a patch file that can applied in part or in whole.

As for the edit you suggest: it requires some attention on my part to make sure Rack + each plugin folder is cleaned and completely rebuilt when switching from debug to release and back. I would prefer a solution that uses a separate build directory for debug, but it hasn’t bothered me enough to write that patch.

the question here is:
the framework of Rack need an explicit and simply DEBUG mode.

1 Like

Why would you need Rack rebuilded in debug/release mode? That build is unique. Just the plugin must be rebuilded. And a smart “clean” before to switch build mode is enough, I think.

I was unaware that Rack guarantees that the ABI is unchanged between debug and release.

Sorry, miss this topic :slight_smile:
What do you mean with “guarantees that the ABI is unchanged between debug and release”? Example?