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 22:48:24 -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 0685dUqx025316; Wed, 8 Jul 2020 01:40:15 -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 0685dSdH025313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 8 Jul 2020 01:39:28 -0400 Received: from oc11exedge2.exchange.mit.edu (OC11EXEDGE2.EXCHANGE.MIT.EDU [18.9.3.18]) by outgoing-exchange-7.mit.edu (8.14.7/8.12.4) with ESMTP id 0685bthB006231 for ; Wed, 8 Jul 2020 01:38:02 -0400 Received: from w92expo6.exchange.mit.edu (18.7.74.60) by oc11exedge2.exchange.mit.edu (18.9.3.18) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Wed, 8 Jul 2020 01:39:06 -0400 Received: from oc11exhyb8.exchange.mit.edu (18.9.1.113) by w92expo6.exchange.mit.edu (18.7.74.60) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Wed, 8 Jul 2020 01:39:24 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.175) by oc11exhyb8.exchange.mit.edu (18.9.1.113) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Wed, 8 Jul 2020 01:39:24 -0400 Received: from CO2PR04CA0146.namprd04.prod.outlook.com (2603:10b6:104::24) by DM5PR0101MB2860.prod.exchangelabs.com (2603:10b6:4:2d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20; Wed, 8 Jul 2020 05:39:23 +0000 Received: from CO1NAM03FT018.eop-NAM03.prod.protection.outlook.com (2603:10b6:104:0:cafe::b7) by CO2PR04CA0146.outlook.office365.com (2603:10b6:104::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Wed, 8 Jul 2020 05:39:23 +0000 Received: from mail-vs1-f42.google.com (209.85.217.42) by CO1NAM03FT018.mail.protection.outlook.com (10.152.80.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Wed, 8 Jul 2020 05:39:23 +0000 Received: by mail-vs1-f42.google.com with SMTP id 64so17565213vsl.3 for ; Tue, 07 Jul 2020 22:39:23 -0700 (PDT) From: K S To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Tue, 7 Jul 2020 22:39:15 -0700 Subject: Re: [PIC] MPLABX | XC8 - watching variables in multiple modules Thread-Topic: [PIC] MPLABX | XC8 - watching variables in multiple modules Thread-Index: AdZU62WKG92CspCGQrScyrw6QbLuaA== Message-ID: References: <20200707041113.06a56fd6300ec2bfca6379d4e10ab8d2.060b50c987.wbe@email27.godaddy.com> List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: 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 gmail.com designates 209.85.217.42 as permitted sender) receiver=protection.outlook.com; client-ip=209.85.217.42; helo=mail-vs1-f42.google.com; dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=RGcaMlih7MqMJg5165+JQSASyO/A9zPu8ijscJRZhAo=; b=YaSkQMK++1hv71y1hwfAcSszKHipQAO4E9GK8CAUeBprU3iEC8CTtHsqFYw3P3yDIK qz1huslvLBGDfXK46GzZX0mrMJx+Ipoa5KiwS1i2+errjb/Q7/Vu3Zw3iespGmijfD0a hnE5wd5CTp1v+RlX2SwLzYPeWur+/pzcqwo8quOHndgFoGPUU4F+YvILbRTYHbup+ta7 Frqxaw1tvB4L4dUdEwgEaTfDYqu8oFWqlZQBCjwavr8RS7cG9e3YFK9gJlLch0FwxS8d 7A+rgq4DzQjT59qTM+wypbynVY6EUpy/DL+PBJZ+ms7TLhcswGfo/CRYUjpBLQ3llG+3 xHww== authentication-results: spf=pass (sender IP is 209.85.217.42) smtp.mailfrom=gmail.com; mit.edu; dkim=pass (signature was verified) header.d=gmail.com; mit.edu; dmarc=pass action=none header.from=gmail.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:a67:1b85:: with SMTP id b127mr37570142vsb.152.1594186761767; Tue, 07 Jul 2020 22:39:21 -0700 (PDT) x-topics: [PIC] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Thank you. Points taken, but one of the reasons I am trying to *not* rename each variable distinctly, such as prefacing with the module name, is because it quickly bleeds into really long variable names that have no purpose outside their module scope, and that becomes a bit harder to maintain. IME the shorter the names, while still containing all relevant information, the better. I have actually been looking at the map file for now, but it is a pain compared to just having a clear view when I need it. On Tue, Jul 7, 2020 at 9:29 PM Forrest Christian (List Account) wrote: > > Naming variables to be unique across the system (other than local variabl= es > 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 wher= e > 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 convenien= t. > > 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 on= e > > > 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 > > > > > -- > - Forrest > -- > 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 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .