Merge remote branch 'origin/2.1'

This commit is contained in:
dt
2010-10-12 18:09:25 +02:00
15 changed files with 1223 additions and 4655 deletions

View File

@@ -1236,10 +1236,10 @@ class Dumper:
#warn("HANDLING WATCH %s, INAME: '%s'" % (exp, iname))
if exp.startswith("[") and exp.endswith("]"):
#warn("EVAL: EXP: %s" % exp)
with SubItem(d):
self.put('iname="%s",', iname)
self.put('name="%s",', escapedExp)
self.put('exp="%s",', escapedExp)
with SubItem(self):
self.put('iname="%s",' % iname)
self.put('name="%s",' % escapedExp)
self.put('exp="%s",' % escapedExp)
try:
list = eval(exp)
self.putValue("")

View File

@@ -1,9 +1,15 @@
For Linux, MinGW:
For Linux:
FSF 7.1 release
+ gdb-increased-dcache-line-size.patch
For MinGW:
FSF 7.1 release
+ gdb-increased-dcache-line-size.patch
+ gdb-expand-line-sal-maybe.patch
For Maemo targets:
(--target=arm-none-linux-gnueabi)

View File

@@ -0,0 +1,138 @@
This is fixing http://bugreports.qt.nokia.com/browse/QTCREATORBUG-2004
-----------------------------------------------------------------------------
* From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
* To: gdb-patches at sourceware dot org
* Date: Thu, 29 Jul 2010 00:39:54 +0200
* Subject: [patch] Fix internal error on some -O2 -g breakpoints
Hi,
https://bugzilla.redhat.com/show_bug.cgi?id=612253
(gdb) file ./cc1plus
(gdb) break add_new_name_mapping
../../gdb/breakpoint.c:6594: internal-error: expand_line_sal_maybe: Assertion
`found' failed.
# Test various conditions of prologue analysis on -O2 -g code. Particularly
# when the first command of a function is an inlined function from a different
# symtab. The inlined function can have also multiple concrete instances.
# The next first line after the inlined function should have two PC ranges.
expand_line_sal_maybe processes already too complex data it cannot rely on the
exact input PC would be found between the output resolved results. There are
various bugs I was trying to fix which cause such incorrect multiple results
in this case. But even after fixing all of them the code would be too fragile
to stay relying on this conditional.
After this patch GDB will put the breakpoint only _after_ the initial inlined
call (=incorrectly) in the testcase; it will no longer crash on it, though.
The symtab.c==expand_line_sal change is optional. I believe it is a correct
change but I do not find it much important. With this change GDB will not
only no longer crash but it will even place the breakpoint correctly in the
real world cc1plus testcase from the downstream bug above.
Defining -DLEXICAL still crashes FSF GDB HEAD but just with the
symtab.c==expand_line_sal change it no longer crashes.
Defining -DINLINED crashes FSF GDB HEAD even with the
symtab.c==expand_line_sal change, therefore also
breakpoint.c==expand_line_sal_maybe is patches in this patches.
I can remove the LEXICAL part and keep there only the un-#ifdef-ed INLINED
one if anyone cares about.
<background>
There remain more issues to solve. skip_prologue_sal should be called for
each separate inlined instance (line number alias). It is called now first
and then the other instances are being found... Also skip_prologue_sal should
be able to _decrease_ the PC, not just increase it as it may be needed from
breakpoint_re_set. Just reread_symbols contains bugs causing common GDB
crashes on the reload so I did not try to fix skip_prologue_sal for it now.
Also there is a general problem that GDB now tries to heuristically guess some
expected defects of the debuginfo in -O2 -g cases (see "For optimized code" in
expand_line_sal), it is there because GCC does not generate proper is_stmt
(DW_LNS_negate_stmt). Moreover very magic skip_prologue_sal is there just
because GCC does not generate proper DW_LNS_set_prologue_end markers.
As GCC should produce these markers in a foreseeable future I did not want to
try to do anything with these GDB heuristics.
There remains a question whether the expand_line_sal_maybe patch part should
not possibly use just the first breakpoint if ORIGINAL_PC cannot be found.
I find it safer this way without much disadvantages, multi-PC breakpoints are
very transparent to the user, the other breakpoints are always somehow related
and more breakpoints is always better than less of them, IMO.
</background>
No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
The testcase may not necessarily crash current FSF GDB HEAD on other arches.
Thanks,
Jan
-----------------------------------------------------------------------------
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7048,7 +7048,6 @@ expand_line_sal_maybe (struct symtab_and_line sal)
struct symtabs_and_lines expanded;
CORE_ADDR original_pc = sal.pc;
char *original_function = NULL;
- int found;
int i;
struct cleanup *old_chain;
@@ -7131,17 +7130,8 @@ expand_line_sal_maybe (struct symtab_and_line sal)
return expanded;
}
- if (original_pc)
- {
- found = 0;
- for (i = 0; i < expanded.nelts; ++i)
- if (expanded.sals[i].pc == original_pc)
- {
- found = 1;
- break;
- }
- gdb_assert (found);
- }
+ /* ORIGINAL_PC may not be found between EXPANDED.SALS. expand_line_sal may
+ have skipped too far. */
return expanded;
}
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4636,11 +4636,20 @@ expand_line_sal (struct symtab_and_line sal)
blocks = alloca (ret.nelts * sizeof (struct block *));
for (i = 0; i < ret.nelts; ++i)
{
+ struct block *bl;
+
set_current_program_space (ret.sals[i].pspace);
- filter[i] = 1;
- blocks[i] = block_for_pc_sect (ret.sals[i].pc, ret.sals[i].section);
+ /* Place breakpoint only to the first PC in a function, even if some of
+ them are in a lexical sub-block. Put it too all the function
+ instances incl. the inlined ones. */
+ bl = block_for_pc_sect (ret.sals[i].pc, ret.sals[i].section);
+ while (bl != NULL && BLOCK_FUNCTION (bl) == NULL)
+ bl = BLOCK_SUPERBLOCK (bl);
+
+ filter[i] = 1;
+ blocks[i] = bl;
}
do_cleanups (old_chain);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -67,7 +67,7 @@
<string>Switch to previous mode on debugger exit.</string>
</property>
<property name="text">
<string>Switch to previous mode on debugger exit.</string>
<string>Switch to previous mode on debugger exit</string>
</property>
</widget>
</item>

View File

@@ -947,15 +947,18 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
response->cookie = cmd.cookie;
bool isExpectedResult =
response->resultClass == GdbResultError
|| response->resultClass == ((cmd.flags & RunRequest) ? GdbResultRunning :
(cmd.flags & ExitRequest) ? GdbResultExit :
GdbResultDone)
// Happens with some incarnations of gdb 6.8 for "run to line"
|| (response->resultClass == GdbResultDone && cmd.command == "continue")
(response->resultClass == GdbResultError) // Can always happen.
|| (response->resultClass == GdbResultRunning && (cmd.flags & RunRequest))
|| (response->resultClass == GdbResultExit && (cmd.flags & ExitRequest))
|| (response->resultClass == GdbResultDone);
// GdbResultDone can almost "always" happen. Known examples are:
// (response->resultClass == GdbResultDone && cmd.command == "continue")
// Happens with some incarnations of gdb 6.8 for "jump to line"
|| (response->resultClass == GdbResultDone && cmd.command.startsWith("jump"))
|| (response->resultClass == GdbResultDone && cmd.command.startsWith("detach"));
// (response->resultClass == GdbResultDone && cmd.command.startsWith("jump"))
// (response->resultClass == GdbResultDone && cmd.command.startsWith("detach"))
// Happens when stepping finishes very quickly and issues *stopped/^done
// instead of ^running/*stopped
// (response->resultClass == GdbResultDone && (cmd.flags & RunRequest));
if (!isExpectedResult) {
#ifdef Q_OS_WIN
@@ -1225,10 +1228,14 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
// initiated by the user.
notifyInferiorSpontaneousStop();
} else if (state() == InferiorRunRequested) {
// Stop triggered by somethin like "-exec-step\n"
// Stop triggered by something like "-exec-step\n"
// "&"Cannot access memory at address 0xbfffedd4\n"
// In this case a proper response 94^error,msg="" will follow and
// be handled in the result handler.
// -- or --
// *stopped arriving earlier than ^done response to an -exec-step
notifyInferiorRunOk();
notifyInferiorSpontaneousStop();
} else {
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state());
notifyInferiorStopOk();
@@ -1847,6 +1854,12 @@ void GdbEngine::executeStep()
void GdbEngine::handleExecuteStep(const GdbResponse &response)
{
if (response.resultClass == GdbResultDone) {
// Step was finishing too quick, and a '*stopped' messages should
// have preceeded it, so just ignore this result.
QTC_ASSERT(state() == InferiorStopOk, /**/);
return;
}
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
if (response.resultClass == GdbResultRunning) {
notifyInferiorRunOk();
@@ -1904,6 +1917,12 @@ void GdbEngine::executeNext()
void GdbEngine::handleExecuteNext(const GdbResponse &response)
{
if (response.resultClass == GdbResultDone) {
// Step was finishing too quick, and a '*stopped' messages should
// have preceeded it, so just ignore this result.
QTC_ASSERT(state() == InferiorStopOk, /**/);
return;
}
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
if (response.resultClass == GdbResultRunning) {
notifyInferiorRunOk();
@@ -4136,6 +4155,10 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
postCommand("set width 0");
postCommand("set height 0");
// Work around http://bugreports.qt.nokia.com/browse/QTCREATORBUG-2004
postCommand("maintenance set internal-warning quit no");
postCommand("maintenance set internal-error quit no");
if (m_isMacGdb) {
postCommand("-gdb-set inferior-auto-start-cfm off");
postCommand("-gdb-set sharedLibrary load-rules "

View File

@@ -68,7 +68,9 @@ void SessionEngine::saveSessionData()
unsigned SessionEngine::debuggerCapabilities() const
{
return DebuggerEngine::debuggerCapabilities()
| AddWatcherCapability | WatchpointCapability;
| AddWatcherCapability
| BreakOnThrowAndCatchCapability
| WatchpointCapability;
}
} // namespace Internal

View File

@@ -1708,10 +1708,10 @@ void parseWatchData(const QSet<QByteArray> &expandedINames,
setWatchDataChildCount(childtemplate, item.findChild("childnumchild"));
//qDebug() << "CHILD TEMPLATE:" << childtemplate.toString();
int i = 0;
foreach (const GdbMi &child, children.children()) {
for (int i = 0, n = children.children().size(); i != n; ++i) {
const GdbMi &child = children.children().at(i);
WatchData data1 = childtemplate;
data1.sortId = i++;
data1.sortId = i;
GdbMi name = child.findChild("name");
if (name.isValid())
data1.name = _(name.data());

View File

@@ -797,17 +797,16 @@ HelpViewer* HelpPlugin::viewerForContextMode()
break;
}
HelpViewer *viewer = m_centralWidget->currentHelpViewer();
if (placeHolder && showSideBySide) {
RightPaneWidget::instance()->setShown(true);
createRightPaneContextViewer();
viewer = m_helpViewerForSideBar;
} else {
activateHelpMode();
if (!viewer)
viewer = OpenPagesManager::instance().createPage();
return m_helpViewerForSideBar;
}
activateHelpMode(); // should trigger an createPage...
HelpViewer *viewer = m_centralWidget->currentHelpViewer();
if (!viewer)
viewer = OpenPagesManager::instance().createPage();
return viewer;
}

View File

@@ -177,7 +177,8 @@ void OpenPagesManager::setupInitialPages()
CentralWidget::instance()->addPage(m_model->pageAt(i));
emit pagesChanged();
setCurrentPage(initialPage);
setCurrentPage((initialPage >= m_model->rowCount())
? m_model->rowCount() - 1 : initialPage);
m_openPagesSwitcher->selectCurrentPage();
}

View File

@@ -173,7 +173,11 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
QAction *showQuickToolbar = new QAction(tr("Show Qt Quick Toolbar"), this);
cmd = am->registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context);
#ifdef Q_WS_MACX
cmd->setDefaultKeySequence(QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space));
#else
cmd->setDefaultKeySequence(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Space));
#endif
connect(showQuickToolbar, SIGNAL(triggered()), this, SLOT(showContextPane()));
contextMenu->addAction(cmd);
qmlToolsMenu->addAction(cmd);

View File

@@ -382,29 +382,32 @@ void Highlighter::applyFormat(int offset,
TextFormatId formatId = m_kateFormats.m_ids.value(itemData->style());
if (formatId != Normal) {
QTextCharFormat format = m_creatorFormats.value(formatId);
QHash<TextFormatId, QTextCharFormat>::const_iterator cit =
m_creatorFormats.constFind(formatId);
if (cit != m_creatorFormats.constEnd()) {
QTextCharFormat format = cit.value();
if (itemData->isCustomized()) {
// Please notice that the following are applied every time for item datas which have
// customizations. The configureFormats method could be used to provide a "one time"
// configuration, but it would probably require to traverse all item datas from all
// definitions available/loaded (either to set the values or for some "notifying"
// strategy). This is because the highlighter does not really know on which
// definition(s) it is working. Since not many item datas specify customizations I
// think this approach would fit better. If there are other ideas...
if (itemData->color().isValid())
format.setForeground(itemData->color());
if (itemData->isItalicSpecified())
format.setFontItalic(itemData->isItalic());
if (itemData->isBoldSpecified())
format.setFontWeight(toFontWeight(itemData->isBold()));
if (itemData->isUnderlinedSpecified())
format.setFontUnderline(itemData->isUnderlined());
if (itemData->isStrikedOutSpecified())
format.setFontStrikeOut(itemData->isStrikedOut());
}
if (itemData->isCustomized()) {
// Please notice that the following are applied every time for item datas which have
// customizations. The configureFormats method could be used to provide a "one time"
// configuration, but it would probably require to traverse all item datas from all
// definitions available/loaded (either to set the values or for some "notifying"
// strategy). This is because the highlighter does not really know on which
// definition(s) it is working. Since not many item datas specify customizations I
// think this approach would fit better. If there are other ideas...
if (itemData->color().isValid())
format.setForeground(itemData->color());
if (itemData->isItalicSpecified())
format.setFontItalic(itemData->isItalic());
if (itemData->isBoldSpecified())
format.setFontWeight(toFontWeight(itemData->isBold()));
if (itemData->isUnderlinedSpecified())
format.setFontUnderline(itemData->isUnderlined());
if (itemData->isStrikedOutSpecified())
format.setFontStrikeOut(itemData->isStrikedOut());
setFormat(offset, count, format);
}
setFormat(offset, count, format);
}
}

View File

@@ -134,20 +134,6 @@ void PlainTextEditor::setFontSettings(const FontSettings &fs)
highlighter->configureFormat(Highlighter::String, fs.toTextCharFormat(
QLatin1String(Constants::C_STRING)));
// Creator does not have corresponding formats for the following ones. Implement them?
// For now I will leave hardcoded values.
QTextCharFormat format;
format.setForeground(Qt::blue);
highlighter->configureFormat(Highlighter::Others, format);
format.setForeground(Qt::red);
highlighter->configureFormat(Highlighter::Alert, format);
format.setForeground(Qt::darkBlue);
highlighter->configureFormat(Highlighter::Function, format);
format.setForeground(Qt::darkGray);
highlighter->configureFormat(Highlighter::RegionMarker, format);
format.setForeground(Qt::darkRed);
highlighter->configureFormat(Highlighter::Error, format);
highlighter->rehighlight();
}
}

View File

@@ -307,7 +307,8 @@ void testPeekAndPoke3()
s[i].a = i; // Break here. Expand s and s[0]. Step.
// Watcher Context: "Add New Watcher".
// Type ['s[%d].a' % i for i in range(5)]
// Expand it, continue stepping.
// Expand it, continue stepping. This should result in a list
// of five items containing the .a fields of s[0]..s[4].
}
Q_UNUSED(s);
}
@@ -1422,6 +1423,26 @@ Foo testStruct()
return f1;
}
void testTypeFormats()
{
// These tests should result in properly displayed umlauts in the
// Locals&Watchers view. It is only support on gdb with Python.
// Select UTF-8 in "Change Format for Type" in L&W context menu.
const char *s = "aöa";
// Windows: Select UTF-16 in "Change Format for Type" in L&W context menu.
// Other: Select UCS-6 in "Change Format for Type" in L&W context menu.
const wchar_t *w = L"aöa";
// Make sure to undo "Change Format".
int dummy = 1;
Q_UNUSED(s);
Q_UNUSED(w);
Q_UNUSED(dummy);
}
class Thread : public QThread
{
public:
@@ -2081,14 +2102,12 @@ int main(int argc, char *argv[])
testStdStack();
testStdString();
testStdVector();
testTypeFormats();
testPassByReference();
testPlugin();
testQList();
testQLinkedList();
const char *s = "aöa";
// wchar_t * support only with Python.
const wchar_t *w = L"aöa";
testNamespace();
//return 0;
testQHash();
@@ -2116,9 +2135,6 @@ int main(int argc, char *argv[])
//QColor color(255,128,10);
//QFont font;
Q_UNUSED(s);
Q_UNUSED(w);
return 0;
}