Bug 212667 - [PATCH] machdep.c: check DDB_ENABLED before defining SPR/db_show_table
Summary: [PATCH] machdep.c: check DDB_ENABLED before defining SPR/db_show_table
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: powerpc Any
: --- Affects Only Me
Assignee: Justin Hibbits
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-09-13 19:18 UTC by Kenneth Salerno
Modified: 2016-09-14 23:26 UTC (History)
2 users (show)

See Also:


Attachments
patch to check if ddb is enabled in kernel before defining debugger commands (459 bytes, patch)
2016-09-13 19:18 UTC, Kenneth Salerno
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Salerno 2016-09-13 19:18:29 UTC
Created attachment 174741 [details]
patch to check if ddb is enabled in kernel before defining debugger commands

In reference to this change last month:
r304051 | jhibbits | 2016-08-13 14:46:49 -0400 (Sat, 13 Aug 2016) | 21 lines

Add a kdb show command to print arbitrary SPRs on PowerPC
-----------------------------------------------------------------------------

The attached patch checks first if DDB is enabled in the kernel configuration before defining db_show_table (DB_SHOW_COMMAND(spr, db_show_spr)). 

The behavior before this patch is a powerpc/powerpc64 kernel with DDB disabled fails to link with an undefined reference to db_show_table.
Comment 1 Justin Hibbits freebsd_committer freebsd_triage 2016-09-14 21:06:23 UTC
Take.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-09-14 23:24:32 UTC
A commit references this bug:

Author: jhibbits
Date: Wed Sep 14 23:24:23 UTC 2016
New revision: 305820
URL: https://svnweb.freebsd.org/changeset/base/305820

Log:
  Only define db_show_spr if DDB is enabled.

  PR:		212667
  Reported by:	Kenneth Salerno <kennethsalerno_AT_yahoo_dot_com>

Changes:
  head/sys/powerpc/powerpc/machdep.c
Comment 3 Justin Hibbits freebsd_committer freebsd_triage 2016-09-14 23:26:16 UTC
Thanks for the report, I just committed an equivalent fix (the right macro is "DDB", not "DDB_ENABLED").