Received: from PCH.mit.edu (18.7.21.50) by mail.efplus.com (192.168.0.8) with Microsoft SMTP Server (TLS) id 8.3.485.1; Tue, 7 Jul 2020 04:37:38 -0700 Received: from PCH.MIT.EDU (localhost.localdomain [127.0.0.1]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 067BTIkN026229; Tue, 7 Jul 2020 07:29:27 -0400 Received: from outgoing-exchange-7.mit.edu (OUTGOING-EXCHANGE-7.MIT.EDU [18.9.28.58]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 067BTIV5026225 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 7 Jul 2020 07:29:18 -0400 Received: from w92exedge3.exchange.mit.edu (W92EXEDGE3.EXCHANGE.MIT.EDU [18.7.73.15]) by outgoing-exchange-7.mit.edu (8.14.7/8.12.4) with ESMTP id 067BRq5c003691 for ; Tue, 7 Jul 2020 07:27:52 -0400 Received: from w92expo7.exchange.mit.edu (18.7.74.61) by w92exedge3.exchange.mit.edu (18.7.73.15) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 7 Jul 2020 07:28:28 -0400 Received: from oc11exhyb4.exchange.mit.edu (18.9.1.100) by w92expo7.exchange.mit.edu (18.7.74.61) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 7 Jul 2020 07:29:17 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by oc11exhyb4.exchange.mit.edu (18.9.1.100) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 7 Jul 2020 07:29:16 -0400 Received: from MWHPR18CA0041.namprd18.prod.outlook.com (2603:10b6:320:31::27) by DM6PR01MB4473.prod.exchangelabs.com (2603:10b6:5:35::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23; Tue, 7 Jul 2020 11:29:16 +0000 Received: from CO1NAM03FT035.eop-NAM03.prod.protection.outlook.com (2603:10b6:320:31:cafe::15) by MWHPR18CA0041.outlook.office365.com (2603:10b6:320:31::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20 via Frontend Transport; Tue, 7 Jul 2020 11:29:15 +0000 Received: from mail-lf1-f49.google.com (209.85.167.49) by CO1NAM03FT035.mail.protection.outlook.com (10.152.80.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Tue, 7 Jul 2020 11:29:15 +0000 Received: by mail-lf1-f49.google.com with SMTP id o4so24517593lfi.7 for ; Tue, 07 Jul 2020 04:29:15 -0700 (PDT) From: "Forrest Christian (List Account)" To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Tue, 7 Jul 2020 04:29:03 -0700 Subject: Re: [PIC] MPLABX | XC8 - watching variables in multiple modules Thread-Topic: [PIC] MPLABX | XC8 - watching variables in multiple modules Thread-Index: AdZUUwT5uWuw34bDTD2GbSpv8hk8cw== Message-ID: References: <20200707041113.06a56fd6300ec2bfca6379d4e10ab8d2.060b50c987.wbe@email27.godaddy.com> List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: <20200707041113.06a56fd6300ec2bfca6379d4e10ab8d2.060b50c987.wbe@email27.godaddy.com> Reply-To: Microcontroller discussion list - Public. Accept-Language: en-US X-MS-Exchange-Organization-AuthAs: Anonymous X-MS-Exchange-Organization-AuthSource: TS500.efplus4.local X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-Exchange-Organization-SenderIdResult: Pass X-MS-Exchange-Organization-PRD: mit.edu X-MS-TNEF-Correlator: received-spf: Pass (protection.outlook.com: domain of packetflux.com designates 209.85.167.49 as permitted sender) receiver=protection.outlook.com; client-ip=209.85.167.49; helo=mail-lf1-f49.google.com; dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=packetflux-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=D1HPfAy5yZ9FEuO5S2z53cN7TqMnxbPYiEk+qDIl/Jc=; b=s3B0FwmgmrzeL46F8STU6DVYnJ3DFdgo2UYrq+Xnwa4WiorTdWUZY7ieDqSW9bWj41 aKQ8HHJKYVSKrOoCnkr/Wox1lzjC65FDYD8jZQ/RCI3sEms8g2jDZQTTx8LK9jcOZ/wx DkG8S2zTDj1GbUcwkr9N6dUEFO67UH1v/4i5eZOUcV6pXZ5DNZtrm3dNEbGRw+RZYphA 7ucxaWGGT3+/t3G3c5x5H3bvqNEXs5RKgyaUqMFeMZfhqXp0ycEDCH4mCLDO+vA9PS65 KJ/9S6OLXApViSqqQg4lFKLzUxkwWg6l30dWER5/3m7DkuRAL7RotAjCscQ1zr9tm+1A FbGg== authentication-results: spf=pass (sender IP is 209.85.167.49) smtp.mailfrom=packetflux.com; mit.edu; dkim=pass (signature was verified) header.d=packetflux-com.20150623.gappssmtp.com; mit.edu; dmarc=bestguesspass action=none header.from=packetflux.com; errors-to: piclist-bounces@mit.edu list-id: "Microcontroller discussion list - Public." list-post: x-beenthere: piclist@mit.edu x-mailman-version: 2.1.6 x-received: by 2002:ac2:47eb:: with SMTP id b11mr33170022lfp.165.1594121353353; Tue, 07 Jul 2020 04:29:13 -0700 (PDT) x-topics: [PIC] x-content-filtered-by: Mailman/MimeDel 2.1.6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Naming variables to be unique across the system (other than local variables used in a function) would be helpful (I tend to name things with MODULENAME_variablename, but then I like having long variables like SCI1_ReceiveBuffer. I use the static qualifier to ensure that I don't have the variable leak outside the module - not to permit name overloading. About the only place I reuse variable names are local variables inside each function, which pretty much always works. I can understand why the debugger is confused about 'file scope' variables. They're going to always be allocated, as opposed to local variables which are very much context specific. One option for you is to look at the map file and see if you can see where they were allocated and then watch that memory address. I haven't tried this but I'm about 99% sure that will work... but not all that convenient. On Tue, Jul 7, 2020 at 5:20 AM Jim wrote: > > Rename the variables with a 1 or 2 so they are seperate and distinct. > And you'll know which module each is working with at a glance. > Regards, > > Jim > > > -------- Original Message -------- > > Subject: [PIC] MPLABX | XC8 - watching variables in multiple modules > > From: K S > > Date: Tue, July 07, 2020 2:18 am > > To: "Microcontroller discussion list - Public." > > > > > > Hello list. > > > > I am debugging an XC8 program with lots of modules in MPLABX 5.35. > > > > Various modules have variables that have the same name. For example I > > have a SCI1 and SCI2 module, both containing a variable called rx_buf. > > These variables are global within the module but not within the whole > > project (declared as "static type name"). The program compiles and > > functions properly. > > > > However during debug I cannot watch these variables properly. Only one > > variable is properly shown within any watch window, the other will > > show as "undefined" or as a copy of the other one. When debugging > > within a module I would expect the variable in scope to show up in a > > watch or when hovered over, but this is not the case. > > > > Has anyone encountered this? And found any workaround? > > > > TIA. Cheers all. > > -- > > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 - Forrest --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .