9/22/2020 Gdb For Mac
This document explains how to debug Mozilla-derived applications such as Firefox, Thunderbird, and SeaMonkey on macOS using Xcode. If you want to debug from the terminal see Debugging Mozilla with lldb. For specific information on a way to debug hangs, see Debugging a hang on OS X.
When GDB notices a new thread. In contrast, on other systems, the systag is simply something like ‘process 368’, with no further qualifier. For debugging purposes, GDB associates its own thread number —always a single integer—with each thread of an inferior. This number is unique between all threads of an inferior, but not unique between threads of different inferiors. I'm having lots of problems with GDB; usually crashes and starts using 100% CPU until I kill the process using the activity monitor on the Mac (using Mavericks). How do I remove GDB from my machine.
Creating a debuggable build
First, you need to build the application you're going to debug using
--disable-optimize --enable-debug-symbols in your .mozconfig (also add --enable-debug if you want assertions etc. compiled in). See Building Firefox for macOS if you need help creating your own build.
VPNs work by creating a secure encrypted “tunnel” between your Mac device and your chosen VPN company’s servers. Mac devices are still very much prone to attacks, especially from data thieves and unscrupulous entities who might want to use your personal/private information for who-knows-what.Thankfully, we have things called VPNs that will help shield you from the aforementioned snoops. Free vpns for mac.
Debugging Firefox on macOS 10.14+
macOS 10.14 introduced Notarization and Hardened Runtime features for improved application security. macOS 10.15 went further, requiring applications to be Notarized with Hardened Runtime enabled in order to launch (ignoring workarounds.) When run on earlier macOS versions, Notarization and Hardened Runtime settings have no effect.
Official Builds
At this time, official builds of Firefox 69 and later are Notarized. Uplifts to Firefox 68 and ESR 68 to enable Notarization are planned. As a result, it is not possible to attach a debugger to these official Firefox releases on macOS 10.14+ without disabling System Integrity Protection (SIP). This is due to Notarization requiring Hardened Runtime to be enabled with the
com.apple.security.get-task-allow entitlement disallowed. Rather than disabling SIP (which has security implications), it is recommended to debug with try builds or local builds. The differences are explained below.
try Server Builds
In most cases, developers needing to debug a build as close as possible to the production environment should use a try build. These builds enable Hardened Runtime and only differ from production builds in that they are not Notarized which should not otherwise affect functionality, (other than the ability to easily launch the browser on macOS 10.15+ -- see quarantine note below). At this time, developers can obtain a Hardened Runtime build with the
com.apple.security.get-task-allow entitlement allowed by submitting a try build and downloading the dmg generated by the 'Rpk' shippable build job. A debugger can be attached to Firefox processes of these builds. try builds use the developer.entitlements.xml file from the source tree while production builds use production.entitlements.xml . On macOS 10.15+, downloaded try builds will not launch by default because Notarization is required. To workaround this problem, remove the quarantine extended attribute from the downloaded Nightly:
Â
$ xattr -r -d com.apple.quarantine /Path/to/Nightly.app
Local Builds
Local builds of mozilla-central do not enable Hardened Runtime and hence do not have debugging restrictions. As a result, some functionality will be permitted on local builds, but blocked on production builds which have Hardened Runtime enabled. Bug 1522409 was filed to automate codesigning local builds to enable Hardened Runtime by default and eliminate this discrepancy.
To obtain a Hardened Runtime build without using try infrastructure, a developer can manually codesign builds using the macOS
codesign(1) command with the developer.entitlements.xml file from the tree. This requires creating a codesigning identity.
Disabling System Integrity Protection (SIP)
If debugging a production build is required, follow Apple's documented steps for disabling System Integrity Protection (SIP). Note that disabling SIP bypasses Hardened Runtime restrictions which can mask some bugs that only occur with Hardened Runtime so it is recommended to test fixes with SIP enabled. Disabling SIP has system security implications that should be understood before taking this step.
Microsoft office for mac 2017. Install Office for Mac now Unmistakably Office, designed for Mac Get started quickly with new, modern versions of Word, Excel, PowerPoint, Outlook and OneNote—combining the familiarity of Office and the unique Mac features you love. Jan 28, 2013 Office Suite 2019 Microsoft Word 2016 2013 2010 2007 365 Compatible Software CD Powered by Apache OpenOfficeTM for PC Windows 10 8.1 8 7 Vista XP 32 64 Bit & Mac OS X. Choose your Office Office – even better with an Office 365 subscription. Get Office apps on your PC or Mac, an optimized experience across tablets and phones, 1 TB of OneDrive cloud storage, and more, so you have the power and flexibility to get things done from virtually anywhere. You have choices when it comes to choosing Microsoft Office for Mac. You can either select Office 365 Mac, which is a cloud-based subscription service with many collaborative features, or Mac Office 2019, which is a one-time purchase geared more towards personal and small businesses use. MS Office for Mac 2019 can be used on a single Mac, with no ongoing annual fee.
Creating an Xcode project
If you try to create a new Xcode project in an existing directory then Xcode will delete its existing contents (Xcode will warn you beforehand). To work around that the steps below will have you initialize the project outside the Mozilla source tree, close the project, copy the .xcodeproj project 'file' into the source tree, and only then will you reopen the project to finish setting it up.
![]()
Note also that since Xcode 7.3.1 it doesn't seem to be possible to have the Xcode project live outside the source tree. If you try to do that then Xcode will simply copy the source files under the project directory rather than link to them (still the case in Xcode 10?) which breaks debugging and the possibility to modify-rebuild-relaunch from inside Xcode.
These steps were last updated for Xcode 10:
At this point you can run the application from Xcode, and when you pause or hit breakpoints it should show open the correct source file at the correct line.
Setting up lldb
lldb is the debugger XCode version 5 and above uses under the hood (previous versions used gdb).
The .lldbinit file in the source tree imports many useful Mozilla specific lldb settings and commands but when debugging in XCode this file is not loaded by default since Xcode does not run using $topsrcdir as its current working directory (see bug 942133). To work around this add the following toÂ
$HOME/.lldbinit and set fallbacktopsrcdir to a Mozilla source directory that you regularly update:
see Debugging Mozilla with lldb for more information.
Note that one important issue that the Mozilla .lldbinit file fixes is that by default some breakpoints will be listed as 'pending', and XCode will not stop at them. If you don't include the Mozilla's .lldbinit, you must at least put
settings set target.inline-breakpoint-strategy always in your $HOME/.lldbinit as recommended on Debugging Mozilla with lldb.
You will need to use Python v2.x supplied by macOS, otherwise, you will encounter this error:
ImportError: cannot import name _remove_dead_weakref . Run the following to correct this: brew unlink python@2 .
Having a profile for debugging purposes
It is recommended to create a separate profile to debug with, whatever your task, so that you don't lose precious data like Bookmarks, saved passwords, etc. So that you're not bothered with the profile manager every time you start to debug, expand the 'Executables' branch of the 'Groups & Files' list and double click on the Executable you added for Mozilla. Click the plus icon under the 'Arguments' list and type '-P <profile name>' (e.g. '-P MozillaDebug'). Close the window when you're done.
Running a debug session
Make sure breakpoints are active (which implies running under the debugger) by opening the Product menu and selecting 'Debug / Activate Breakpoints' (also shown by the 'Breakpoints' button in the top right section of the main window). Then click the 'Run' button or select 'Run' from the Product menu.
Teamviewer for mac. Provide users with the easy-to-use QuickSupport moduleTeamViewer is an application used to establish remote connections to other computers. The software is mainly used for desktop sharing, participating in meetings, chatting with other users, and making video calls.TeamViewer is optimized to use the least amount of bandwidth while still providing efficient image rendering and quick file transfer speed.
Setting breakpoints
Setting a breakpoint is easy. Just open the source file you want to debug in Xcode, and click in the margin to the left of the line of code where you want to break.
During the debugging session, each time that line is executed, the debugger will break there, and you will be able to debug it.
Note that with the default configuration, some breakpoints will be listed as 'pending', and XCode will not stop at them. If you don't include the Mozilla's .lldbinit, you must at least put
settings set target.inline-breakpoint-strategy always in your $HOME/.lldbinit as recommended on Debugging Mozilla with lldb.
Using Mozilla-specific lldb commands
If you included the .lldbinit when Setting up lldb, you can use Mozilla-specific lldb commands in the console, located in the Debug area of XCode. For example, type
js to see the JavaScript stack. For more information, see Debugging Mozilla with lldb.
Debugging e10s child processes
Using XCode to debug child processes created by an e10s-enabled browser is a little trickier than debugging a single-process browser, but it can be done. These directions were written using XCode 6.3.1
Now you're ready to start debugging:
For some help on using lldb see Debugging Mozilla with lldb.
Other resources
Apple has an extensive list of debugging tips and techniques.
Questions? Problems?
Try asking in our IRC channels #developers or #macdev.
*** I do not recommend the instructions below ****** Please take a look at this post for safer method *** I have a macbook air (MBA) which I carry around to use at various locations other than my desk at home. Of course I could install Ubuntu on my MBA, but I really like how easy it is to do anything on OS X, so I am keeping it. I also do a lot of software development on my MBA. That being said, it bothers me that by default I cannot run gdb on OS X El Capitan. In this post, I will show how to enable gdb on OS X El Capitan. The credit goes to here. First, you will need to install gdb. I would use brew. In case you don't have brew installed on the system, follow the instructions here. $ brew install gdb When you try to run a program on gdb, you will encounter error similar to below: (gdb) run Starting program: a.out Mac Mojave GdbUnable to find Mach task port for process-id 627: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8)) The solution is as follows: 1. Restart OS X. Enter recovery mode by pressing and holding [command + R] until you see Apple logo. See here for more detail. 2. In the recovery mode, choose utilities menu and open up terminal 3. In the terminal, disable system integrity protection (SIP) Gdb Macro Expand$ csrutil disable && reboot4. Add Gdb For Mac Sierra-p option toGdb Mac Os High Sierra/System/Library/LaunchDaemons/com.apple.taskgated.plist file. After your edit, it should read something like (line 22)<array> <string>/usr/libexec/taskgated</string> <string>-sp</string> </array>
5. (Optional) Re-enable SIP by repeating steps 1~3 with the command and reboot.
6. Add your username to procmod group $ sudo dseditgroup -o edit -a $USER -t user procmod
$ sudo chmod g+s $(which gdb)
Please be advised that you will need to reboot your system for the change to take effect.
Now, you should be able to use gdb on Mac OS X!
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |