[lldb][scripts] Fix bugs in framework fix script (#145961)

The script used to fix up LLDB's header for use in the macOS framework
contained 2 bugs that this commit addreses:

1. The output contents were appended to the output file multiple times
instead of only being written once.
2. The script was not considering LLDB includes that were *not* from the
SB API.

This commit addresses and fixes both of these bugs and updates the
corresponding test to match.
This commit is contained in:
Chelsea Cassanova 2025-06-26 15:06:37 -07:00 committed by GitHub
parent 4e154ccaf1
commit c73e5e3e20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -20,7 +20,7 @@ import sys
# Main header regexes # Main header regexes
INCLUDE_FILENAME_REGEX = re.compile( INCLUDE_FILENAME_REGEX = re.compile(
r'#include "lldb/API/(?P<include_filename>.*){0,1}"' r'#include "lldb/(API/)?(?P<include_filename>.*){0,1}"'
) )
# RPC header regexes # RPC header regexes

View File

@ -6,6 +6,7 @@
// e.g. #include "lldb/API/SBDefines.h" -> #include <LLDB/SBDefines.h> // e.g. #include "lldb/API/SBDefines.h" -> #include <LLDB/SBDefines.h>
#include "lldb/API/SBDefines.h" #include "lldb/API/SBDefines.h"
#include "lldb/API/SBModule.h" #include "lldb/API/SBModule.h"
#include "lldb/lldb-types.h"
// Any include guards specified at the command line must be removed. // Any include guards specified at the command line must be removed.
#ifndef SWIG #ifndef SWIG

View File

@ -9,3 +9,4 @@ RUN: cat %t/Outputs/SBAddress.h | FileCheck %s
# e.g. #include "lldb/API/SBDefines.h" -> #include <LLDB/SBDefines.h> # e.g. #include "lldb/API/SBDefines.h" -> #include <LLDB/SBDefines.h>
CHECK: #include <LLDB/SBDefines.h> CHECK: #include <LLDB/SBDefines.h>
CHECK: #include <LLDB/SBModule.h> CHECK: #include <LLDB/SBModule.h>
CHECK: #include <LLDB/lldb-types.h>