From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92915 invoked by alias); 20 Jan 2019 15:01:20 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 92649 invoked by uid 89); 20 Jan 2019 15:01:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: NAM04-SN1-obe.outbound.protection.outlook.com Received: from mail-eopbgr700086.outbound.protection.outlook.com (HELO NAM04-SN1-obe.outbound.protection.outlook.com) (40.107.70.86) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 20 Jan 2019 15:01:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=roku.onmicrosoft.com; s=selector1-roku-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bRle4zlndG3q6MYUHIviucslgHqSvHIoPucuH0BvD1c=; b=UQeALNz6cEwDsQxFLjMM/MWjB6xkZ0qtmxSjlS3jWpWLwUFW1nnjzdi1YAIud6RxiaIAfL3YFEu6XDQ6mYNnpi5QOwi3+jHM1G3vdB/UCJWl57g3b+6Pz+bNUnzqGqUCl7XLiCgQFx+rV3jJmyYNfLF8NYdVRLc/HNDVJFd/7GA= Received: from BN7PR01MB3953.prod.exchangelabs.com (52.132.220.158) by BN7PR01MB3761.prod.exchangelabs.com (52.132.4.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.29; Sun, 20 Jan 2019 15:00:47 +0000 Received: from BN7PR01MB3953.prod.exchangelabs.com ([fe80::187c:ad63:20fd:b430]) by BN7PR01MB3953.prod.exchangelabs.com ([fe80::187c:ad63:20fd:b430%4]) with mapi id 15.20.1537.030; Sun, 20 Jan 2019 15:00:47 +0000 From: Luke Diamand To: "elfutils-devel@sourceware.org" CC: Mark Wielaard , Luke Diamand Subject: [PATCHv1 2/2] eu-stack: add support for sysroot option Thread-Topic: [PATCHv1 2/2] eu-stack: add support for sysroot option Thread-Index: AQHUsNDsFDpWjzyKYU6AeTHWZr8sHQ== Date: Sun, 20 Jan 2019 15:01:00 -0000 Message-ID: <20190120150028.21580-3-ldiamand@roku.com> References: <20190120150028.21580-1-ldiamand@roku.com> In-Reply-To: <20190120150028.21580-1-ldiamand@roku.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CWXP265CA0027.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:2d::15) To BN7PR01MB3953.prod.exchangelabs.com (2603:10b6:406:91::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ldiamand@roku.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [81.145.207.254] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN7PR01MB3761;6:qfoPEeMp+i5Ck97KosCeqM3dIcZBX58ffyCf0YCyQ4HcS57Z2tP0/NsK8jLOUpMztEdEmgrorBUdBYcmAVF7isTpyWZdrKHuyJzo+pMY6YZ97NWMX/I8jQM937WBiF1grOvEyUCRF3i0O7kNq9pkQPPizT9tfo9CJLqe+PSTsUitvVcQF26QN9g1FZlKfWvvLSbeUcvsZVC6odWVziHWMRUbU6BEdVHKCy/bEX5jksFm7EhxstKr143BSNHT82xhb0hqTJ7PihNCTdyym4bHcpy+MY20jSv9l6sWtIbI7DfSrEluiJwHDj3/9Ogrnu/JsqXQG6ipI7EjDndcS5r4Oyi4KaGM6kEFzo5nsg+XYlB+c5tOpj62CLnnZfz9X8FGmGM3uucGWQ/XR3hLjk+ys7wTVZtU1fKzdrFGsahId/zWctVcRIaNPzAYCW6+1xWrdsyMd0aAgIO7bCzf/6XqjA==;5:F6auBhOh7J8H/S8v/fBSDxYjL5qSzm+/unbwY+nMr18csgo/oaWYLSrNN1Os6yjSw+QYyywaac85DhqiRxCAc/83T5qJBJACxLXpkfnYmkphXHemd0WFHcEG3fGA4OzzEfYbN50CLBoVgEJby0r5f0bbaosXtvbURBvLdv990Ra8c172Z/9RKCNGL87yjNsi3LTMOCCjCePgrcL5sTn76A==;7:yub0NNuWxmKaAGOQ1PnyVDWnvFCFcg9U8NqcuSwhL+87q2rLDEv4NV52sm4Z80F4gZmn6didGVOCoX3vKP8nUvQWOySUOOwGl/Wm3VmC3+v1reqqNM2duvfnWKINm5WVZ9Gi5gRXJRYYrD1TzHwMzA== x-ms-office365-filtering-correlation-id: 56f4b979-12e6-4c6e-3de4-08d67ee80ebd x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(2017052603328)(7153060)(7193020);SRVR:BN7PR01MB3761; x-ms-traffictypediagnostic: BN7PR01MB3761: x-microsoft-antispam-prvs: x-forefront-prvs: 0923977CCA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(39850400004)(346002)(366004)(136003)(396003)(189003)(199004)(2351001)(26005)(105586002)(14454004)(6512007)(106356001)(99286004)(86362001)(6916009)(186003)(68736007)(4326008)(256004)(25786009)(386003)(6506007)(66066001)(102836004)(53936002)(52116002)(316002)(76176011)(107886003)(54906003)(486006)(476003)(2616005)(11346002)(1076003)(81156014)(8676002)(81166006)(8936002)(7736002)(36756003)(2501003)(2906002)(305945005)(6486002)(5640700003)(6436002)(50226002)(97736004)(3846002)(71200400001)(71190400001)(478600001)(6116002)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR01MB3761;H:BN7PR01MB3953.prod.exchangelabs.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: roku.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: jfsHZ1jdB8XEsQziedI3iKZ2/9V50VcbXgmZBx0GV2RgK7JndmX+JCv5da1gda95mwA7bVHBLT82g4Jqg/hSkGpQwA52DRapHxPmUxy+1fVzD7Z0yEbHZJMVzzn+OKWJ/o2HbG+1q3/8p0Seolah3TNfcFWo4o93L9AleAMra26FOFmYPq0MHtZ4Zoej3K8rbI0d8EVmiEvUDE44nkzLqNKtk+M43LaPvtiE1PnS8iJW93wVLBaZ0ib1OQvdVxvNG4CJrfXfgWKtJa9T8gNsb1iLNJYcfaJ2nEe2hEYEXbvS1k3XD4gV8k8innME2yqiAsuMRSLiQQ0wh8q4azoTttkqC9bheZe7YFMVhcVW7jvCtpagKjZNtWp7O3jZ9KBQc3XVlQn+9qSP2tptqBaQXoD4pXdt5vJ6sVrxAn47Bm8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: roku.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56f4b979-12e6-4c6e-3de4-08d67ee80ebd X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2019 15:00:45.9646 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 00fc7e42-ad65-4c4c-ab54-848ba124a5b7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR01MB3761 X-SW-Source: 2019-q1/txt/msg00066.txt.bz2 Use the dwfl_set_sysroot() function to set the sysroot to be used when analysing a core: e.g. $ eu-stack --core core --sysroot /path/to/sysroot -e crashing_prog Signed-off-by: Luke Diamand --- src/stack.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/stack.c b/src/stack.c index c5f347e1..5a58cc1b 100644 --- a/src/stack.c +++ b/src/stack.c @@ -73,6 +73,7 @@ static int core_fd =3D -1; static Elf *core =3D NULL; static const char *exec =3D NULL; static char *debuginfo_path =3D NULL; +static const char *sysroot =3D NULL; =20 static const Dwfl_Callbacks proc_callbacks =3D { @@ -554,6 +555,10 @@ parse_opt (int key, char *arg __attribute__ ((unused)), show_modules =3D true; break; =20 + case 'S': + sysroot =3D arg; + break; + case ARGP_KEY_END: if (core =3D=3D NULL && exec !=3D NULL) argp_error (state, @@ -587,6 +592,8 @@ parse_opt (int key, char *arg __attribute__ ((unused)), dwfl =3D dwfl_begin (&core_callbacks); if (dwfl =3D=3D NULL) error (EXIT_BAD, 0, "dwfl_begin: %s", dwfl_errmsg (-1)); + if (sysroot) + dwfl_set_sysroot(dwfl, sysroot); if (dwfl_core_file_report (dwfl, core, exec) < 0) error (EXIT_BAD, 0, "dwfl_core_file_report: %s", dwfl_errmsg (-1)); } @@ -670,6 +677,8 @@ main (int argc, char **argv) N_("Show at most MAXFRAMES per thread (default 256, use 0 for unlimited)"= ), 0 }, { "list-modules", 'l', NULL, 0, N_("Show module memory map with build-id, elf and debug files detected"),= 0 }, + { "sysroot", 'S', "sysroot", 0, + N_("Set the sysroot to search for libraries referenced from the core file= "), 0 }, { NULL, 0, NULL, 0, NULL, 0 } }; =20 --=20 2.20.1