145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* 245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * Null debugging format (creates NO debugging information) 345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * 445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * Copyright (C) 2002-2007 Peter Johnson 545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * 645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * Redistribution and use in source and binary forms, with or without 745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * modification, are permitted provided that the following conditions 845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * are met: 945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * 1. Redistributions of source code must retain the above copyright 1045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * notice, this list of conditions and the following disclaimer. 1145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * 2. Redistributions in binary form must reproduce the above copyright 1245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * notice, this list of conditions and the following disclaimer in the 1345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * documentation and/or other materials provided with the distribution. 1445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * 1545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 1645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 1945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org * POSSIBILITY OF SUCH DAMAGE. 2645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org */ 2745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#include <util.h> 2845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 2945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#include <libyasm.h> 3045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 3145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 3245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgyasm_dbgfmt_module yasm_null_LTX_dbgfmt; 3345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 3445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 3545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgstatic /*@null@*/ /*@only@*/ yasm_dbgfmt * 3645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgnull_dbgfmt_create(yasm_object *object) 3745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org{ 3845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org yasm_dbgfmt_base *dbgfmt = yasm_xmalloc(sizeof(yasm_dbgfmt_base)); 3945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org dbgfmt->module = &yasm_null_LTX_dbgfmt; 4045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org return (yasm_dbgfmt *)dbgfmt; 4145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org} 4245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 4345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgstatic void 4445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgnull_dbgfmt_destroy(/*@only@*/ yasm_dbgfmt *dbgfmt) 4545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org{ 4645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org yasm_xfree(dbgfmt); 4745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org} 4845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 4945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgstatic void 5045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgnull_dbgfmt_generate(yasm_object *object, yasm_linemap *linemap, 5145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org yasm_errwarns *errwarns) 5245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org{ 5345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org} 5445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 5545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 5645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* Define dbgfmt structure -- see dbgfmt.h for details */ 5745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgyasm_dbgfmt_module yasm_null_LTX_dbgfmt = { 5845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org "No debugging info", 5945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org "null", 6045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org NULL, /* no directives */ 6145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org null_dbgfmt_create, 6245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org null_dbgfmt_destroy, 6345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org null_dbgfmt_generate 6445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org}; 65