Project

General

Profile

Bug #6348

source-level debugging not quite working

Added by Gordon Ross over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2015-10-17
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

The fixes for #3844 made it easier to build with -g but source-level debugging is still not quite working correctly. The reason is that #3844 added -g without removing optimization options.
With most tool chains, if you turn on both debug support and optimization, examination of local variables etc. usually doesn't work.

The most common approach for adjusting a Makefile to build for debugging is to modify whatever make variable holds the "optimization" options (i.e. typically "-O" or similar), so that when building for debug the optimization flags are replaced with a "-g" flag. That both turns on full source-level debugging support, and turns off optimization. That's what we should be doing as well.

In most ilumos makefiles, the variable we're interested in for this is COPTFLAG, but sometimes COPTFLAG64, CCOPTFLAG, CCOPTFLAG64

Also available in: Atom PDF